int imagetobmp(opj_image_t * image, const char *outfile) {
    int w, h;
    int i, pad;
    FILE *fdest = NULL;
    int adjustR, adjustG, adjustB;

    if (image->comps[0].prec < 8) {
        fprintf(stderr, "Unsupported number of components: %d\n", image->comps[0].prec);
        return 1;
    }
    if (image->numcomps >= 3 && image->comps[0].dx == image->comps[1].dx
            && image->comps[1].dx == image->comps[2].dx
            && image->comps[0].dy == image->comps[1].dy
            && image->comps[1].dy == image->comps[2].dy
            && image->comps[0].prec == image->comps[1].prec
            && image->comps[1].prec == image->comps[2].prec) {

        /* -->> -->> -->> -->>
        24 bits color
        <<-- <<-- <<-- <<-- */

        fdest = fopen(outfile, "wb");
        if (!fdest) {
            fprintf(stderr, "ERROR -> failed to open %s for writing\n", outfile);
            return 1;
        }

        w = (int)image->comps[0].w;
        h = (int)image->comps[0].h;

        fprintf(fdest, "BM");

        /* FILE HEADER */
        /* ------------- */
        fprintf(fdest, "%c%c%c%c",
                (OPJ_UINT8) (h * w * 3 + 3 * h * (w % 2) + 54) & 0xff,
                (OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54)	>> 8) & 0xff,
                (OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54)	>> 16) & 0xff,
                (OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2) + 54)	>> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (54) & 0xff, ((54) >> 8) & 0xff,((54) >> 16) & 0xff, ((54) >> 24) & 0xff);

        /* INFO HEADER   */
        /* ------------- */
        fprintf(fdest, "%c%c%c%c", (40) & 0xff, ((40) >> 8) & 0xff,	((40) >> 16) & 0xff, ((40) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((w) & 0xff),
                (OPJ_UINT8) ((w) >> 8) & 0xff,
                (OPJ_UINT8) ((w) >> 16) & 0xff,
                (OPJ_UINT8) ((w) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((h) & 0xff),
                (OPJ_UINT8) ((h) >> 8) & 0xff,
                (OPJ_UINT8) ((h) >> 16) & 0xff,
                (OPJ_UINT8) ((h) >> 24) & 0xff);
        fprintf(fdest, "%c%c", (1) & 0xff, ((1) >> 8) & 0xff);
        fprintf(fdest, "%c%c", (24) & 0xff, ((24) >> 8) & 0xff);
        fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (3 * h * w + 3 * h * (w % 2)) & 0xff,
                (OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 8) & 0xff,
                (OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 16) & 0xff,
                (OPJ_UINT8) ((h * w * 3 + 3 * h * (w % 2)) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff, ((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff,	((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);

        if (image->comps[0].prec > 8) {
            adjustR = (int)image->comps[0].prec - 8;
            printf("BMP CONVERSION: Truncating component 0 from %d bits to 8 bits\n", image->comps[0].prec);
        }
        else
            adjustR = 0;
        if (image->comps[1].prec > 8) {
            adjustG = (int)image->comps[1].prec - 8;
            printf("BMP CONVERSION: Truncating component 1 from %d bits to 8 bits\n", image->comps[1].prec);
        }
        else
            adjustG = 0;
        if (image->comps[2].prec > 8) {
            adjustB = (int)image->comps[2].prec - 8;
            printf("BMP CONVERSION: Truncating component 2 from %d bits to 8 bits\n", image->comps[2].prec);
        }
        else
            adjustB = 0;

        for (i = 0; i < w * h; i++) {
            OPJ_UINT8 rc, gc, bc;
            int r, g, b;

            r = image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
            r += (image->comps[0].sgnd ? 1 << (image->comps[0].prec - 1) : 0);
            r = ((r >> adjustR)+((r >> (adjustR-1))%2));
            if(r > 255) r = 255; else if(r < 0) r = 0;
            rc = (OPJ_UINT8)r;

            g = image->comps[1].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
            g += (image->comps[1].sgnd ? 1 << (image->comps[1].prec - 1) : 0);
            g = ((g >> adjustG)+((g >> (adjustG-1))%2));
            if(g > 255) g = 255; else if(g < 0) g = 0;
            gc = (OPJ_UINT8)g;

            b = image->comps[2].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
            b += (image->comps[2].sgnd ? 1 << (image->comps[2].prec - 1) : 0);
            b = ((b >> adjustB)+((b >> (adjustB-1))%2));
            if(b > 255) b = 255; else if(b < 0) b = 0;
            bc = (OPJ_UINT8)b;

            fprintf(fdest, "%c%c%c", bc, gc, rc);

            if ((i + 1) % w == 0) {
                for (pad = ((3 * w) % 4) ? (4 - (3 * w) % 4) : 0; pad > 0; pad--)	/* ADD */
                    fprintf(fdest, "%c", 0);
            }
        }
        fclose(fdest);
    } else {			/* Gray-scale */

        /* -->> -->> -->> -->>
        8 bits non code (Gray scale)
        <<-- <<-- <<-- <<-- */

        fdest = fopen(outfile, "wb");
        if (!fdest) {
            fprintf(stderr, "ERROR -> failed to open %s for writing\n", outfile);
            return 1;
        }
        w = (int)image->comps[0].w;
        h = (int)image->comps[0].h;

        fprintf(fdest, "BM");

        /* FILE HEADER */
        /* ------------- */
        fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (h * w + 54 + 1024 + h * (w % 2)) & 0xff,
                (OPJ_UINT8) ((h * w + 54 + 1024 + h * (w % 2)) >> 8) & 0xff,
                (OPJ_UINT8) ((h * w + 54 + 1024 + h * (w % 2)) >> 16) & 0xff,
                (OPJ_UINT8) ((h * w + 54 + 1024 + w * (w % 2)) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (54 + 1024) & 0xff, ((54 + 1024) >> 8) & 0xff,
                ((54 + 1024) >> 16) & 0xff,
                ((54 + 1024) >> 24) & 0xff);

        /* INFO HEADER */
        /* ------------- */
        fprintf(fdest, "%c%c%c%c", (40) & 0xff, ((40) >> 8) & 0xff,	((40) >> 16) & 0xff, ((40) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((w) & 0xff),
                (OPJ_UINT8) ((w) >> 8) & 0xff,
                (OPJ_UINT8) ((w) >> 16) & 0xff,
                (OPJ_UINT8) ((w) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) ((h) & 0xff),
                (OPJ_UINT8) ((h) >> 8) & 0xff,
                (OPJ_UINT8) ((h) >> 16) & 0xff,
                (OPJ_UINT8) ((h) >> 24) & 0xff);
        fprintf(fdest, "%c%c", (1) & 0xff, ((1) >> 8) & 0xff);
        fprintf(fdest, "%c%c", (8) & 0xff, ((8) >> 8) & 0xff);
        fprintf(fdest, "%c%c%c%c", (0) & 0xff, ((0) >> 8) & 0xff, ((0) >> 16) & 0xff, ((0) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (OPJ_UINT8) (h * w + h * (w % 2)) & 0xff,
                (OPJ_UINT8) ((h * w + h * (w % 2)) >> 8) &	0xff,
                (OPJ_UINT8) ((h * w + h * (w % 2)) >> 16) &	0xff,
                (OPJ_UINT8) ((h * w + h * (w % 2)) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff,	((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff,	((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (256) & 0xff, ((256) >> 8) & 0xff, ((256) >> 16) & 0xff, ((256) >> 24) & 0xff);
        fprintf(fdest, "%c%c%c%c", (256) & 0xff, ((256) >> 8) & 0xff, ((256) >> 16) & 0xff, ((256) >> 24) & 0xff);

        if (image->comps[0].prec > 8) {
            adjustR = (int)image->comps[0].prec - 8;
            printf("BMP CONVERSION: Truncating component 0 from %d bits to 8 bits\n", image->comps[0].prec);
        }else
            adjustR = 0;

        for (i = 0; i < 256; i++) {
            fprintf(fdest, "%c%c%c%c", i, i, i, 0);
        }

        for (i = 0; i < w * h; i++) {
            int r;

            r = image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)];
            r += (image->comps[0].sgnd ? 1 << (image->comps[0].prec - 1) : 0);
            r = ((r >> adjustR)+((r >> (adjustR-1))%2));
            if(r > 255) r = 255; else if(r < 0) r = 0;

            fprintf(fdest, "%c", (OPJ_UINT8)r);

            if ((i + 1) % w == 0) {
                for (pad = (w % 4) ? (4 - w % 4) : 0; pad > 0; pad--)	/* ADD */
                    fprintf(fdest, "%c", 0);
            }
        }
        fclose(fdest);
    }

    return 0;
}


 static uint32_t select_lease_time(struct dhcp_packet *packet)
 {
 	uint32_t lease_time_sec = server_config.max_lease_sec;
	uint8_t *lease_time_opt = udhcp_get_option32(packet, DHCP_LEASE_TIME);
 	if (lease_time_opt) {
 		move_from_unaligned32(lease_time_sec, lease_time_opt);
 		lease_time_sec = ntohl(lease_time_sec);
		if (lease_time_sec > server_config.max_lease_sec)
			lease_time_sec = server_config.max_lease_sec;
		if (lease_time_sec < server_config.min_lease_sec)
			lease_time_sec = server_config.min_lease_sec;
	}
	return lease_time_sec;
}


  void handshakeSuc(AsyncSSLSocket*) noexcept override {
    LOG(INFO) << "Handshake success";
    handshakeSuccess_ = true;
    if (socket_) {
      handshakeTime = socket_->getHandshakeTime();
    }
  }


history_tree_clone(OnigCaptureTreeNode* node)
{
  int i;
  OnigCaptureTreeNode *clone, *child;

  clone = history_node_new();
  CHECK_NULL_RETURN(clone);

  clone->beg = node->beg;
  clone->end = node->end;
  for (i = 0; i < node->num_childs; i++) {
    child = history_tree_clone(node->childs[i]);
    if (IS_NULL(child)) {
      history_tree_free(clone);
      return (OnigCaptureTreeNode* )0;
    }
    history_tree_add_child(clone, child);
  }

  return clone;
}


static bool is_zero(BlockDriverState *bs, int64_t offset, int64_t bytes)

{

    int nr;

    int64_t res;

    int64_t start;

    /* TODO: Widening to sector boundaries should only be needed as

     * long as we can't query finer granularity. */

    start = QEMU_ALIGN_DOWN(offset, BDRV_SECTOR_SIZE);

    bytes = QEMU_ALIGN_UP(offset + bytes, BDRV_SECTOR_SIZE) - start;

    /* Clamp to image length, before checking status of underlying sectors */

    if (start + bytes > bs->total_sectors * BDRV_SECTOR_SIZE) {

        bytes = bs->total_sectors * BDRV_SECTOR_SIZE - start;

    }

    if (!bytes) {

        return true;

    }

    res = bdrv_get_block_status_above(bs, NULL, start >> BDRV_SECTOR_BITS,

                                      bytes >> BDRV_SECTOR_BITS, &nr, NULL);

    return res >= 0 && (res & BDRV_BLOCK_ZERO) &&

        nr * BDRV_SECTOR_SIZE == bytes;

}


void AppLauncherHandler::FillAppDictionary(base::DictionaryValue* dictionary) {
  base::AutoReset<bool> auto_reset(&ignore_changes_, true);

  base::ListValue* list = new base::ListValue();
  Profile* profile = Profile::FromWebUI(web_ui());
  PrefService* prefs = profile->GetPrefs();

  for (std::set<std::string>::iterator it = visible_apps_.begin();
       it != visible_apps_.end(); ++it) {
    const Extension* extension = extension_service_->GetInstalledExtension(*it);
    if (extension && extensions::ui_util::ShouldDisplayInNewTabPage(
            extension, profile)) {
      base::DictionaryValue* app_info = GetAppInfo(extension);
      list->Append(app_info);
    }
  }

   dictionary->Set("apps", list);

   const base::ListValue* app_page_names =
       prefs->GetList(prefs::kNtpAppPageNames);
   if (!app_page_names || !app_page_names->GetSize()) {
    ListPrefUpdate update(prefs, prefs::kNtpAppPageNames);
    base::ListValue* list = update.Get();
    list->Set(0, new base::StringValue(
        l10n_util::GetStringUTF16(IDS_APP_DEFAULT_PAGE_NAME)));
    dictionary->Set("appPageNames",
                    static_cast<base::ListValue*>(list->DeepCopy()));
  } else {
    dictionary->Set("appPageNames",
                    static_cast<base::ListValue*>(app_page_names->DeepCopy()));
  }
}


bool HttpResponseHeaders::GetMimeType(std::string* mime_type) const {
  std::string unused;
  GetMimeTypeAndCharset(mime_type, &unused);
  return !mime_type->empty();
}


bool RenderWidgetHostViewGtk::NeedsInputGrab() {
  return popup_type_ == WebKit::WebPopupTypeSelect;
}


f_exepath(typval_T *argvars, typval_T *rettv)
{
    char_u *p = NULL;

    if (in_vim9script() && check_for_nonempty_string_arg(argvars, 0) == FAIL)
	return;
    (void)mch_can_exe(tv_get_string(&argvars[0]), &p, TRUE);
    rettv->v_type = VAR_STRING;
    rettv->vval.v_string = p;
}


void setCursiveFontFamilyWrapper(WebSettings* settings,
                                 const string16& font,
                                 UScriptCode script) {
  settings->setCursiveFontFamily(font, script);
}


static int vhost_scsi_exit(DeviceState *qdev)

{

    VirtIODevice *vdev = VIRTIO_DEVICE(qdev);

    VHostSCSI *s = VHOST_SCSI(qdev);

    VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(qdev);

    migrate_del_blocker(s->migration_blocker);

    error_free(s->migration_blocker);

    /* This will stop vhost backend. */

    vhost_scsi_set_status(vdev, 0);

    g_free(s->dev.vqs);

    return virtio_scsi_common_exit(vs);

}


TRIO_PRIVATE int TrioFormatProcess TRIO_ARGS3((data, format, parameters), trio_class_t* data,
                                              TRIO_CONST char* format, trio_parameter_t* parameters)
{
	int i;
#if TRIO_FEATURE_ERRNO
	TRIO_CONST char* string;
#endif
	trio_pointer_t pointer;
	trio_flags_t flags;
	int width;
	int precision;
	int base;
	int offset;

	offset = 0;
	i = 0;

	for (;;)
	{
		/* Skip the parameter entries */
		while (parameters[i].type == FORMAT_PARAMETER)
			i++;

		/* Copy non conversion-specifier part of format string */
		while (offset < parameters[i].beginOffset)
		{
			if (CHAR_IDENTIFIER == format[offset] && CHAR_IDENTIFIER == format[offset + 1])
			{
				data->OutStream(data, CHAR_IDENTIFIER);
				offset += 2;
			}
			else
			{
				data->OutStream(data, format[offset++]);
			}
		}

		/* Abort if we reached end of format string */
		if (parameters[i].type == FORMAT_SENTINEL)
			break;

		/* Ouput parameter */
		flags = parameters[i].flags;

		/* Find width */
		width = parameters[i].width;
		if (flags & FLAGS_WIDTH_PARAMETER)
		{
			/* Get width from parameter list */
			width = (int)parameters[width].data.number.as_signed;
			if (width < 0)
			{
				/*
				 * A negative width is the same as the - flag and
				 * a positive width.
				 */
				flags |= FLAGS_LEFTADJUST;
				flags &= ~FLAGS_NILPADDING;
				width = -width;
			}
		}

		/* Find precision */
		if (flags & FLAGS_PRECISION)
		{
			precision = parameters[i].precision;
			if (flags & FLAGS_PRECISION_PARAMETER)
			{
				/* Get precision from parameter list */
				precision = (int)parameters[precision].data.number.as_signed;
				if (precision < 0)
				{
					/*
					 * A negative precision is the same as no
					 * precision
					 */
					precision = NO_PRECISION;
				}
			}
		}
		else
		{
			precision = NO_PRECISION;
		}

		/* Find base */
		if (NO_BASE != parameters[i].baseSpecifier)
		{
			/* Base from specifier has priority */
			base = parameters[i].baseSpecifier;
		}
		else if (flags & FLAGS_BASE_PARAMETER)
		{
			/* Get base from parameter list */
			base = parameters[i].base;
			base = (int)parameters[base].data.number.as_signed;
		}
		else
		{
			/* Use base from format string */
			base = parameters[i].base;
		}

		switch (parameters[i].type)
		{
			case FORMAT_CHAR:
#if TRIO_FEATURE_QUOTE
				if (flags & FLAGS_QUOTE)
					data->OutStream(data, CHAR_QUOTE);
#endif
				if (!(flags & FLAGS_LEFTADJUST))
				{
					while (--width > 0)
						data->OutStream(data, CHAR_ADJUST);
				}
#if TRIO_FEATURE_WIDECHAR
				if (flags & FLAGS_WIDECHAR)
				{
					TrioWriteWideStringCharacter(
					    data, (trio_wchar_t)parameters[i].data.number.as_signed, flags, NO_WIDTH);
				}
				else
#endif
				{
					TrioWriteStringCharacter(data, (int)parameters[i].data.number.as_signed, flags);
				}

				if (flags & FLAGS_LEFTADJUST)
				{
					while (--width > 0)
						data->OutStream(data, CHAR_ADJUST);
				}
#if TRIO_FEATURE_QUOTE
				if (flags & FLAGS_QUOTE)
					data->OutStream(data, CHAR_QUOTE);
#endif

				break; /* FORMAT_CHAR */

			case FORMAT_INT:
				TrioWriteNumber(data, parameters[i].data.number.as_unsigned, flags, width,
				                precision, base);

				break; /* FORMAT_INT */

#if TRIO_FEATURE_FLOAT
			case FORMAT_DOUBLE:
				TrioWriteDouble(data, parameters[i].data.longdoubleNumber, flags, width, precision,
				                base);
				break; /* FORMAT_DOUBLE */
#endif

			case FORMAT_STRING:
#if TRIO_FEATURE_WIDECHAR
				if (flags & FLAGS_WIDECHAR)
				{
					TrioWriteWideString(data, parameters[i].data.wstring, flags, width, precision);
				}
				else
#endif
				{
					TrioWriteString(data, parameters[i].data.string, flags, width, precision);
				}
				break; /* FORMAT_STRING */

			case FORMAT_POINTER:
			{
				trio_reference_t reference;

				reference.data = data;
				reference.parameter = &parameters[i];
				trio_print_pointer(&reference, parameters[i].data.pointer);
			}
			break; /* FORMAT_POINTER */

			case FORMAT_COUNT:
				pointer = parameters[i].data.pointer;
				if (NULL != pointer)
				{
					/*
					 * C99 paragraph 7.19.6.1.8 says "the number of
					 * characters written to the output stream so far by
					 * this call", which is data->actually.committed
					 */
#if TRIO_FEATURE_SIZE_T || TRIO_FEATURE_SIZE_T_UPPER
					if (flags & FLAGS_SIZE_T)
						*(size_t*)pointer = (size_t)data->actually.committed;
					else
#endif
#if TRIO_FEATURE_PTRDIFF_T
					    if (flags & FLAGS_PTRDIFF_T)
						*(ptrdiff_t*)pointer = (ptrdiff_t)data->actually.committed;
					else
#endif
#if TRIO_FEATURE_INTMAX_T
					    if (flags & FLAGS_INTMAX_T)
						*(trio_intmax_t*)pointer = (trio_intmax_t)data->actually.committed;
					else
#endif
					    if (flags & FLAGS_QUAD)
					{
						*(trio_ulonglong_t*)pointer = (trio_ulonglong_t)data->actually.committed;
					}
					else if (flags & FLAGS_LONG)
					{
						*(long int*)pointer = (long int)data->actually.committed;
					}
					else if (flags & FLAGS_SHORT)
					{
						*(short int*)pointer = (short int)data->actually.committed;
					}
					else
					{
						*(int*)pointer = (int)data->actually.committed;
					}
				}
				break; /* FORMAT_COUNT */

			case FORMAT_PARAMETER:
				break; /* FORMAT_PARAMETER */

#if TRIO_FEATURE_ERRNO
			case FORMAT_ERRNO:
				string = trio_error(parameters[i].data.errorNumber);
				if (string)
				{
					TrioWriteString(data, string, flags, width, precision);
				}
				else
				{
					data->OutStream(data, '#');
					TrioWriteNumber(data, (trio_uintmax_t)parameters[i].data.errorNumber, flags,
					                width, precision, BASE_DECIMAL);
				}
				break; /* FORMAT_ERRNO */
#endif                 /* TRIO_FEATURE_ERRNO */

#if TRIO_FEATURE_USER_DEFINED
			case FORMAT_USER_DEFINED:
			{
				trio_reference_t reference;
				trio_userdef_t* def = NULL;

				if (parameters[i].flags & FLAGS_USER_DEFINED_PARAMETER)
				{
					/* Use handle */
					if ((i > 0) || (parameters[i - 1].type == FORMAT_PARAMETER))
						def = (trio_userdef_t*)parameters[i - 1].data.pointer;
				}
				else
				{
					/* Look up namespace */
					def = TrioFindNamespace(parameters[i].user_defined.namespace, NULL);
				}
				if (def)
				{
					reference.data = data;
					reference.parameter = &parameters[i];
					def->callback(&reference);
				}
			}
			break;
#endif /* TRIO_FEATURE_USER_DEFINED */

			default:
				break;
		} /* switch parameter type */

		/* Prepare for next */
		offset = parameters[i].endOffset;
		i++;
	}

	return data->processed;
}


bool CUser::AddCTCPReply(const CString& sCTCP, const CString& sReply) {
    // Reject CTCP requests containing spaces
    if (sCTCP.find_first_of(' ') != CString::npos) {
        return false;
    }
    // Reject empty CTCP requests
    if (sCTCP.empty()) {
        return false;
    }
    m_mssCTCPReplies[sCTCP.AsUpper()] = sReply;
    return true;
}


void Textfield::OnMouseReleased(const ui::MouseEvent& event) {
  selection_controller_.OnMouseReleased(event);
}


static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb)
{
	struct nlattr **attrbuf;
	struct survey_info survey;
	struct cfg80211_registered_device *rdev;
	struct wireless_dev *wdev;
	int survey_idx = cb->args[2];
	int res;
	bool radio_stats;

	attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), GFP_KERNEL);
	if (!attrbuf)
		return -ENOMEM;

	rtnl_lock();
	res = nl80211_prepare_wdev_dump(cb, &rdev, &wdev);
	if (res)
		goto out_err;

	/* prepare_wdev_dump parsed the attributes */
	radio_stats = attrbuf[NL80211_ATTR_SURVEY_RADIO_STATS];

	if (!wdev->netdev) {
		res = -EINVAL;
		goto out_err;
	}

	if (!rdev->ops->dump_survey) {
		res = -EOPNOTSUPP;
		goto out_err;
	}

	while (1) {
		res = rdev_dump_survey(rdev, wdev->netdev, survey_idx, &survey);
		if (res == -ENOENT)
			break;
		if (res)
			goto out_err;

		/* don't send disabled channels, but do send non-channel data */
		if (survey.channel &&
		    survey.channel->flags & IEEE80211_CHAN_DISABLED) {
			survey_idx++;
			continue;
		}

		if (nl80211_send_survey(skb,
				NETLINK_CB(cb->skb).portid,
				cb->nlh->nlmsg_seq, NLM_F_MULTI,
				wdev->netdev, radio_stats, &survey) < 0)
			goto out;
		survey_idx++;
	}

 out:
	cb->args[2] = survey_idx;
	res = skb->len;
 out_err:
	kfree(attrbuf);
	rtnl_unlock();
	return res;
}


static int mpage_process_page_bufs(struct mpage_da_data *mpd,
				   struct buffer_head *head,
				   struct buffer_head *bh,
				   ext4_lblk_t lblk)
{
	struct inode *inode = mpd->inode;
	int err;
	ext4_lblk_t blocks = (i_size_read(inode) + (1 << inode->i_blkbits) - 1)
							>> inode->i_blkbits;

	do {
		BUG_ON(buffer_locked(bh));

		if (lblk >= blocks || !mpage_add_bh_to_extent(mpd, lblk, bh)) {
			/* Found extent to map? */
			if (mpd->map.m_len)
				return 0;
			/* Everything mapped so far and we hit EOF */
			break;
		}
	} while (lblk++, (bh = bh->b_this_page) != head);
	/* So far everything mapped? Submit the page for IO. */
	if (mpd->map.m_len == 0) {
		err = mpage_submit_page(mpd, head->b_page);
		if (err < 0)
			return err;
	}
	return lblk < blocks;
}


error::Error GLES2DecoderImpl::HandleGetUniformIndices(
    uint32_t immediate_data_size,
    const volatile void* cmd_data) {
  if (!feature_info_->IsWebGL2OrES3Context())
    return error::kUnknownCommand;
  const volatile gles2::cmds::GetUniformIndices& c =
      *static_cast<const volatile gles2::cmds::GetUniformIndices*>(cmd_data);
  Bucket* bucket = GetBucket(c.names_bucket_id);
  if (!bucket) {
    return error::kInvalidArguments;
  }
  GLsizei count = 0;
  std::vector<char*> names;
  std::vector<GLint> len;
  if (!bucket->GetAsStrings(&count, &names, &len) || count <= 0) {
    return error::kInvalidArguments;
  }
  typedef cmds::GetUniformIndices::Result Result;
  Result* result = GetSharedMemoryAs<Result*>(
      c.indices_shm_id, c.indices_shm_offset,
      Result::ComputeSize(static_cast<size_t>(count)));
  GLuint* indices = result ? result->GetData() : nullptr;
  if (indices == nullptr) {
    return error::kOutOfBounds;
  }
  if (result->size != 0) {
    return error::kInvalidArguments;
  }
  Program* program = GetProgramInfoNotShader(c.program, "glGetUniformIndices");
  if (!program) {
    return error::kNoError;
  }
  GLuint service_id = program->service_id();
  GLint link_status = GL_FALSE;
  api()->glGetProgramivFn(service_id, GL_LINK_STATUS, &link_status);
  if (link_status != GL_TRUE) {
    LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
        "glGetUniformIndices", "program not linked");
    return error::kNoError;
  }
  LOCAL_COPY_REAL_GL_ERRORS_TO_WRAPPER("GetUniformIndices");
  api()->glGetUniformIndicesFn(service_id, count, &names[0], indices);
  GLenum error = api()->glGetErrorFn();
  if (error == GL_NO_ERROR) {
    result->SetNumResults(count);
  } else {
    LOCAL_SET_GL_ERROR(error, "GetUniformIndices", "");
  }
  return error::kNoError;
}


static int matroska_decode_buffer(uint8_t** buf, int* buf_size,

                                  MatroskaTrack *track)

{

    MatroskaTrackEncoding *encodings = track->encodings.elem;

    uint8_t* data = *buf;

    int isize = *buf_size;

    uint8_t* pkt_data = NULL;

    int pkt_size = isize;

    int result = 0;

    int olen;

    if (pkt_size >= 10000000)

        return -1;

    switch (encodings[0].compression.algo) {

    case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:

        return encodings[0].compression.settings.size;

    case MATROSKA_TRACK_ENCODING_COMP_LZO:

        do {

            olen = pkt_size *= 3;

            pkt_data = av_realloc(pkt_data, pkt_size+AV_LZO_OUTPUT_PADDING);

            result = av_lzo1x_decode(pkt_data, &olen, data, &isize);

        } while (result==AV_LZO_OUTPUT_FULL && pkt_size<10000000);

        if (result)

            goto failed;

        pkt_size -= olen;

        break;

#if CONFIG_ZLIB

    case MATROSKA_TRACK_ENCODING_COMP_ZLIB: {

        z_stream zstream = {0};

        if (inflateInit(&zstream) != Z_OK)

            return -1;

        zstream.next_in = data;

        zstream.avail_in = isize;

        do {

            pkt_size *= 3;

            pkt_data = av_realloc(pkt_data, pkt_size);

            zstream.avail_out = pkt_size - zstream.total_out;

            zstream.next_out = pkt_data + zstream.total_out;

            result = inflate(&zstream, Z_NO_FLUSH);

        } while (result==Z_OK && pkt_size<10000000);

        pkt_size = zstream.total_out;

        inflateEnd(&zstream);

        if (result != Z_STREAM_END)

            goto failed;

        break;

    }

#endif

#if CONFIG_BZLIB

    case MATROSKA_TRACK_ENCODING_COMP_BZLIB: {

        bz_stream bzstream = {0};

        if (BZ2_bzDecompressInit(&bzstream, 0, 0) != BZ_OK)

            return -1;

        bzstream.next_in = data;

        bzstream.avail_in = isize;

        do {

            pkt_size *= 3;

            pkt_data = av_realloc(pkt_data, pkt_size);

            bzstream.avail_out = pkt_size - bzstream.total_out_lo32;

            bzstream.next_out = pkt_data + bzstream.total_out_lo32;

            result = BZ2_bzDecompress(&bzstream);

        } while (result==BZ_OK && pkt_size<10000000);

        pkt_size = bzstream.total_out_lo32;

        BZ2_bzDecompressEnd(&bzstream);

        if (result != BZ_STREAM_END)

            goto failed;

        break;

    }

#endif

    default:

        return -1;

    }

    *buf = pkt_data;

    *buf_size = pkt_size;

    return 0;

 failed:

    av_free(pkt_data);

    return -1;

}


static void io_mem_free(void *ptr)
{
	struct page *page;

	if (!ptr)
		return;

	page = virt_to_head_page(ptr);
	if (put_page_testzero(page))
		free_compound_page(page);


static ssize_t cuse_class_abort_store(struct device *dev,
				      struct device_attribute *attr,
				      const char *buf, size_t count)
{
	struct cuse_conn *cc = dev_get_drvdata(dev);

	fuse_abort_conn(&cc->fc);
	return count;
}


e1000e_write_lgcy_rx_descr(E1000ECore *core, uint8_t *desc,
                           struct NetRxPkt *pkt,
                           const E1000E_RSSInfo *rss_info,
                           uint16_t length)
{
    uint32_t status_flags, rss, mrq;
    uint16_t ip_id;

    struct e1000_rx_desc *d = (struct e1000_rx_desc *) desc;

    assert(!rss_info->enabled);

    d->length = cpu_to_le16(length);
    d->csum = 0;

    e1000e_build_rx_metadata(core, pkt, pkt != NULL,
                             rss_info,
                             &rss, &mrq,
                             &status_flags, &ip_id,
                             &d->special);
    d->errors = (uint8_t) (le32_to_cpu(status_flags) >> 24);
    d->status = (uint8_t) le32_to_cpu(status_flags);
    d->special = 0;
}


_rpc_reattach_tasks(slurm_msg_t *msg)
{
	reattach_tasks_request_msg_t  *req = msg->data;
	reattach_tasks_response_msg_t *resp =
		xmalloc(sizeof(reattach_tasks_response_msg_t));
	slurm_msg_t                    resp_msg;
	int          rc   = SLURM_SUCCESS;
	uint16_t     port = 0;
	char         host[MAXHOSTNAMELEN];
	slurm_addr_t   ioaddr;
	void        *job_cred_sig;
	uint32_t     len;
	int               fd;
	uid_t             req_uid;
	slurm_addr_t *cli = &msg->orig_addr;
	uint32_t nodeid = (uint32_t)NO_VAL;
	uid_t uid = -1;
	uint16_t protocol_version;

	slurm_msg_t_copy(&resp_msg, msg);
	fd = stepd_connect(conf->spooldir, conf->node_name,
			   req->job_id, req->job_step_id, &protocol_version);
	if (fd == -1) {
		debug("reattach for nonexistent job %u.%u stepd_connect"
		      " failed: %m", req->job_id, req->job_step_id);
		rc = ESLURM_INVALID_JOB_ID;
		goto done;
	}

	if ((int)(uid = stepd_get_uid(fd, protocol_version)) < 0) {
		debug("_rpc_reattach_tasks couldn't read from the "
		      "step %u.%u: %m",
		      req->job_id, req->job_step_id);
		rc = ESLURM_INVALID_JOB_ID;
		goto done2;
	}

	nodeid = stepd_get_nodeid(fd, protocol_version);

	debug2("_rpc_reattach_tasks: nodeid %d in the job step", nodeid);

	req_uid = g_slurm_auth_get_uid(msg->auth_cred, conf->auth_info);
	if ((req_uid != uid) && (!_slurm_authorized_user(req_uid))) {
		error("uid %ld attempt to attach to job %u.%u owned by %ld",
		      (long) req_uid, req->job_id, req->job_step_id,
		      (long) uid);
		rc = EPERM;
		goto done2;
	}

	memset(resp, 0, sizeof(reattach_tasks_response_msg_t));
	slurm_get_ip_str(cli, &port, host, sizeof(host));

	/*
	 * Set response address by resp_port and client address
	 */
	memcpy(&resp_msg.address, cli, sizeof(slurm_addr_t));
	if (req->num_resp_port > 0) {
		port = req->resp_port[nodeid % req->num_resp_port];
		slurm_set_addr(&resp_msg.address, port, NULL);
	}

	/*
	 * Set IO address by io_port and client address
	 */
	memcpy(&ioaddr, cli, sizeof(slurm_addr_t));

	if (req->num_io_port > 0) {
		port = req->io_port[nodeid % req->num_io_port];
		slurm_set_addr(&ioaddr, port, NULL);
	}

	/*
	 * Get the signature of the job credential.  slurmstepd will need
	 * this to prove its identity when it connects back to srun.
	 */
	slurm_cred_get_signature(req->cred, (char **)(&job_cred_sig), &len);
	if (len != SLURM_IO_KEY_SIZE) {
		error("Incorrect slurm cred signature length");
		goto done2;
	}

	resp->gtids = NULL;
	resp->local_pids = NULL;

	 /* NOTE: We need to use the protocol_version from
	  * sattach here since responses will be sent back to it. */
	if (msg->protocol_version < protocol_version)
		protocol_version = msg->protocol_version;

	/* Following call fills in gtids and local_pids when successful. */
	rc = stepd_attach(fd, protocol_version, &ioaddr,
			  &resp_msg.address, job_cred_sig, resp);
	if (rc != SLURM_SUCCESS) {
		debug2("stepd_attach call failed");
		goto done2;
	}

done2:
	close(fd);
done:
	debug2("update step addrs rc = %d", rc);
	resp_msg.data         = resp;
	resp_msg.msg_type     = RESPONSE_REATTACH_TASKS;
	resp->node_name       = xstrdup(conf->node_name);
	resp->return_code     = rc;
	debug2("node %s sending rc = %d", conf->node_name, rc);

	slurm_send_node_msg(msg->conn_fd, &resp_msg);
	slurm_free_reattach_tasks_response_msg(resp);
}


void smp_derive_link_key_from_long_term_key(tSMP_CB* p_cb,
                                            tSMP_INT_DATA* p_data) {
  tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN;

  SMP_TRACE_DEBUG("%s", __func__);
 if (!smp_calculate_link_key_from_long_term_key(p_cb)) {
    SMP_TRACE_ERROR("%s failed", __func__);
    tSMP_INT_DATA smp_int_data;
    smp_int_data.status = status;
    smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data);
 return;
 }
}


int __tlb_remove_page(struct mmu_gather *tlb, struct page *page)
{
	struct mmu_gather_batch *batch;

	VM_BUG_ON(!tlb->end);

	batch = tlb->active;
	batch->pages[batch->nr++] = page;
	if (batch->nr == batch->max) {
		if (!tlb_next_batch(tlb))
			return 0;
		batch = tlb->active;
	}
	VM_BUG_ON_PAGE(batch->nr > batch->max, page);

	return batch->max - batch->nr;
}


static int row_get_classname(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC)
{
	if (parent) {
		return FAILURE;
	} else {
		*class_name = estrndup("PDORow", sizeof("PDORow")-1);
		*class_name_len = sizeof("PDORow")-1;
		return SUCCESS;
	}


void proto_register_iax2 ( void ) {
 static hf_register_info hf [ ] = {
 {
 & hf_iax2_packet_type , {
 "Packet type" , "iax2.packet_type" , FT_UINT8 , BASE_DEC , VALS ( iax_packet_types ) , 0 , "Full/minivoice/minivideo/trunk packet" , HFILL }
 }
 , {
 & hf_iax2_callno , {
 "Call identifier" , "iax2.call" , FT_UINT32 , BASE_DEC , NULL , 0 , "This is the identifier Wireshark assigns to identify this call." " It does not correspond to any real field in the protocol" , HFILL }
 }
 , {
 & hf_iax2_scallno , {
 "Source call" , "iax2.src_call" , FT_UINT16 , BASE_DEC , NULL , 0x7FFF , "src_call holds the number of this call at the packet source pbx" , HFILL }
 }
 , {
 & hf_iax2_dcallno , {
 "Destination call" , "iax2.dst_call" , FT_UINT16 , BASE_DEC , NULL , 0x7FFF , "dst_call holds the number of this call at the packet destination" , HFILL }
 }
 , {
 & hf_iax2_retransmission , {
 "Retransmission" , "iax2.retransmission" , FT_BOOLEAN , 16 , NULL , 0x8000 , "retransmission is set if this packet is a retransmission of an earlier failed packet" , HFILL }
 }
 , {
 & hf_iax2_ts , {
 "Timestamp" , "iax2.timestamp" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "timestamp is the time, in ms after the start of this call, at which this packet was transmitted" , HFILL }
 }
 , {
 & hf_iax2_minits , {
 "Timestamp" , "iax2.timestamp" , FT_UINT16 , BASE_DEC , NULL , 0x0 , "timestamp is the time, in ms after the start of this call, at which this packet was transmitted" , HFILL }
 }
 , {
 & hf_iax2_minividts , {
 "Timestamp" , "iax2.timestamp" , FT_UINT16 , BASE_DEC , NULL , 0x7FFF , "timestamp is the time, in ms after the start of this call, at which this packet was transmitted" , HFILL }
 }
 , {
 & hf_iax2_absts , {
 "Absolute Time" , "iax2.abstime" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_LOCAL , NULL , 0x0 , "The absolute time of this packet (calculated by adding the IAX timestamp to the start time of this call)" , HFILL }
 }
 , {
 & hf_iax2_lateness , {
 "Lateness" , "iax2.lateness" , FT_RELATIVE_TIME , BASE_NONE , NULL , 0x0 , "The lateness of this packet compared to its timestamp" , HFILL }
 }
 , {
 & hf_iax2_minividmarker , {
 "Marker" , "iax2.video.marker" , FT_UINT16 , BASE_DEC , NULL , 0x8000 , "RTP end-of-frame marker" , HFILL }
 }
 , {
 & hf_iax2_oseqno , {
 "Outbound seq.no." , "iax2.oseqno" , FT_UINT16 , BASE_DEC , NULL , 0x0 , "oseqno is the sequence no of this packet. The first packet has oseqno==0," " and subsequent packets increment the oseqno by 1" , HFILL }
 }
 , {
 & hf_iax2_iseqno , {
 "Inbound seq.no." , "iax2.iseqno" , FT_UINT16 , BASE_DEC , NULL , 0x0 , "iseqno is the sequence no of the last successfully received packet" , HFILL }
 }
 , {
 & hf_iax2_type , {
 "Type" , "iax2.type" , FT_UINT8 , BASE_DEC | BASE_EXT_STRING , & iax_frame_types_ext , 0x0 , "For full IAX2 frames, type is the type of frame" , HFILL }
 }
 , {
 & hf_iax2_csub , {
 "Unknown subclass" , "iax2.subclass" , FT_UINT8 , BASE_DEC , NULL , 0x0 , "Subclass of unknown type of full IAX2 frame" , HFILL }
 }
 , {
 & hf_iax2_dtmf_csub , {
 "DTMF subclass (digit)" , "iax2.dtmf.subclass" , FT_STRINGZ , BASE_NONE , NULL , 0x0 , "DTMF subclass gives the DTMF digit" , HFILL }
 }
 , {
 & hf_iax2_cmd_csub , {
 "Control subclass" , "iax2.control.subclass" , FT_UINT8 , BASE_DEC | BASE_EXT_STRING , & iax_cmd_subclasses_ext , 0x0 , "This gives the command number for a Control packet." , HFILL }
 }
 , {
 & hf_iax2_iax_csub , {
 "IAX subclass" , "iax2.iax.subclass" , FT_UINT8 , BASE_DEC | BASE_EXT_STRING , & iax_iax_subclasses_ext , 0x0 , "IAX subclass gives the command number for IAX signaling packets" , HFILL }
 }
 , {
 & hf_iax2_voice_csub , {
 "Voice Subclass (compressed codec no)" , "iax2.voice.subclass" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_voice_codec , {
 "CODEC" , "iax2.voice.codec" , FT_UINT32 , BASE_HEX | BASE_EXT_STRING , & codec_types_ext , 0x0 , "CODEC gives the codec used to encode audio data" , HFILL }
 }
 , {
 & hf_iax2_video_csub , {
 "Video Subclass (compressed codec no)" , "iax2.video.subclass" , FT_UINT8 , BASE_DEC , NULL , 0xBF , NULL , HFILL }
 }
 , {
 & hf_iax2_marker , {
 "Marker" , "iax2.video.marker" , FT_BOOLEAN , 8 , NULL , 0x40 , "RTP end-of-frame marker" , HFILL }
 }
 , {
 & hf_iax2_video_codec , {
 "CODEC" , "iax2.video.codec" , FT_UINT32 , BASE_HEX | BASE_EXT_STRING , & codec_types_ext , 0 , "The codec used to encode video data" , HFILL }
 }
 , {
 & hf_iax2_modem_csub , {
 "Modem subclass" , "iax2.modem.subclass" , FT_UINT8 , BASE_DEC , VALS ( iax_modem_subclasses ) , 0x0 , "Modem subclass gives the type of modem" , HFILL }
 }
 , {
 & hf_iax2_text_csub , {
 "Text subclass" , "iax2.text.subclass" , FT_UINT8 , BASE_DEC , VALS ( iax_text_subclasses ) , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_text_text , {
 "Text" , "iax2.text.text" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_html_csub , {
 "HTML subclass" , "iax2.html.subclass" , FT_UINT8 , BASE_DEC , VALS ( iax_html_subclasses ) , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_html_url , {
 "HTML URL" , "iax2.html.url" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_trunk_ts , {
 "Timestamp" , "iax2.timestamp" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "timestamp is the time, in ms after the start of Command data this call," " at which this trunk packet was transmitted" , HFILL }
 }
 , {
 & hf_iax2_trunk_metacmd , {
 "Meta command" , "iax2.trunk.metacmd" , FT_UINT8 , BASE_DEC , NULL , 0x7F , "Meta command indicates whether or not the Meta Frame is a trunk." , HFILL }
 }
 , {
 & hf_iax2_trunk_cmddata , {
 "Command data" , "iax2.trunk.cmddata" , FT_UINT8 , BASE_HEX , NULL , 0x0 , "Flags for options that apply to a trunked call" , HFILL }
 }
 , {
 & hf_iax2_trunk_cmddata_ts , {
 "Trunk timestamps" , "iax2.trunk.cmddata.ts" , FT_BOOLEAN , 8 , NULL , IAX2_TRUNK_TS , "True: calls do each include their own timestamp" , HFILL }
 }
 , {
 & hf_iax2_trunk_call_len , {
 "Data length" , "iax2.trunk.call.len" , FT_UINT16 , BASE_DEC , NULL , 0x0 , "Trunk call data length in octets" , HFILL }
 }
 , {
 & hf_iax2_trunk_call_scallno , {
 "Source call number" , "iax2.trunk.call.scallno" , FT_UINT16 , BASE_DEC , NULL , 0x7FFF , "Trunk call source call number" , HFILL }
 }
 , {
 & hf_iax2_trunk_call_ts , {
 "Timestamp" , "iax2.trunk.call.ts" , FT_UINT16 , BASE_DEC , NULL , 0x0 , "timestamp is the time, in ms after the start of this call, at which this packet was transmitted" , HFILL }
 }
 , {
 & hf_iax2_trunk_call_data , {
 "Data" , "iax2.trunk.call.payload" , FT_BYTES , BASE_NONE , NULL , 0x0 , "Payload carried by this trunked packet." , HFILL }
 }
 , {
 & hf_iax2_trunk_ncalls , {
 "Number of calls" , "iax2.trunk.ncalls" , FT_UINT16 , BASE_DEC , NULL , 0x0 , "Number of calls in this trunk packet" , HFILL }
 }
 , {
 & hf_IAX_IE_APPARENTADDR_SINFAMILY , {
 "Family" , "iax2.iax.app_addr.sinfamily" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
 }
 , {
 & hf_IAX_IE_APPARENTADDR_SINPORT , {
 "Port" , "iax2.iax.app_addr.sinport" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
 }
 , {
 & hf_IAX_IE_APPARENTADDR_SINADDR , {
 "Address" , "iax2.iax.app_addr.sinaddr" , FT_IPv4 , BASE_NONE , NULL , 0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CALLED_NUMBER ] , {
 "Number/extension being called" , "iax2.iax.called_number" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CALLING_NUMBER ] , {
 "Calling number" , "iax2.iax.calling_number" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CALLING_ANI ] , {
 "Calling number ANI for billing" , "iax2.iax.calling_ani" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CALLING_NAME ] , {
 "Name of caller" , "iax2.iax.calling_name" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CALLED_CONTEXT ] , {
 "Context for number" , "iax2.iax.called_context" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_USERNAME ] , {
 "Username (peer or user) for authentication" , "iax2.iax.username" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_PASSWORD ] , {
 "Password for authentication" , "iax2.iax.password" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CAPABILITY ] , {
 "Actual codec capability" , "iax2.iax.capability" , FT_UINT32 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_FORMAT ] , {
 "Desired codec format" , "iax2.iax.format" , FT_UINT32 , BASE_HEX | BASE_EXT_STRING , & codec_types_ext , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_LANGUAGE ] , {
 "Desired language" , "iax2.iax.language" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_VERSION ] , {
 "Protocol version" , "iax2.iax.version" , FT_UINT16 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_ADSICPE ] , {
 "CPE ADSI capability" , "iax2.iax.cpe_adsi" , FT_UINT16 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_DNID ] , {
 "Originally dialed DNID" , "iax2.iax.dnid" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_AUTHMETHODS ] , {
 "Authentication method(s)" , "iax2.iax.auth.methods" , FT_UINT16 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CHALLENGE ] , {
 "Challenge data for MD5/RSA" , "iax2.iax.auth.challenge" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_MD5_RESULT ] , {
 "MD5 challenge result" , "iax2.iax.auth.md5" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_RSA_RESULT ] , {
 "RSA challenge result" , "iax2.iax.auth.rsa" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_REFRESH ] , {
 "When to refresh registration" , "iax2.iax.refresh" , FT_INT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_DPSTATUS ] , {
 "Dialplan status" , "iax2.iax.dialplan_status" , FT_UINT16 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CALLNO ] , {
 "Call number of peer" , "iax2.iax.call_no" , FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CAUSE ] , {
 "Cause" , "iax2.iax.cause" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_IAX_UNKNOWN ] , {
 "Unknown IAX command" , "iax2.iax.iax_unknown" , FT_BYTES , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_MSGCOUNT ] , {
 "How many messages waiting" , "iax2.iax.msg_count" , FT_INT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_AUTOANSWER ] , {
 "Request auto-answering" , "iax2.iax.autoanswer" , FT_NONE , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_MUSICONHOLD ] , {
 "Request musiconhold with QUELCH" , "iax2.iax.moh" , FT_NONE , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_TRANSFERID ] , {
 "Transfer Request Identifier" , "iax2.iax.transferid" , FT_UINT32 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_RDNIS ] , {
 "Referring DNIS" , "iax2.iax.rdnis" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_PROVISIONING ] , {
 "Provisioning info" , "iax2.iax.provisioning" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_AESPROVISIONING ] , {
 "AES Provisioning info" , "iax2.iax.aesprovisioning" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_DATETIME ] , {
 "Date/Time" , "iax2.iax.datetime.raw" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ie_datetime , {
 "Date/Time" , "iax2.iax.datetime" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_LOCAL , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_DEVICETYPE ] , {
 "Device type" , "iax2.iax.devicetype" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_SERVICEIDENT ] , {
 "Service identifier" , "iax2.iax.serviceident" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_FIRMWAREVER ] , {
 "Firmware version" , "iax2.iax.firmwarever" , FT_UINT16 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_FWBLOCKDESC ] , {
 "Firmware block description" , "iax2.iax.fwblockdesc" , FT_UINT32 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_FWBLOCKDATA ] , {
 "Firmware block of data" , "iax2.iax.fwblockdata" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_PROVVER ] , {
 "Provisioning version" , "iax2.iax.provver" , FT_UINT32 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CALLINGPRES ] , {
 "Calling presentation" , "iax2.iax.callingpres" , FT_UINT8 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CALLINGTON ] , {
 "Calling type of number" , "iax2.iax.callington" , FT_UINT8 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CALLINGTNS ] , {
 "Calling transit network select" , "iax2.iax.callingtns" , FT_UINT16 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_SAMPLINGRATE ] , {
 "Supported sampling rates" , "iax2.iax.samplingrate" , FT_UINT16 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CAUSECODE ] , {
 "Hangup cause" , "iax2.iax.causecode" , FT_UINT8 , BASE_HEX | BASE_EXT_STRING , & iax_causecodes_ext , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_ENCRYPTION ] , {
 "Encryption format" , "iax2.iax.encryption" , FT_UINT16 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_ENCKEY ] , {
 "Encryption key" , "iax2.iax.enckey" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_CODEC_PREFS ] , {
 "Codec negotiation" , "iax2.iax.codecprefs" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_RR_JITTER ] , {
 "Received jitter (as in RFC1889)" , "iax2.iax.rrjitter" , FT_UINT32 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_RR_LOSS ] , {
 "Received loss (high byte loss pct, low 24 bits loss count, as in rfc1889)" , "iax2.iax.rrloss" , FT_UINT32 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_RR_PKTS ] , {
 "Total frames received" , "iax2.iax.rrpkts" , FT_UINT32 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_RR_DELAY ] , {
 "Max playout delay in ms for received frames" , "iax2.iax.rrdelay" , FT_UINT16 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_RR_DROPPED ] , {
 "Dropped frames (presumably by jitterbuffer)" , "iax2.iax.rrdropped" , FT_UINT32 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_RR_OOO ] , {
 "Frame received out of order" , "iax2.iax.rrooo" , FT_UINT32 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_ies [ IAX_IE_DATAFORMAT ] , {
 "Data call format" , "iax2.iax.dataformat" , FT_UINT32 , BASE_HEX , VALS ( iax_dataformats ) , 0x0 , NULL , HFILL }
 }
 , {
 & hf_IAX_IE_UNKNOWN_BYTE , {
 "Unknown" , "iax2.iax.unknownbyte" , FT_UINT8 , BASE_HEX , NULL , 0x0 , "Raw data for unknown IEs" , HFILL }
 }
 , {
 & hf_IAX_IE_UNKNOWN_I16 , {
 "Unknown" , "iax2.iax.unknownshort" , FT_UINT16 , BASE_HEX , NULL , 0x0 , "Raw data for unknown IEs" , HFILL }
 }
 , {
 & hf_IAX_IE_UNKNOWN_I32 , {
 "Unknown" , "iax2.iax.unknownlong" , FT_UINT32 , BASE_HEX , NULL , 0x0 , "Raw data for unknown IEs" , HFILL }
 }
 , {
 & hf_IAX_IE_UNKNOWN_BYTES , {
 "Unknown" , "iax2.iax.unknownstring" , FT_STRING , BASE_NONE , NULL , 0x0 , "Raw data for unknown IEs" , HFILL }
 }
 , {
 & hf_iax2_ie_id , {
 "IE id" , "iax2.ie_id" , FT_UINT8 , BASE_DEC | BASE_EXT_STRING , & iax_ies_type_ext , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_length , {
 "Length" , "iax2.length" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_g723_1 , {
 "G.723.1 compression" , "iax2.cap.g723_1" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_G723_1 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_gsm , {
 "GSM compression" , "iax2.cap.gsm" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_GSM , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_ulaw , {
 "Raw mu-law data (G.711)" , "iax2.cap.ulaw" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_ULAW , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_alaw , {
 "Raw A-law data (G.711)" , "iax2.cap.alaw" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_ALAW , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_g726_aal2 , {
 "G.726 compression (AAL2 packing)" , "iax2.cap.g726_aal2" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_G726_AAL2 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_adpcm , {
 "ADPCM" , "iax2.cap.adpcm" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_ADPCM , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_slinear , {
 "Raw 16-bit Signed Linear (8000 Hz) PCM" , "iax2.cap.slinear" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_SLINEAR , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_lpc10 , {
 "LPC10, 180 samples/frame" , "iax2.cap.lpc10" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_LPC10 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_g729a , {
 "G.729a Audio" , "iax2.cap.g729a" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_G729A , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_speex , {
 "SPEEX Audio" , "iax2.cap.speex" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_SPEEX , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_ilbc , {
 "iLBC Free compressed Audio" , "iax2.cap.ilbc" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_ILBC , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_g726 , {
 "ADPCM (G.726, 32kbps, RFC3551 codeword packing)" , "iax2.cap.g726" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_G726 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_g722 , {
 "G.722 wideband audio" , "iax2.cap.g722" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_G722 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_siren7 , {
 "G.722.1 (also known as Siren7, 32kbps assumed)" , "iax2.cap.siren7" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_SIREN7 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_siren14 , {
 "G.722.1 Annex C (also known as Siren14, 48kbps assumed)" , "iax2.cap.siren14" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_SIREN14 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_slinear16 , {
 "Raw 16-bit Signed Linear (16000 Hz) PCM" , "iax2.cap.slinear16" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_SLINEAR16 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_jpeg , {
 "JPEG images" , "iax2.cap.jpeg" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_JPEG , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_png , {
 "PNG images" , "iax2.cap.png" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_PNG , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_h261 , {
 "H.261 video" , "iax2.cap.h261" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_H261 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_h263 , {
 "H.263 video" , "iax2.cap.h263" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_H263 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_h263_plus , {
 "H.263+ video" , "iax2.cap.h263_plus" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_H263_PLUS , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_h264 , {
 "H.264 video" , "iax2.cap.h264" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_H264 , NULL , HFILL }
 }
 , {
 & hf_iax2_cap_mpeg4 , {
 "MPEG4 video" , "iax2.cap.mpeg4" , FT_BOOLEAN , 32 , TFS ( & tfs_supported_not_supported ) , AST_FORMAT_MP4_VIDEO , NULL , HFILL }
 }
 , {
 & hf_iax2_fragment_unfinished , {
 "IAX2 fragment, unfinished" , "iax2.fragment_unfinished" , FT_BYTES , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_payload_data , {
 "IAX2 payload" , "iax2.payload_data" , FT_BYTES , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_fragments , {
 "IAX2 Fragments" , "iax2.fragments" , FT_NONE , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_fragment , {
 "IAX2 Fragment data" , "iax2.fragment" , FT_FRAMENUM , BASE_NONE , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_fragment_overlap , {
 "Fragment overlap" , "iax2.fragment.overlap" , FT_BOOLEAN , BASE_NONE , NULL , 0x0 , "Fragment overlaps with other fragments" , HFILL }
 }
 , {
 & hf_iax2_fragment_overlap_conflict , {
 "Conflicting data in fragment overlap" , "iax2.fragment.overlap.conflict" , FT_BOOLEAN , BASE_NONE , NULL , 0x0 , "Overlapping fragments contained conflicting data" , HFILL }
 }
 , {
 & hf_iax2_fragment_multiple_tails , {
 "Multiple tail fragments found" , "iax2.fragment.multipletails" , FT_BOOLEAN , BASE_NONE , NULL , 0x0 , "Several tails were found when defragmenting the packet" , HFILL }
 }
 , {
 & hf_iax2_fragment_too_long_fragment , {
 "Fragment too long" , "iax2.fragment.toolongfragment" , FT_BOOLEAN , BASE_NONE , NULL , 0x0 , "Fragment contained data past end of packet" , HFILL }
 }
 , {
 & hf_iax2_fragment_error , {
 "Defragmentation error" , "iax2.fragment.error" , FT_FRAMENUM , BASE_NONE , NULL , 0x0 , "Defragmentation error due to illegal fragments" , HFILL }
 }
 , {
 & hf_iax2_fragment_count , {
 "Fragment count" , "iax2.fragment.count" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
 }
 , {
 & hf_iax2_reassembled_in , {
 "IAX2 fragment, reassembled in frame" , "iax2.reassembled_in" , FT_FRAMENUM , BASE_NONE , NULL , 0x0 , "This IAX2 packet is reassembled in this frame" , HFILL }
 }
 , {
 & hf_iax2_reassembled_length , {
 "Reassembled IAX2 length" , "iax2.reassembled.length" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "The total length of the reassembled payload" , HFILL }
 }
 }
 ;
 static gint * ett [ ] = {
 & ett_iax2 , & ett_iax2_full_mini_subtree , & ett_iax2_type , & ett_iax2_ie , & ett_iax2_codecs , & ett_iax2_ies_apparent_addr , & ett_iax2_fragment , & ett_iax2_fragments , & ett_iax2_trunk_cmddata , & ett_iax2_trunk_call }
 ;
 static ei_register_info ei [ ] = {
 {
 & ei_iax_too_many_transfers , {
 "iax2.too_many_transfers" , PI_PROTOCOL , PI_WARN , "Too many transfers for iax_call" , EXPFILL }
 }
 , {
 & ei_iax_circuit_id_conflict , {
 "iax2.circuit_id_conflict" , PI_PROTOCOL , PI_WARN , "Circuit ID conflict" , EXPFILL }
 }
 , {
 & ei_iax_peer_address_unsupported , {
 "iax2.peer_address_unsupported" , PI_PROTOCOL , PI_WARN , "Peer address unsupported" , EXPFILL }
 }
 , {
 & ei_iax_invalid_len , {
 "iax2.invalid_len" , PI_PROTOCOL , PI_WARN , "Invalid length" , EXPFILL }
 }
 }
 ;
 expert_module_t * expert_iax ;
 memset ( hf_iax2_ies , 0xff , sizeof ( hf_iax2_ies ) ) ;
 proto_iax2 = proto_register_protocol ( "Inter-Asterisk eXchange v2" , "IAX2" , "iax2" ) ;
 proto_register_field_array ( proto_iax2 , hf , array_length ( hf ) ) ;
 proto_register_subtree_array ( ett , array_length ( ett ) ) ;
 expert_iax = expert_register_protocol ( proto_iax2 ) ;
 expert_register_field_array ( expert_iax , ei , array_length ( ei ) ) ;
 register_dissector ( "iax2" , dissect_iax2 , proto_iax2 ) ;
 iax2_codec_dissector_table = register_dissector_table ( "iax2.codec" , "IAX codec number" , FT_UINT32 , BASE_HEX ) ;
 iax2_dataformat_dissector_table = register_dissector_table ( "iax2.dataformat" , "IAX dataformat number" , FT_UINT32 , BASE_HEX ) ;
 register_init_routine ( & iax_init_protocol ) ;
 register_cleanup_routine ( & iax_cleanup_protocol ) ;
 iax2_tap = register_tap ( "IAX2" ) ;
 }


static u32 icount(u32 v)
{
	u32 ret = 0;
	while (v) {
		ret += v & 1;
		v >>= 1;
	}
	return(ret);
}


void ShellWindow::AddMessageToDevToolsConsole(ConsoleMessageLevel level,
                                              const std::string& message) {
  content::RenderViewHost* rvh = web_contents_->GetRenderViewHost();
  rvh->Send(new ExtensionMsg_AddMessageToConsole(
      rvh->GetRoutingID(), level, message));
}


parse_rockridge_NM1(struct file_info *file,
		    const unsigned char *data, int data_length)
{
	if (!file->name_continues)
		archive_string_empty(&file->name);
	file->name_continues = 0;
	if (data_length < 1)
		return;
	/*
	 * NM version 1 extension comprises:
	 *   1 byte flag, value is one of:
	 *     = 0: remainder is name
	 *     = 1: remainder is name, next NM entry continues name
	 *     = 2: "."
	 *     = 4: ".."
	 *     = 32: Implementation specific
	 *     All other values are reserved.
	 */
	switch(data[0]) {
	case 0:
		if (data_length < 2)
			return;
		archive_strncat(&file->name,
		    (const char *)data + 1, data_length - 1);
		break;
	case 1:
		if (data_length < 2)
			return;
		archive_strncat(&file->name,
		    (const char *)data + 1, data_length - 1);
		file->name_continues = 1;
		break;
	case 2:
		archive_strcat(&file->name, ".");
		break;
	case 4:
		archive_strcat(&file->name, "..");
		break;
	default:
		return;
	}

}


int vnc_hextile_send_framebuffer_update(VncState *vs, int x,
                                        int y, int w, int h)
{
     int i, j;
     int has_fg, has_bg;
     uint8_t *last_fg, *last_bg;
    VncDisplay *vd = vs->vd;

    last_fg = (uint8_t *) g_malloc(vd->server->pf.bytes_per_pixel);
    last_bg = (uint8_t *) g_malloc(vd->server->pf.bytes_per_pixel);
     has_fg = has_bg = 0;
     for (j = y; j < (y + h); j += 16) {
         for (i = x; i < (x + w); i += 16) {
        for (i = x; i < (x + w); i += 16) {
            vs->hextile.send_tile(vs, i, j,
                                  MIN(16, x + w - i), MIN(16, y + h - j),
                                  last_bg, last_fg, &has_bg, &has_fg);
        }
    }
    g_free(last_fg);
    g_free(last_bg);

    return 1;
}
 void vnc_hextile_set_pixel_conversion(VncState *vs, int generic)
 {
     if (!generic) {
        switch (vs->ds->surface->pf.bits_per_pixel) {
            case 8:
                vs->hextile.send_tile = send_hextile_tile_8;
                break;
            case 16:
                vs->hextile.send_tile = send_hextile_tile_16;
                break;
            case 32:
                vs->hextile.send_tile = send_hextile_tile_32;
                break;
         }
     } else {
        switch (vs->ds->surface->pf.bits_per_pixel) {
            case 8:
                vs->hextile.send_tile = send_hextile_tile_generic_8;
                break;
            case 16:
                vs->hextile.send_tile = send_hextile_tile_generic_16;
                break;
            case 32:
                vs->hextile.send_tile = send_hextile_tile_generic_32;
                break;
         }
     }
 }
}


static char *lxc_attach_getpwshell(uid_t uid)
{
	/* local variables */
	pid_t pid;
	int pipes[2];
	int ret;
	int fd;
	char *result = NULL;

	/* we need to fork off a process that runs the
	 * getent program, and we need to capture its
	 * output, so we use a pipe for that purpose
	 */
	ret = pipe(pipes);
	if (ret < 0)
		return NULL;

	pid = fork();
	if (pid < 0) {
		close(pipes[0]);
		close(pipes[1]);
		return NULL;
	}

	if (pid) {
		/* parent process */
		FILE *pipe_f;
		char *line = NULL;
		size_t line_bufsz = 0;
		int found = 0;
		int status;

		close(pipes[1]);

		pipe_f = fdopen(pipes[0], "r");
		while (getline(&line, &line_bufsz, pipe_f) != -1) {
			char *token;
			char *saveptr = NULL;
			long value;
			char *endptr = NULL;
			int i;

			/* if we already found something, just continue
			 * to read until the pipe doesn't deliver any more
			 * data, but don't modify the existing data
			 * structure
			 */
			if (found)
				continue;

			/* trim line on the right hand side */
			for (i = strlen(line); i > 0 && (line[i - 1] == '\n' || line[i - 1] == '\r'); --i)
				line[i - 1] = '\0';

			/* split into tokens: first user name */
			token = strtok_r(line, ":", &saveptr);
			if (!token)
				continue;
			/* next: dummy password field */
			token = strtok_r(NULL, ":", &saveptr);
			if (!token)
				continue;
			/* next: user id */
			token = strtok_r(NULL, ":", &saveptr);
			value = token ? strtol(token, &endptr, 10) : 0;
			if (!token || !endptr || *endptr || value == LONG_MIN || value == LONG_MAX)
				continue;
			/* dummy sanity check: user id matches */
			if ((uid_t) value != uid)
				continue;
			/* skip fields: gid, gecos, dir, go to next field 'shell' */
			for (i = 0; i < 4; i++) {
				token = strtok_r(NULL, ":", &saveptr);
				if (!token)
					break;
			}
			if (!token)
				continue;
			free(result);
			result = strdup(token);

			/* sanity check that there are no fields after that */
			token = strtok_r(NULL, ":", &saveptr);
			if (token)
				continue;

			found = 1;
		}

		free(line);
		fclose(pipe_f);
	again:
		if (waitpid(pid, &status, 0) < 0) {
			if (errno == EINTR)
				goto again;
			return NULL;
		}

		/* some sanity checks: if anything even hinted at going
		 * wrong: we can't be sure we have a valid result, so
		 * we assume we don't
		 */

		if (!WIFEXITED(status))
			return NULL;

		if (WEXITSTATUS(status) != 0)
			return NULL;

		if (!found)
			return NULL;

		return result;
	} else {
		/* child process */
		char uid_buf[32];
		char *arguments[] = {
			"getent",
			"passwd",
			uid_buf,
			NULL
		};

		close(pipes[0]);

		/* we want to capture stdout */
		dup2(pipes[1], 1);
		close(pipes[1]);

		/* get rid of stdin/stderr, so we try to associate it
		 * with /dev/null
		 */
		fd = open("/dev/null", O_RDWR);
		if (fd < 0) {
			close(0);
			close(2);
		} else {
			dup2(fd, 0);
			dup2(fd, 2);
			close(fd);
		}

		/* finish argument list */
		ret = snprintf(uid_buf, sizeof(uid_buf), "%ld", (long) uid);
		if (ret <= 0)
			exit(-1);

		/* try to run getent program */
		(void) execvp("getent", arguments);
		exit(-1);
	}
}


ksba_ocsp_hash_request (ksba_ocsp_t ocsp,
                        void (*hasher)(void *, const void *,
                                       size_t length),
                        void *hasher_arg)
{
  (void)ocsp;
  (void)hasher;
  (void)hasher_arg;
  return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}


svcauth_gss_destroy(SVCAUTH *auth)
{
	struct svc_rpc_gss_data	*gd;
	OM_uint32		 min_stat;

	log_debug("in svcauth_gss_destroy()");

	gd = SVCAUTH_PRIVATE(auth);

	gss_delete_sec_context(&min_stat, &gd->ctx, GSS_C_NO_BUFFER);
	gss_release_buffer(&min_stat, &gd->cname);
	gss_release_buffer(&min_stat, &gd->checksum);

	if (gd->client_name)
		gss_release_name(&min_stat, &gd->client_name);

	mem_free(gd, sizeof(*gd));
	mem_free(auth, sizeof(*auth));

	return (TRUE);
}


static int lua_map_handler_fixups(request_rec *r)
{
    /* If there is no handler set yet, this might be a LuaMapHandler request */
    if (r->handler == NULL) {
        int n = 0;
        ap_regmatch_t match[10];
        const ap_lua_dir_cfg *cfg = ap_get_module_config(r->per_dir_config,
                                                     &lua_module);
        for (n = 0; n < cfg->mapped_handlers->nelts; n++) {
            ap_lua_mapped_handler_spec *hook_spec =
            ((ap_lua_mapped_handler_spec **) cfg->mapped_handlers->elts)[n];

            if (hook_spec == NULL) {
                continue;
            }
            if (!ap_regexec(hook_spec->uri_pattern, r->uri, 10, match, 0)) {
                r->handler = apr_pstrdup(r->pool, "lua-map-handler");
                return OK;
            }
        }
    }
    return DECLINED;
}


vmxnet3_io_bar0_write(void *opaque, hwaddr addr,
                      uint64_t val, unsigned size)
{
    VMXNET3State *s = opaque;

    if (!s->device_active) {
        return;
    }

    if (VMW_IS_MULTIREG_ADDR(addr, VMXNET3_REG_TXPROD,
                        VMXNET3_DEVICE_MAX_TX_QUEUES, VMXNET3_REG_ALIGN)) {
        int tx_queue_idx =
            VMW_MULTIREG_IDX_BY_ADDR(addr, VMXNET3_REG_TXPROD,
                                     VMXNET3_REG_ALIGN);
        assert(tx_queue_idx <= s->txq_num);
        vmxnet3_process_tx_queue(s, tx_queue_idx);
        return;
    }

    if (VMW_IS_MULTIREG_ADDR(addr, VMXNET3_REG_IMR,
                        VMXNET3_MAX_INTRS, VMXNET3_REG_ALIGN)) {
        int l = VMW_MULTIREG_IDX_BY_ADDR(addr, VMXNET3_REG_IMR,
                                         VMXNET3_REG_ALIGN);

        VMW_CBPRN("Interrupt mask for line %d written: 0x%" PRIx64, l, val);

        vmxnet3_on_interrupt_mask_changed(s, l, val);
        return;
    }

    if (VMW_IS_MULTIREG_ADDR(addr, VMXNET3_REG_RXPROD,
                        VMXNET3_DEVICE_MAX_RX_QUEUES, VMXNET3_REG_ALIGN) ||
       VMW_IS_MULTIREG_ADDR(addr, VMXNET3_REG_RXPROD2,
                        VMXNET3_DEVICE_MAX_RX_QUEUES, VMXNET3_REG_ALIGN)) {
        return;
    }

    VMW_WRPRN("BAR0 unknown write [%" PRIx64 "] = %" PRIx64 ", size %d",
              (uint64_t) addr, val, size);
}


bool RenderProcessHostImpl::IsSuitableHost(RenderProcessHost* host,
                                           BrowserContext* browser_context,
                                           const GURL& site_url) {
  if (run_renderer_in_process()) {
    DCHECK_EQ(host->GetBrowserContext(), browser_context)
        << " Single-process mode does not support multiple browser contexts.";
    return true;
  }

  if (host->GetBrowserContext() != browser_context)
    return false;

  if (host->IsForGuestsOnly())
    return false;

  StoragePartition* dest_partition =
      BrowserContext::GetStoragePartitionForSite(browser_context, site_url);
  if (!host->InSameStoragePartition(dest_partition))
    return false;

  auto* policy = ChildProcessSecurityPolicyImpl::GetInstance();
  if (policy->HasWebUIBindings(host->GetID()) !=
      WebUIControllerFactoryRegistry::GetInstance()->UseWebUIBindingsForURL(
          browser_context, site_url)) {
    return false;
  }

  auto lock_state = policy->CheckOriginLock(host->GetID(), site_url);
  if (lock_state !=
      ChildProcessSecurityPolicyImpl::CheckOriginLockResult::NO_LOCK) {
    if (lock_state !=
        ChildProcessSecurityPolicyImpl::CheckOriginLockResult::HAS_EQUAL_LOCK)
      return false;
  } else if (!host->IsUnused() && SiteInstanceImpl::ShouldLockToOrigin(
                                      browser_context, host, site_url)) {
    return false;
  }

  return GetContentClient()->browser()->IsSuitableHost(host, site_url);
}


MetricsWebContentsObserver::MetricsWebContentsObserver(
    content::WebContents* web_contents,
    std::unique_ptr<PageLoadMetricsEmbedderInterface> embedder_interface)
    : content::WebContentsObserver(web_contents),
      in_foreground_(web_contents->GetVisibility() !=
                     content::Visibility::HIDDEN),
      embedder_interface_(std::move(embedder_interface)),
      has_navigated_(false),
      page_load_metrics_binding_(web_contents, this) {
  const bool is_prerender =
      prerender::PrerenderContents::FromWebContents(web_contents) != nullptr;
  if (is_prerender)
    in_foreground_ = false;

  RegisterInputEventObserver(web_contents->GetRenderViewHost());
}


  WebGraphicsContext3DCommandBufferImpl* CreateContextCommon(
      const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client,
      int surface_id) {
    WebKit::WebGraphicsContext3D::Attributes attrs;
    attrs.shareResources = true;
    attrs.depth = false;
    attrs.stencil = false;
    attrs.antialias = false;
    attrs.noAutomaticFlushes = true;
    GpuChannelHostFactory* factory = BrowserGpuChannelHostFactory::instance();
    GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon");
    scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
        new WebGraphicsContext3DCommandBufferImpl(
            surface_id,
            url,
            factory,
            swap_client));
    if (!context->Initialize(
        attrs,
        false,
        CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE))
      return NULL;
    return context.release();
  }


gst_asf_demux_loop (GstASFDemux * demux)
{
  GstFlowReturn flow = GST_FLOW_OK;
  GstBuffer *buf = NULL;
  guint64 off;

  if (G_UNLIKELY (demux->state == GST_ASF_DEMUX_STATE_HEADER)) {
    if (!gst_asf_demux_pull_headers (demux, &flow)) {
      goto pause;
    }

    flow = gst_asf_demux_pull_indices (demux);
    if (flow != GST_FLOW_OK)
      goto pause;
  }

  g_assert (demux->state == GST_ASF_DEMUX_STATE_DATA);

  if (G_UNLIKELY (demux->num_packets != 0
          && demux->packet >= demux->num_packets))
    goto eos;

  GST_LOG_OBJECT (demux, "packet %u/%u", (guint) demux->packet + 1,
      (guint) demux->num_packets);

  off = demux->data_offset + (demux->packet * demux->packet_size);

  if (G_UNLIKELY (!gst_asf_demux_pull_data (demux, off,
              demux->packet_size * demux->speed_packets, &buf, &flow))) {
    GST_DEBUG_OBJECT (demux, "got flow %s", gst_flow_get_name (flow));
    if (flow == GST_FLOW_EOS) {
      goto eos;
    } else if (flow == GST_FLOW_FLUSHING) {
      GST_DEBUG_OBJECT (demux, "Not fatal");
      goto pause;
    } else {
      goto read_failed;
    }
  }

  if (G_LIKELY (demux->speed_packets == 1)) {
    GstAsfDemuxParsePacketError err;
    err = gst_asf_demux_parse_packet (demux, buf);
    if (G_UNLIKELY (err != GST_ASF_DEMUX_PARSE_PACKET_ERROR_NONE)) {
      /* when we don't know when the data object ends, we should check
       * for a chained asf */
      if (demux->num_packets == 0) {
        if (gst_asf_demux_check_buffer_is_header (demux, buf)) {
          GST_INFO_OBJECT (demux, "Chained asf found");
          demux->base_offset = off;
          gst_asf_demux_reset (demux, TRUE);
          gst_buffer_unref (buf);
          return;
        }
      }
      /* FIXME: We should tally up fatal errors and error out only
       * after a few broken packets in a row? */

      GST_INFO_OBJECT (demux, "Ignoring recoverable parse error");
      gst_buffer_unref (buf);

      if (GST_ASF_DEMUX_IS_REVERSE_PLAYBACK (demux->segment)
          && !demux->seek_to_cur_pos) {
        --demux->packet;
        if (demux->packet < 0) {
          goto eos;
        }
      } else {
        ++demux->packet;
      }

      return;
    }

    flow = gst_asf_demux_push_complete_payloads (demux, FALSE);

    if (GST_ASF_DEMUX_IS_REVERSE_PLAYBACK (demux->segment)
        && !demux->seek_to_cur_pos) {
      --demux->packet;
      if (demux->packet < 0) {
        goto eos;
      }
    } else {
      ++demux->packet;
    }

  } else {
    guint n;
    for (n = 0; n < demux->speed_packets; n++) {
      GstBuffer *sub;
      GstAsfDemuxParsePacketError err;

      sub =
          gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL,
          n * demux->packet_size, demux->packet_size);
      err = gst_asf_demux_parse_packet (demux, sub);
      if (G_UNLIKELY (err != GST_ASF_DEMUX_PARSE_PACKET_ERROR_NONE)) {
        /* when we don't know when the data object ends, we should check
         * for a chained asf */
        if (demux->num_packets == 0) {
          if (gst_asf_demux_check_buffer_is_header (demux, sub)) {
            GST_INFO_OBJECT (demux, "Chained asf found");
            demux->base_offset = off + n * demux->packet_size;
            gst_asf_demux_reset (demux, TRUE);
            gst_buffer_unref (sub);
            gst_buffer_unref (buf);
            return;
          }
        }
        /* FIXME: We should tally up fatal errors and error out only
         * after a few broken packets in a row? */

        GST_INFO_OBJECT (demux, "Ignoring recoverable parse error");
        flow = GST_FLOW_OK;
      }

      gst_buffer_unref (sub);

      if (err == GST_ASF_DEMUX_PARSE_PACKET_ERROR_NONE)
        flow = gst_asf_demux_push_complete_payloads (demux, FALSE);

      ++demux->packet;

    }

    /* reset speed pull */
    demux->speed_packets = 1;
  }

  gst_buffer_unref (buf);

  if (G_UNLIKELY ((demux->num_packets > 0
              && demux->packet >= demux->num_packets)
          || flow == GST_FLOW_EOS)) {
    GST_LOG_OBJECT (demux, "reached EOS");
    goto eos;
  }

  if (G_UNLIKELY (flow != GST_FLOW_OK)) {
    GST_DEBUG_OBJECT (demux, "pushing complete payloads failed");
    goto pause;
  }

  /* check if we're at the end of the configured segment */
  /* FIXME: check if segment end reached etc. */

  return;

eos:
  {
    /* if we haven't activated our streams yet, this might be because we have
     * less data queued than required for preroll; force stream activation and
     * send any pending payloads before sending EOS */
    if (!demux->activated_streams)
      flow = gst_asf_demux_push_complete_payloads (demux, TRUE);

    /* we want to push an eos or post a segment-done in any case */
    if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) {
      gint64 stop;

      /* for segment playback we need to post when (in stream time)
       * we stopped, this is either stop (when set) or the duration. */
      if ((stop = demux->segment.stop) == -1)
        stop = demux->segment.duration;

      GST_INFO_OBJECT (demux, "Posting segment-done, at end of segment");
      gst_element_post_message (GST_ELEMENT_CAST (demux),
          gst_message_new_segment_done (GST_OBJECT (demux), GST_FORMAT_TIME,
              stop));
      gst_asf_demux_send_event_unlocked (demux,
          gst_event_new_segment_done (GST_FORMAT_TIME, stop));
    } else if (flow != GST_FLOW_EOS) {
      /* check if we have a chained asf, in case, we don't eos yet */
      if (gst_asf_demux_check_chained_asf (demux)) {
        GST_INFO_OBJECT (demux, "Chained ASF starting");
        gst_asf_demux_reset (demux, TRUE);
        return;
      }
    }

    if (!(demux->segment.flags & GST_SEEK_FLAG_SEGMENT)) {
      if (demux->activated_streams) {
        /* normal playback, send EOS to all linked pads */
        GST_INFO_OBJECT (demux, "Sending EOS, at end of stream");
        gst_asf_demux_send_event_unlocked (demux, gst_event_new_eos ());
      } else {
        GST_WARNING_OBJECT (demux, "EOS without exposed streams");
        flow = GST_FLOW_EOS;
      }
    }
    /* ... and fall through to pause */
  }
pause:
  {
    GST_DEBUG_OBJECT (demux, "pausing task, flow return: %s",
        gst_flow_get_name (flow));
    demux->segment_running = FALSE;
    gst_pad_pause_task (demux->sinkpad);

    /* For the error cases */
    if (flow == GST_FLOW_EOS && !demux->activated_streams) {
      GST_ELEMENT_ERROR (demux, STREAM, WRONG_TYPE, (NULL),
          ("This doesn't seem to be an ASF file"));
    } else if (flow < GST_FLOW_EOS || flow == GST_FLOW_NOT_LINKED) {
      /* Post an error. Hopefully something else already has, but if not... */
      GST_ELEMENT_FLOW_ERROR (demux, flow);
      gst_asf_demux_send_event_unlocked (demux, gst_event_new_eos ());
    }

    return;
  }

/* ERRORS */
read_failed:
  {
    GST_DEBUG_OBJECT (demux, "Read failed, doh");
    flow = GST_FLOW_EOS;
    goto pause;
  }
#if 0
  /* See FIXMEs above */
parse_error:
  {
    gst_buffer_unref (buf);
    GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL),
        ("Error parsing ASF packet %u", (guint) demux->packet));
    gst_asf_demux_send_event_unlocked (demux, gst_event_new_eos ());
    flow = GST_FLOW_ERROR;
    goto pause;
  }
#endif
}


static u8 i40e_dcb_get_enabled_tc(struct i40e_dcbx_config *dcbcfg)
{
	u8 num_tc = i40e_dcb_get_num_tc(dcbcfg);
	u8 enabled_tc = 1;
	u8 i;

	for (i = 0; i < num_tc; i++)
		enabled_tc |= BIT(i);

	return enabled_tc;
}


void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev,
			   struct net_device *netdev, const u8 *buf,
			   size_t len, gfp_t gfp)
{
	nl80211_send_mlme_event(rdev, netdev, buf, len,
				NL80211_CMD_ASSOCIATE, gfp);


static int set_dev_space(i_ctx_t * i_ctx_p, int components)
{
    int code, stage = 1, cont = 0;
    switch(components) {
        case 1:
            code = setgrayspace(i_ctx_p, (ref *)0, &stage, &cont, 1);
            break;
        case 3:
            code = setrgbspace(i_ctx_p, (ref *)0, &stage, &cont, 1);
            break;
        case 4:
            code = setcmykspace(i_ctx_p, (ref *)0, &stage, &cont, 1);
            break;
        default:
            code = gs_note_error(gs_error_rangecheck);
            break;
    }
    return code;
}


static gboolean lacks_deep_count ( NautilusFile * file ) {
 return file -> details -> deep_counts_status != NAUTILUS_REQUEST_DONE ;
 }


static coolkey_private_data_t *coolkey_new_private_data(void)
{
	coolkey_private_data_t *priv;
	/* allocate priv and zero all the fields */
	priv = calloc(1, sizeof(coolkey_private_data_t));
	if (!priv)
		return NULL;
	/* set other fields as appropriate */
	priv->key_id = COOLKEY_INVALID_KEY;
	list_init(&priv->objects_list);
	list_attributes_comparator(&priv->objects_list, coolkey_compare_id);
	list_attributes_copy(&priv->objects_list, coolkey_list_meter, 1);

	return priv;
}


static void cookedprint ( int datatype , int length , const char * data , int status , int quiet , FILE * fp ) {
 char * name ;
 char * value ;
 char output_raw ;
 int fmt ;
 l_fp lfp ;
 sockaddr_u hval ;
 u_long uval ;
 int narr ;
 size_t len ;
 l_fp lfparr [ 8 ] ;
 char b [ 12 ] ;
 char bn [ 2 * MAXVARLEN ] ;
 char bv [ 2 * MAXVALLEN ] ;
 UNUSED_ARG ( datatype ) ;
 if ( ! quiet ) fprintf ( fp , "status=%04x %s,\n" , status , statustoa ( datatype , status ) ) ;
 startoutput ( ) ;
 while ( nextvar ( & length , & data , & name , & value ) ) {
 fmt = varfmt ( name ) ;
 output_raw = 0 ;
 switch ( fmt ) {
 case PADDING : output_raw = '*' ;
 break ;
 case TS : if ( ! decodets ( value , & lfp ) ) output_raw = '?' ;
 else output ( fp , name , prettydate ( & lfp ) ) ;
 break ;
 case HA : case NA : if ( ! decodenetnum ( value , & hval ) ) {
 output_raw = '?' ;
 }
 else if ( fmt == HA ) {
 output ( fp , name , nntohost ( & hval ) ) ;
 }
 else {
 output ( fp , name , stoa ( & hval ) ) ;
 }
 break ;
 case RF : if ( decodenetnum ( value , & hval ) ) {
 if ( ISREFCLOCKADR ( & hval ) ) output ( fp , name , refnumtoa ( & hval ) ) ;
 else output ( fp , name , stoa ( & hval ) ) ;
 }
 else if ( strlen ( value ) <= 4 ) {
 output ( fp , name , value ) ;
 }
 else {
 output_raw = '?' ;
 }
 break ;
 case LP : if ( ! decodeuint ( value , & uval ) || uval > 3 ) {
 output_raw = '?' ;
 }
 else {
 b [ 0 ] = ( 0x2 & uval ) ? '1' : '0' ;
 b [ 1 ] = ( 0x1 & uval ) ? '1' : '0' ;
 b [ 2 ] = '\0' ;
 output ( fp , name , b ) ;
 }
 break ;
 case OC : if ( ! decodeuint ( value , & uval ) ) {
 output_raw = '?' ;
 }
 else {
 snprintf ( b , sizeof ( b ) , "%03lo" , uval ) ;
 output ( fp , name , b ) ;
 }
 break ;
 case AR : if ( ! decodearr ( value , & narr , lfparr ) ) output_raw = '?' ;
 else outputarr ( fp , name , narr , lfparr ) ;
 break ;
 case FX : if ( ! decodeuint ( value , & uval ) ) output_raw = '?' ;
 else output ( fp , name , tstflags ( uval ) ) ;
 break ;
 default : fprintf ( stderr , "Internal error in cookedprint, %s=%s, fmt %d\n" , name , value , fmt ) ;
 output_raw = '?' ;
 break ;
 }
 if ( output_raw != 0 ) {
 atoascii ( name , MAXVARLEN , bn , sizeof ( bn ) ) ;
 if ( output_raw != '*' ) {
 atoascii ( value , MAXVALLEN , bv , sizeof ( bv ) - 1 ) ;
 len = strlen ( bv ) ;
 bv [ len ] = output_raw ;
 bv [ len + 1 ] = '\0' ;
 }
 else {
 atoascii ( value , MAXVALLEN , bv , sizeof ( bv ) ) ;
 }
 output ( fp , bn , bv ) ;
 }
 }
 endoutput ( fp ) ;
 }


static void io_req_task_queue_fail(struct io_kiocb *req, int ret)
{
	req->result = ret;
	req->io_task_work.func = io_req_task_cancel;
	io_req_task_work_add(req, false);
}


static void find_equal_scalars(struct bpf_verifier_state *vstate,
			       struct bpf_reg_state *known_reg)
{
	struct bpf_func_state *state;
	struct bpf_reg_state *reg;
	int i, j;

	for (i = 0; i <= vstate->curframe; i++) {
		state = vstate->frame[i];
		for (j = 0; j < MAX_BPF_REG; j++) {
			reg = &state->regs[j];
			if (reg->type == SCALAR_VALUE && reg->id == known_reg->id)
				*reg = *known_reg;
		}

		bpf_for_each_spilled_reg(j, state, reg) {
			if (!reg)
				continue;
			if (reg->type == SCALAR_VALUE && reg->id == known_reg->id)
				*reg = *known_reg;
		}
	}
}


bool ContentSettingsObserver::IsWhitelistedForContentSettings(
    const WebSecurityOrigin& origin,
    const GURL& document_url) {
  if (document_url == GURL(content::kUnreachableWebDataURL))
    return true;

  if (origin.IsUnique())
    return false;  // Uninitialized document?

  base::string16 protocol = origin.Protocol().Utf16();
  if (base::EqualsASCII(protocol, content::kChromeUIScheme))
    return true;  // Browser UI elements should still work.

  if (base::EqualsASCII(protocol, content::kChromeDevToolsScheme))
    return true;  // DevTools UI elements should still work.

#if BUILDFLAG(ENABLE_EXTENSIONS)
  if (base::EqualsASCII(protocol, extensions::kExtensionScheme))
    return true;
#endif

  // If the scheme is file:, an empty file name indicates a directory listing,
  // which requires JavaScript to function properly.
  if (base::EqualsASCII(protocol, url::kFileScheme)) {
    return document_url.SchemeIs(url::kFileScheme) &&
           document_url.ExtractFileName().empty();
  }

  return false;
}


char getchar_buffer ( char * * buf ) {
 char ret ;
 DEBUG_MSG ( "getchar_buffer: %s" , * buf ) ;
 if ( * * buf == 0 ) return 0 ;
 if ( * ( * buf + 0 ) == 's' && * ( * buf + 1 ) == '(' ) {
 char * p ;
 int time = 0 ;
 p = strchr ( * buf , ')' ) ;
 if ( p != NULL ) {
 * p = '\0' ;
 time = atoi ( * buf + 2 ) ;
 DEBUG_MSG ( "getchar_buffer: sleeping %d secs" , time ) ;
 * buf = p + 1 ;
 ec_usleep ( SEC2MICRO ( time ) ) ;
 }
 }
 ret = * buf [ 0 ] ;
 * buf = * buf + 1 ;
 DEBUG_MSG ( "getchar_buffer: returning %c" , ret ) ;
 return ret ;
 }


status_t CameraSource::startCameraRecording() {
    ALOGV("startCameraRecording");
 int64_t token = IPCThreadState::self()->clearCallingIdentity();
 status_t err;
 if (mNumInputBuffers > 0) {
        err = mCamera->sendCommand(
            CAMERA_CMD_SET_VIDEO_BUFFER_COUNT, mNumInputBuffers, 0);

 if (err != OK) {
            ALOGW("Failed to set video buffer count to %d due to %d",
                mNumInputBuffers, err);
 }
 }

    err = mCamera->sendCommand(
        CAMERA_CMD_SET_VIDEO_FORMAT, mEncoderFormat, mEncoderDataSpace);

 if (err != OK) {
        ALOGW("Failed to set video encoder format/dataspace to %d, %d due to %d",
                mEncoderFormat, mEncoderDataSpace, err);
 }

    err = OK;
 if (mCameraFlags & FLAGS_HOT_CAMERA) {
        mCamera->unlock();
        mCamera.clear();
 if ((err = mCameraRecordingProxy->startRecording(
 new ProxyListener(this))) != OK) {
            ALOGE("Failed to start recording, received error: %s (%d)",
                    strerror(-err), err);
 }
 } else {
        mCamera->setListener(new CameraSourceListener(this));
        mCamera->startRecording();
 if (!mCamera->recordingEnabled()) {
            err = -EINVAL;
            ALOGE("Failed to start recording");
 }
 }
 IPCThreadState::self()->restoreCallingIdentity(token);
 return err;
}


redrawWinline(
    win_T	*wp,
    linenr_T	lnum)
{
    if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum)
	wp->w_redraw_top = lnum;
    if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum)
	wp->w_redraw_bot = lnum;
    redraw_win_later(wp, VALID);
}


int fib6_rules_dump(struct net *net, struct notifier_block *nb)
{
	return fib_rules_dump(net, nb, AF_INET6);
}


static int vmdk_is_allocated(BlockDriverState *bs, int64_t sector_num,

                             int nb_sectors, int *pnum)

{

    BDRVVmdkState *s = bs->opaque;

    int index_in_cluster, n;

    uint64_t cluster_offset;

    cluster_offset = get_cluster_offset(bs, sector_num << 9, 0);

    index_in_cluster = sector_num % s->cluster_sectors;

    n = s->cluster_sectors - index_in_cluster;

    if (n > nb_sectors)

        n = nb_sectors;

    *pnum = n;

    return (cluster_offset != 0);

}


authentic_chv_set_pinpad(struct sc_card *card, unsigned char reference)
{
	struct sc_context *ctx = card->ctx;
	struct sc_pin_cmd_data pin_cmd;
	unsigned char pin_data[0x100];
	int rv;

	LOG_FUNC_CALLED(ctx);
	sc_log(ctx, "Set CHV PINPAD PIN reference %i", reference);

	if (!card->reader || !card->reader->ops || !card->reader->ops->perform_verify)   {
		sc_log(ctx, "Reader not ready for PIN PAD");
		LOG_FUNC_RETURN(ctx, SC_ERROR_READER);
	}

	memset(&pin_cmd, 0, sizeof(pin_cmd));
	pin_cmd.pin_type = SC_AC_CHV;
	pin_cmd.pin_reference = reference;
	pin_cmd.cmd = SC_PIN_CMD_UNBLOCK;
	pin_cmd.flags |= SC_PIN_CMD_USE_PINPAD | SC_PIN_CMD_NEED_PADDING;

	rv = authentic_pin_get_policy(card, &pin_cmd);
	LOG_TEST_RET(ctx, rv, "Get 'PIN policy' error");

	memset(pin_data, pin_cmd.pin1.pad_char, sizeof(pin_data));
	pin_cmd.pin1.data = pin_data;

	pin_cmd.pin1.len = pin_cmd.pin1.min_length;
        pin_cmd.pin1.max_length = 8;

	memcpy(&pin_cmd.pin2, &pin_cmd.pin1, sizeof(pin_cmd.pin1));
	memset(&pin_cmd.pin1, 0, sizeof(pin_cmd.pin1));

	sc_log(ctx,
	       "PIN2 max/min/pad %"SC_FORMAT_LEN_SIZE_T"u/%"SC_FORMAT_LEN_SIZE_T"u/%"SC_FORMAT_LEN_SIZE_T"u",
	       pin_cmd.pin2.max_length, pin_cmd.pin2.min_length,
	       pin_cmd.pin2.pad_length);
	rv = iso_ops->pin_cmd(card, &pin_cmd, NULL);

	LOG_FUNC_RETURN(ctx, rv);
}


MemoryMappedFile::MemoryMappedFile()
    : file_(base::kInvalidPlatformFileValue),
      data_(NULL),
      length_(0) {
}


static int qemuAgentIORead ( qemuAgentPtr mon ) {
 size_t avail = mon -> bufferLength - mon -> bufferOffset ;
 int ret = 0 ;
 if ( avail < 1024 ) {
 if ( VIR_REALLOC_N ( mon -> buffer , mon -> bufferLength + 1024 ) < 0 ) return - 1 ;
 mon -> bufferLength += 1024 ;
 avail += 1024 ;
 }
 while ( avail > 1 ) {
 int got ;
 got = read ( mon -> fd , mon -> buffer + mon -> bufferOffset , avail - 1 ) ;
 if ( got < 0 ) {
 if ( errno == EAGAIN ) break ;
 virReportSystemError ( errno , "%s" , _ ( "Unable to read from monitor" ) ) ;
 ret = - 1 ;
 break ;
 }
 if ( got == 0 ) break ;
 ret += got ;
 avail -= got ;
 mon -> bufferOffset += got ;
 mon -> buffer [ mon -> bufferOffset ] = '\0' ;
 }
 # if DEBUG_IO VIR_DEBUG ( "Now read %zu bytes of data" , mon -> bufferOffset ) ;
 # endif return ret ;
 }


static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
    BlackBerry::WebKit::WebPage* page = BlackBerry::WebKit::DumpRenderTree::currentInstance()->page();
    page->mouseEvent(BlackBerry::Platform::MouseEvent(BlackBerry::Platform::MouseEvent::ScreenLeftMouseButton, 0, lastMousePosition, IntPoint::zero(), 0, 0, 0));
    return JSValueMakeUndefined(context);
}


void Document::setVlinkColor(const AtomicString& value) {
  if (!IsFrameSet())
    SetBodyAttribute(kVlinkAttr, value);
}


int gd_getin(void *in)
{
	return (gdGetC((gdIOCtx *)in));
}


static double patternjoinsel ( PG_FUNCTION_ARGS , Pattern_Type ptype , bool negate ) {
 return negate ? ( 1.0 - DEFAULT_MATCH_SEL ) : DEFAULT_MATCH_SEL ;
 }


nfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg,
			struct nfs_commit_info *cinfo)
{
	if (pnfs_mark_request_commit(req, lseg, cinfo))
		return;
	nfs_request_add_commit_list(req, &cinfo->mds->list, cinfo);
}


void RecordBlobItemSizeStats(const DataElement& input_element) {
  uint64_t length = input_element.length();

  switch (input_element.type()) {
    case DataElement::TYPE_BYTES:
    case DataElement::TYPE_BYTES_DESCRIPTION:
      UMA_HISTOGRAM_COUNTS_1M("Storage.BlobItemSize.Bytes", length / 1024);
      break;
    case DataElement::TYPE_BLOB:
      UMA_HISTOGRAM_COUNTS_1M("Storage.BlobItemSize.Blob",
                              (length - input_element.offset()) / 1024);
      break;
    case DataElement::TYPE_FILE: {
      bool full_file = (length == std::numeric_limits<uint64_t>::max());
      UMA_HISTOGRAM_BOOLEAN("Storage.BlobItemSize.File.Unknown", full_file);
      if (!full_file) {
        UMA_HISTOGRAM_COUNTS_1M("Storage.BlobItemSize.File",
                                (length - input_element.offset()) / 1024);
      }
      break;
    }
    case DataElement::TYPE_FILE_FILESYSTEM: {
      bool full_file = (length == std::numeric_limits<uint64_t>::max());
      UMA_HISTOGRAM_BOOLEAN("Storage.BlobItemSize.FileSystem.Unknown",
                            full_file);
      if (!full_file) {
        UMA_HISTOGRAM_COUNTS_1M("Storage.BlobItemSize.FileSystem",
                                (length - input_element.offset()) / 1024);
      }
      break;
    }
    case DataElement::TYPE_DISK_CACHE_ENTRY:
      UMA_HISTOGRAM_COUNTS_1M("Storage.BlobItemSize.CacheEntry",
                              (length - input_element.offset()) / 1024);
      break;
    case DataElement::TYPE_DATA_PIPE:
    case DataElement::TYPE_UNKNOWN:
      NOTREACHED();
      break;
  }
}


static int show_net_compression ( THD * thd , SHOW_VAR * var , char * buff ) {
 var -> type = SHOW_MY_BOOL ;
 var -> value = ( char * ) & thd -> net . compress ;
 return 0 ;
 }


struct bio *bio_split(struct bio *bio, int sectors,
		      gfp_t gfp, struct bio_set *bs)
{
	struct bio *split = NULL;

	BUG_ON(sectors <= 0);
	BUG_ON(sectors >= bio_sectors(bio));

	split = bio_clone_fast(bio, gfp, bs);
	if (!split)
		return NULL;

	split->bi_iter.bi_size = sectors << 9;

	if (bio_integrity(split))
		bio_integrity_trim(split);

	bio_advance(bio, split->bi_iter.bi_size);

	if (bio_flagged(bio, BIO_TRACE_COMPLETION))
		bio_set_flag(bio, BIO_TRACE_COMPLETION);

	return split;
}


static struct nfs4_state *nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data)
{
	struct inode *inode;
	struct nfs4_state *state = NULL;
	struct nfs_delegation *delegation;
	int ret;

	if (!data->rpc_done) {
		state = nfs4_try_open_cached(data);
		goto out;
	}

	ret = -EAGAIN;
	if (!(data->f_attr.valid & NFS_ATTR_FATTR))
		goto err;
	inode = nfs_fhget(data->dir->d_sb, &data->o_res.fh, &data->f_attr);
	ret = PTR_ERR(inode);
	if (IS_ERR(inode))
		goto err;
	ret = -ENOMEM;
	state = nfs4_get_open_state(inode, data->owner);
	if (state == NULL)
		goto err_put_inode;
	if (data->o_res.delegation_type != 0) {
		int delegation_flags = 0;

		rcu_read_lock();
		delegation = rcu_dereference(NFS_I(inode)->delegation);
		if (delegation)
			delegation_flags = delegation->flags;
		rcu_read_unlock();
		if ((delegation_flags & 1UL<<NFS_DELEGATION_NEED_RECLAIM) == 0)
			nfs_inode_set_delegation(state->inode,
					data->owner->so_cred,
					&data->o_res);
		else
			nfs_inode_reclaim_delegation(state->inode,
					data->owner->so_cred,
					&data->o_res);
	}

	update_open_stateid(state, &data->o_res.stateid, NULL,
			data->o_arg.fmode);
	iput(inode);
out:
	return state;
err_put_inode:
	iput(inode);
err:
	return ERR_PTR(ret);
}


 virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
 PixelFormat format, uint32_t usage) {
 Parcel data, reply;
        data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
        data.writeInt32(static_cast<int32_t>(async));
        data.writeUint32(width);
        data.writeUint32(height);
        data.writeInt32(static_cast<int32_t>(format));
        data.writeUint32(usage);
 status_t result = remote()->transact(ALLOCATE_BUFFERS, data, &reply);
 if (result != NO_ERROR) {
            ALOGE("allocateBuffers failed to transact: %d", result);
 }
 }


 virtual void dump(String8& result, const char* prefix) const {
 Parcel data, reply;
        data.writeInterfaceToken(IGraphicBufferConsumer::getInterfaceDescriptor());
        data.writeString8(result);
        data.writeString8(String8(prefix ? prefix : ""));
        remote()->transact(DUMP, data, &reply);
        reply.readString8();
 }


int RenderBlock::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
{
    if (isInline() && linePositionMode == PositionOnContainingLine) {
        if (style()->hasAppearance() && !RenderTheme::theme().isControlContainer(style()->appearance()))
            return RenderTheme::theme().baselinePosition(this);

        bool ignoreBaseline = (layer() && layer()->scrollableArea() && (isMarquee() || (direction == HorizontalLine ? (layer()->scrollableArea()->verticalScrollbar() || layer()->scrollableArea()->scrollYOffset())
            : (layer()->scrollableArea()->horizontalScrollbar() || layer()->scrollableArea()->scrollXOffset())))) || (isWritingModeRoot() && !isRubyRun());

        int baselinePos = ignoreBaseline ? -1 : inlineBlockBaseline(direction);

        if (isDeprecatedFlexibleBox()) {
            LayoutUnit bottomOfContent = direction == HorizontalLine ? borderTop() + paddingTop() + contentHeight() : borderRight() + paddingRight() + contentWidth();
            if (baselinePos > bottomOfContent)
                baselinePos = -1;
        }
        if (baselinePos != -1)
            return beforeMarginInLineDirection(direction) + baselinePos;

        return RenderBox::baselinePosition(baselineType, firstLine, direction, linePositionMode);
    }

    ASSERT(linePositionMode == PositionOfInteriorLineBoxes);

    const FontMetrics& fontMetrics = style(firstLine)->fontMetrics();
    return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
}


handle_update_in_thread_func (GTask *task,
                              gpointer source_object,
                              gpointer task_data,
                              GCancellable *cancellable)
{
  PortalFlatpakUpdateMonitor *monitor = source_object;
  UpdateMonitorData *m = update_monitor_get_data (monitor);
  g_autoptr(GError) error = NULL;
  const char *window;

  window = (const char *)g_object_get_data (G_OBJECT (task), "window");

  if (request_update_permissions_sync (monitor, m->name, window, &error))
    {
      g_autoptr(GFile) installation_path = update_monitor_get_installation_path (monitor);
      g_autofree char *ref = flatpak_build_app_ref (m->name, m->branch, m->arch);
      const char *argv[] = { "/proc/self/exe", "flatpak-portal", "--update", flatpak_file_get_path_cached (installation_path), ref, NULL };
      int sockets[2];
      GPid pid;

      if (socketpair (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sockets) != 0)
        {
          glnx_throw_errno (&error);
        }
      else
        {
          gboolean spawn_ok;

          spawn_ok = g_spawn_async (NULL, (char **)argv, NULL,
                                    G_SPAWN_FILE_AND_ARGV_ZERO |
                                    G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
                                    update_child_setup_func, &sockets[1],
                                    &pid, &error);
          close (sockets[1]); // Close remote side
          if (spawn_ok)
            {
              if (!handle_update_responses (monitor, sockets[0], &error))
                {
                  if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
                    kill (pid, SIGINT);
                }
            }
          close (sockets[0]); // Close local side
        }
    }

  if (error)
    emit_progress_error (monitor, error);

  g_mutex_lock (&m->lock);
  m->installing = FALSE;
  g_mutex_unlock (&m->lock);
}


M_fs_error_t M_fs_path_set_cwd(const char *path)
{
	if (path == NULL || *path == '\0')
		return M_FS_ERROR_INVALID;

#ifdef _WIN32
	if (SetCurrentDirectory(path) == 0) {
		return M_fs_error_from_syserr(GetLastError());
	}
#else
	if (chdir(path) != 0) {
		return M_fs_error_from_syserr(errno);
	}
#endif

	return M_FS_ERROR_SUCCESS;
}


IRC_PROTOCOL_CALLBACK(invite)
{
    IRC_PROTOCOL_MIN_ARGS(4);
    IRC_PROTOCOL_CHECK_HOST;

    if (ignored)
        return WEECHAT_RC_OK;

    if (irc_server_strcasecmp (server, argv[2], server->nick) == 0)
    {
        weechat_printf_date_tags (
            irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL),
            date,
            irc_protocol_tags (command, "notify_highlight", nick, address),
            _("%sYou have been invited to %s%s%s by %s%s%s"),
            weechat_prefix ("network"),
            IRC_COLOR_CHAT_CHANNEL,
            (argv[3][0] == ':') ? argv[3] + 1 : argv[3],
            IRC_COLOR_RESET,
            irc_nick_color_for_msg (server, 1, NULL, nick),
            nick,
            IRC_COLOR_RESET);
    }
    else
    {
        /* CAP invite-notify */
        /* imitate numeric 341 output */
        weechat_printf_date_tags (
            irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL),
            date,
            irc_protocol_tags (command, NULL, nick, address),
            _("%s%s%s%s has invited %s%s%s to %s%s%s"),
            weechat_prefix ("network"),
            irc_nick_color_for_msg (server, 1, NULL, nick),
            nick,
            IRC_COLOR_RESET,
            irc_nick_color_for_msg (server, 1, NULL, argv[2]),
            argv[2],
            IRC_COLOR_RESET,
            IRC_COLOR_CHAT_CHANNEL,
            (argv[3][0] == ':') ? argv[3] + 1 : argv[3],
            IRC_COLOR_RESET);
    }

    return WEECHAT_RC_OK;
}


int lxc_clear_config_keepcaps(struct lxc_conf *c)
{
	struct lxc_list *it,*next;

	lxc_list_for_each_safe(it, &c->keepcaps, next) {
		lxc_list_del(it);
		free(it->elem);
		free(it);
	}
	return 0;
}


void ResourceMessageFilter::OnSetCacheMode(bool enabled) {
  if (!CheckBenchmarkingEnabled())
    return;

  net::HttpCache::Mode mode = enabled ?
      net::HttpCache::NORMAL : net::HttpCache::DISABLE;
  request_context_->GetURLRequestContext()->
      http_transaction_factory()->GetCache()->set_mode(mode);
}