当前位置: 首页>>代码示例>>C++>>正文


C++ out_uint8函数代码示例

本文整理汇总了C++中out_uint8函数的典型用法代码示例。如果您正苦于以下问题:C++ out_uint8函数的具体用法?C++ out_uint8怎么用?C++ out_uint8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了out_uint8函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: iso_send_connection_request

static BOOL
iso_send_connection_request(RDPCLIENT * This, char *cookie)
{
	STREAM s;
	int cookielen = (int)strlen(cookie);
	int length = 11 + cookielen;

	s = tcp_init(This, length);

	if(s == NULL)
		return False;

	out_uint8(s, 3);	/* version */
	out_uint8(s, 0);	/* reserved */
	out_uint16_be(s, length);	/* length */

	out_uint8(s, length - 5);	/* hdrlen */
	out_uint8(s, ISO_PDU_CR);
	out_uint16(s, 0);	/* dst_ref */
	out_uint16(s, 0);	/* src_ref */
	out_uint8(s, 0);	/* class */

	out_uint8p(s, cookie, cookielen);

	s_mark_end(s);
	return tcp_send(This, s);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:27,代码来源:iso.c

示例2: xrdp_emt_send_result

bool APP_CC
xrdp_emt_send_result(struct xrdp_rdp* self, struct xrdp_emt* emt)
{
  struct stream* s;

  if (emt == NULL)
  {
    printf("emt is null\n");
    return false;
  }

  make_stream(s);
  init_stream(s, 40);
  xrdp_sec_init(self->sec_layer, s);

  out_uint8(s, SEC_AUTODETECT_REQ_LENGTH);               // headerLength
  out_uint8(s, TYPE_ID_AUTODETECT_REQUEST);              // headerTypeId
  out_uint16_le(s, emt->seq_number++);                   // sequenceNumber
  out_uint16_le(s, field_all);                           // responseType

  out_uint32_le(s, self->session->base_RTT);
  out_uint32_le(s, self->session->bandwidth);
  out_uint32_le(s, self->session->average_RTT);

  s_mark_end(s);

  xrdp_emt_send_packet(self, emt, s);
  free_stream(s);

  return true;
}
开发者ID:harpyham,项目名称:openulteo,代码行数:31,代码来源:xrdp_emt.c

示例3: tpkt_output_header

/* Output TPKT header for length length.
 * Length should include the TPKT header (4 bytes) */
static void
tpkt_output_header(STREAM s, int length)
{
	out_uint8(s, 3);	/* version */
	out_uint8(s, 0);	/* reserved */
	out_uint16_be(s, length);	/* length */
}
开发者ID:g-reno,项目名称:FreeRDP-old,代码行数:9,代码来源:iso.c

示例4: licence_send_authresp

/* Send a Licensing packet with Platform Challenge Response */
static void
licence_send_authresp(rdpLicence * licence, uint8 * token, uint8 * crypt_hwid, uint8 * signature)
{
    uint32 sec_flags = SEC_LICENSE_PKT;
    uint16 length = 58;
    STREAM s;

    s = sec_init(licence->sec, sec_flags, length + 2);

    /* Licensing Preamble (LICENSE_PREAMBLE) */
    out_uint8(s, PLATFORM_CHALLENGE_RESPONSE);	/* PLATFORM_CHALLENGE_RESPONSE */
    out_uint8(s, 2);	/* PREAMBLE_VERSION_2_0 */
    out_uint16_le(s, length);

    /* Licensing Binary BLOB with EncryptedPlatformChallengeResponse: */
    out_uint16_le(s, 1);	/* wBlobType should be 0x0009 (BB_ENCRYPTED_DATA_BLOB) */
    out_uint16_le(s, LICENCE_TOKEN_SIZE);	/* wBlobLen */
    out_uint8p(s, token, LICENCE_TOKEN_SIZE);	/* RC4-encrypted challenge data */

    /* Licensing Binary BLOB with EncryptedHWID: */
    out_uint16_le(s, 1);	/* wBlobType should be 0x0009 (BB_ENCRYPTED_DATA_BLOB) */
    out_uint16_le(s, LICENCE_HWID_SIZE);	/* wBlobLen */
    out_uint8p(s, crypt_hwid, LICENCE_HWID_SIZE);	/* RC4-encrypted Client Hardware Identification */

    out_uint8p(s, signature, LICENCE_SIGNATURE_SIZE);	/* MACData */

    s_mark_end(s);
    sec_send(licence->sec, s, sec_flags);
}
开发者ID:nidelius,项目名称:FreeRDP,代码行数:30,代码来源:licence.c

示例5: licence_send_authresp

/* Send an authentication response packet */
static void
licence_send_authresp(uint8 * token, uint8 * crypt_hwid, uint8 * signature)
{
	uint32 sec_flags = SEC_LICENCE_NEG;
	uint16 length = 58;
	STREAM s;

	s = sec_init(sec_flags, length + 2);

	out_uint8(s, LICENCE_TAG_AUTHRESP);
	out_uint8(s, 2);	/* version */
	out_uint16_le(s, length);

	out_uint16_le(s, 1);
	out_uint16_le(s, LICENCE_TOKEN_SIZE);
	out_uint8p(s, token, LICENCE_TOKEN_SIZE);

	out_uint16_le(s, 1);
	out_uint16_le(s, LICENCE_HWID_SIZE);
	out_uint8p(s, crypt_hwid, LICENCE_HWID_SIZE);

	out_uint8p(s, signature, LICENCE_SIGNATURE_SIZE);

	s_mark_end(s);
	sec_send(s, sec_flags);
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:27,代码来源:licence.c

示例6: rdp_out_general_capset

void rdp_out_general_capset(rdpRdp * rdp, STREAM s)
{
	int flags;
	capsetHeaderRef header;

	header = rdp_skip_capset_header(s);
	out_uint16_le(s, OS_MAJOR_TYPE_WINDOWS); /* osMajorType */
	out_uint16_le(s, OS_MINOR_TYPE_WINDOWS_NT); /* osMinorType */
	out_uint16_le(s, CAPS_PROTOCOL_VERSION); /* protocolVersion */
	out_uint16_le(s, 0); /* pad */
	out_uint16_le(s, 0); /* generalCompressionTypes, must be set to 0 */
	flags = 0;
	if (rdp->settings->rdp_version >= 5)
	{
		flags = FASTPATH_OUTPUT_SUPPORTED | NO_BITMAP_COMPRESSION_HDR |
			LONG_CREDENTIALS_SUPPORTED | AUTORECONNECT_SUPPORTED;
	}
	out_uint16_le(s, flags); /* extraFlags */
	out_uint16_le(s, 0); /* updateCapabilityFlag, must be set to 0 */
	out_uint16_le(s, 0); /* remoteUnshareFlag, must be set to 0 */
	out_uint16_le(s, 0); /* generalCompressionLevel, must be set to 0 */
	out_uint8(s, 0); /* refreshRectSupport, either TRUE (0x01) or FALSE (0x00) */
	out_uint8(s, 0); /* suppressOutputSupport, either TRUE (0x01) or FALSE (0x00) */
	rdp_out_capset_header(s, header, CAPSET_TYPE_GENERAL);
}
开发者ID:roman-b,项目名称:FreeRDP,代码行数:25,代码来源:capabilities.c

示例7: licence_send_platform_challenge_response

/* Send a platform challenge response packet */
static void
licence_send_platform_challenge_response(uint8 * token, uint8 * crypt_hwid, uint8 * signature)
{
	uint32 sec_flags = SEC_LICENSE_PKT;
	uint16 length = 58;
	STREAM s;

	s = sec_init(sec_flags, length + 2);

	out_uint8(s, LICENCE_TAG_PLATFORM_CHALLENGE_RESPONSE);
	out_uint8(s, ((g_rdp_version >= RDP_V5) ? 3 : 2));	/* version */
	out_uint16_le(s, length);

	out_uint16_le(s, 1);
	out_uint16_le(s, LICENCE_TOKEN_SIZE);
	out_uint8p(s, token, LICENCE_TOKEN_SIZE);

	out_uint16_le(s, 1);
	out_uint16_le(s, LICENCE_HWID_SIZE);
	out_uint8p(s, crypt_hwid, LICENCE_HWID_SIZE);

	out_uint8p(s, signature, LICENCE_SIGNATURE_SIZE);

	s_mark_end(s);
	sec_send(s, sec_flags);
}
开发者ID:gsomlo,项目名称:rdesktop,代码行数:27,代码来源:licence.c

示例8: licence_send_authresp

/* Send an authentication response packet */
static BOOL
licence_send_authresp(RDPCLIENT * This, uint8 * token, uint8 * crypt_hwid, uint8 * signature)
{
	uint32 sec_flags = SEC_LICENCE_NEG;
	uint16 length = 58;
	STREAM s;

	s = sec_init(This, sec_flags, length + 2);

	if(s == NULL)
		return False;

	out_uint8(s, LICENCE_TAG_AUTHRESP);
	out_uint8(s, 2);	/* version */
	out_uint16_le(s, length);

	out_uint16_le(s, 1);
	out_uint16_le(s, LICENCE_TOKEN_SIZE);
	out_uint8p(s, token, LICENCE_TOKEN_SIZE);

	out_uint16_le(s, 1);
	out_uint16_le(s, LICENCE_HWID_SIZE);
	out_uint8p(s, crypt_hwid, LICENCE_HWID_SIZE);

	out_uint8p(s, signature, LICENCE_SIGNATURE_SIZE);

	s_mark_end(s);
	return sec_send(This, s, sec_flags);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:30,代码来源:licence.c

示例9: xrdp_orders_send_window_cached_icon

/* flags can contain WINDOW_ORDER_STATE_NEW and/or
   WINDOW_ORDER_FIELD_ICON_BIG */
int
xrdp_orders_send_window_cached_icon(struct xrdp_orders *self,
                                    int window_id, int cache_entry,
                                    int cache_id, int flags)
{
    int order_size;
    int order_flags;
    int field_present_flags;

    order_size = 14;
    if (xrdp_orders_check(self, order_size) != 0)
    {
        return 1;
    }
    self->order_count++;
    order_flags = RDP_ORDER_SECONDARY;
    order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */
    out_uint8(self->out_s, order_flags);
    /* orderSize (2 bytes) */
    out_uint16_le(self->out_s, order_size);
    /* FieldsPresentFlags (4 bytes) */
    field_present_flags = flags | WINDOW_ORDER_TYPE_WINDOW |
                          WINDOW_ORDER_CACHED_ICON;
    out_uint32_le(self->out_s, field_present_flags);
    /* windowId (4 bytes) */
    out_uint32_le(self->out_s, window_id);
    /* CacheEntry (2 bytes) */
    out_uint16_le(self->out_s, cache_entry);
    /* CacheId (1 byte) */
    out_uint8(self->out_s, cache_id);
    return 0;
}
开发者ID:cocoon,项目名称:xrdp,代码行数:34,代码来源:xrdp_orders_rail.c

示例10: xrdp_orders_send_monitored_desktop

/* used for both Non-Monitored Desktop and Actively Monitored Desktop */
int
xrdp_orders_send_monitored_desktop(struct xrdp_orders *self,
                                   struct rail_monitored_desktop_order *mdo,
                                   int flags)
{
    int order_size;
    int order_flags;
    int field_present_flags;
    int index;

    order_size = 7;
    field_present_flags = flags | WINDOW_ORDER_TYPE_DESKTOP;

    if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND)
    {
        /* ActiveWindowId (4 bytes) */
        order_size += 4;
    }

    if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER)
    {
        /* NumWindowIds (1 byte) */
        order_size += 1;
        /* WindowIds (variable) */
        order_size += mdo->num_window_ids *  4;
    }

    if (xrdp_orders_check(self, order_size) != 0)
    {
        return 1;
    }
    self->order_count++;
    order_flags = RDP_ORDER_SECONDARY;
    order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */
    out_uint8(self->out_s, order_flags);
    /* orderSize (2 bytes) */
    out_uint16_le(self->out_s, order_size);
    /* FieldsPresentFlags (4 bytes) */
    out_uint32_le(self->out_s, field_present_flags);

    if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND)
    {
        /* ActiveWindowId (4 bytes) */
        out_uint32_le(self->out_s, mdo->active_window_id);
    }

    if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER)
    {
        /* NumWindowIds (1 byte) */
        out_uint8(self->out_s, mdo->num_window_ids);

        /* WindowIds (variable) */
        for (index = 0; index < mdo->num_window_ids; index++)
        {
            out_uint32_le(self->out_s, mdo->window_ids[index]);
        }
    }

    return 0;
}
开发者ID:cocoon,项目名称:xrdp,代码行数:61,代码来源:xrdp_orders_rail.c

示例11: scp_v1c_resend_credentials

/* 004 */
enum SCP_CLIENT_STATES_E
scp_v1c_resend_credentials(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
{
    tui8 sz;
    tui32 size;

    init_stream(c->out_s, c->out_s->size);
    init_stream(c->in_s, c->in_s->size);

    size = 12 + 2 + g_strlen(s->username) + g_strlen(s->password);

    /* sending request */
    /* header */
    out_uint32_be(c->out_s, 1); /* version */
    out_uint32_be(c->out_s, size);
    out_uint16_be(c->out_s, SCP_COMMAND_SET_DEFAULT);
    out_uint16_be(c->out_s, 4);

    /* body */
    sz = g_strlen(s->username);
    out_uint8(c->out_s, sz);
    out_uint8p(c->out_s, s->username, sz);
    sz = g_strlen(s->password);
    out_uint8(c->out_s, sz);
    out_uint8p(c->out_s, s->password, sz);

    if (0 != scp_tcp_force_send(c->in_sck, c->out_s->data, size))
    {
        return SCP_CLIENT_STATE_NETWORK_ERR;
    }

    /* wait for response */
    return _scp_v1c_check_response(c, s);
}
开发者ID:speidy,项目名称:xrdp,代码行数:35,代码来源:libscp_v1c.c

示例12: xrdp_emt_send_request

bool APP_CC
xrdp_emt_send_request(struct xrdp_rdp* self, struct xrdp_emt* emt, int type)
{
  struct stream* s;

  if (emt == NULL)
  {
    printf("emt is null\n");
    return false;
  }

  make_stream(s);
  init_stream(s, 40);
  xrdp_sec_init(self->sec_layer, s);

  out_uint8(s, SEC_AUTODETECT_REQ_LENGTH);               // headerLength
  out_uint8(s, TYPE_ID_AUTODETECT_REQUEST);              // headerTypeId
  out_uint16_le(s, emt->seq_number++);                   // sequenceNumber
  out_uint16_le(s, type);                                // responseType
  s_mark_end(s);

  xrdp_emt_send_packet(self, emt, s);
  free_stream(s);

  return true;
}
开发者ID:harpyham,项目名称:openulteo,代码行数:26,代码来源:xrdp_emt.c

示例13: rdp_out_bitmap_capset

void rdp_out_bitmap_capset(rdpRdp * rdp, STREAM s)
{
	capsetHeaderRef header;

	header = rdp_skip_capset_header(s);

	/*
	 * preferredBitsPerPixel (2 bytes):
	 * A 16-bit, unsigned integer. Color depth of the remote session. In RDP 4.0 and 5.0,
	 * this field MUST be set to 8 (even for a 16-color session)
	 */

	if(rdp->settings->rdp_version <= 5)
		out_uint16_le(s, 8); /* preferredBitsPerPixel */
	else
		out_uint16_le(s, rdp->settings->server_depth); /* preferredBitsPerPixel */

	out_uint16_le(s, 1); /* receive1BitPerPixel */
	out_uint16_le(s, 1); /* receive4BitsPerPixel */
	out_uint16_le(s, 1); /* receive8BitsPerPixel */
	out_uint16_le(s, rdp->settings->width); /* desktopWidth */
	out_uint16_le(s, rdp->settings->height); /* desktopHeight */
	out_uint16_le(s, 0); /* pad */
	out_uint16_le(s, 1); /* desktopResizeFlag */
	out_uint16_le(s, rdp->settings->bitmap_compression ? 1 : 0); /* bitmapCompressionFlag */
	out_uint8(s, 0); /* highColorFlags, ignored and should be set to zero */
	out_uint8(s, 1); /* drawingFlags, indicating support for 32 bpp bitmaps */
	out_uint16_le(s, 1); /* multipleRectangleSupport, must be set to true */
	out_uint16_le(s, 0); /* pad */
	rdp_out_capset_header(s, header, CAPSET_TYPE_BITMAP);
}
开发者ID:roman-b,项目名称:FreeRDP,代码行数:31,代码来源:capabilities.c

示例14: iso_fp_send

/* Send an fast path data PDU */
void
iso_fp_send(rdpIso * iso, STREAM s, uint32 flags)
{
	int fp_flags;
	int len;
	int index;

	fp_flags = (1 << 2) | 0;	/* one event, fast path */
	if (flags & SEC_ENCRYPT)
	{
		fp_flags |= 2 << 6;	/* FASTPATH_INPUT_ENCRYPTED */
	}
	s_pop_layer(s, iso_hdr);
	len = (int) (s->end - s->p);
	out_uint8(s, fp_flags);
	if (len >= 128)
	{
		out_uint16_be(s, len | 0x8000);
	}
	else
	{
		/* copy the bits up to pack and save 1 byte */
		for (index = 3; index < len; index++)
		{
			s->data[index - 1] = s->data[index];
		}
		len--;
		s->end--;
		out_uint8(s, len);
	}

	tcp_send(iso->tcp, s);
}
开发者ID:g-reno,项目名称:FreeRDP-old,代码行数:34,代码来源:iso.c

示例15: rdp_iso_send_msg

static int APP_CC
rdp_iso_send_msg(struct rdp_iso *self, struct stream *s, int code)
{
    if (rdp_tcp_init(self->tcp_layer, s) != 0)
    {
        return 1;
    }

    out_uint8(s, 3);
    out_uint8(s, 0);
    out_uint16_be(s, 11); /* length */
    out_uint8(s, 6);
    out_uint8(s, code);
    out_uint16_le(s, 0);
    out_uint16_le(s, 0);
    out_uint8(s, 0);
    s_mark_end(s);

    if (rdp_tcp_send(self->tcp_layer, s) != 0)
    {
        return 1;
    }

    return 0;
}
开发者ID:340211173,项目名称:xrdp,代码行数:25,代码来源:rdp_iso.c


注:本文中的out_uint8函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。