⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libnet-functions.h.3

📁 在unix环境下编写网络编程一个很好的开发包
💻 3
📖 第 1 页 / 共 5 页
字号:
\fIpriority\fP priority .br\fIcfi\fP canonical format indicator .br\fIvlan_id\fP vlan identifier .br\fIlen_proto\fP length (802.3) protocol (Ethernet II) .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_802_1x (u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an IEEE 802.1x extended authentication protocol header. .PP\fBParameters:\fP.RS 4\fIeap_ver\fP the EAP version .br\fIeap_type\fP the EAP type .br\fIlength\fP frame length .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_802_2 (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an IEEE 802.2 LLC header. .PP\fBParameters:\fP.RS 4\fIdsap\fP destination service access point .br\fIssap\fP source service access point .br\fIcontrol\fP control field .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_802_2snap (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t * oui, u_int16_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an IEEE 802.2 LLC SNAP header. .PP\fBParameters:\fP.RS 4\fIdsap\fP destination service access point .br\fIssap\fP source service access point .br\fIcontrol\fP control field .br\fIoui\fP Organizationally Unique Identifier .br\fItype\fP upper layer protocol .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_802_3 (u_int8_t * dst, u_int8_t * src, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an IEEE 802.3 header. The 802.3 header is almost identical to the RFC 894 Ethernet II header, the exception being that the field immediately following the source address holds the frame's length (as opposed to the layer 3 protocol). You should only use this function when libnet is initialized with the LIBNET_LINK interface. .PP\fBParameters:\fP.RS 4\fIdst\fP destination ethernet address .br\fIsrc\fP source ethernet address .br\fIlen\fP frame length sans header .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_arp (u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln, u_int16_t op, u_int8_t * sha, u_int8_t * spa, u_int8_t * tha, u_int8_t * tpa, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an Address Resolution Protocol (ARP) header. Depending on the op value, the function builds one of several different types of RFC 826 or RFC 903 RARP packets. .PP\fBParameters:\fP.RS 4\fIhrd\fP hardware address format .br\fIpro\fP protocol address format .br\fIhln\fP hardware address length .br\fIpln\fP protocol address length .br\fIop\fP ARP operation type .br\fIsha\fP sender's hardware address .br\fIspa\fP sender's protocol address .br\fItha\fP target hardware address .br\fItpa\fP targer protocol address .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_bgp4_header (u_int8_t marker[LIBNET_BGP4_MARKER_SIZE], u_int16_t len, u_int8_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an RFC 1771 Border Gateway Protocol 4 (BGP-4) header. The primary function of a BGP speaking system is to exchange network reachability information with other BGP systems. This network reachability information includes information on the list of Autonomous Systems (ASs) that reachability information traverses. This information is sufficient to construct a graph of AS connectivity from which routing loops may be pruned and some policy decisions at the AS level may be enforced. This function builds the base BGP header which is used as a preamble before any other BGP header. For example, a BGP KEEPALIVE message may be built with only this function, while an error notification requires a subsequent call to libnet_build_bgp4_notification. .PP\fBParameters:\fP.RS 4\fImarker\fP a value the receiver can predict (if the message type is not BGP OPEN, or no authentication is used, these 16 bytes are normally set as all ones) .br\fIlen\fP total length of the BGP message, including the header .br\fItype\fP type code of the message (OPEN, UPDATE, NOTIFICATION or KEEPALIVE) .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_bgp4_notification (u_int8_t err_code, u_int8_t err_subcode, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an RFC 1771 Border Gateway Protocol 4 (BGP-4) notification header. A NOTIFICATION message is sent when an error condition is detected. Specific error information may be passed through the payload interface. .PP\fBParameters:\fP.RS 4\fIerr_code\fP type of notification .br\fIerr_subcode\fP more specific information about the reported error. .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_bgp4_open (u_int8_t version, u_int16_t src_as, u_int16_t hold_time, u_int32_t bgp_id, u_int8_t opt_len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an RFC 1771 Border Gateway Protocol 4 (BGP-4) OPEN header. This is the first message sent by each side of a BGP connection. The optional parameters options should be constructed using the payload interface (see RFC 1771 for the options structures). .PP\fBParameters:\fP.RS 4\fIversion\fP protocol version (should be set to 4) .br\fIsrc_as\fP Autonomous System of the sender .br\fIhold_time\fP used to compute the maximum allowed time between the receipt of KEEPALIVE, and/or UPDATE messages by the sender .br\fIbgp_id\fP BGP identifier of the sender .br\fIopt_len\fP total length of the optional parameters field in bytes .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_bgp4_update (u_int16_t unfeasible_rt_len, u_int8_t * withdrawn_rt, u_int16_t total_path_attr_len, u_int8_t * path_attributes, u_int16_t info_len, u_int8_t * reachability_info, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an RFC 1771 Border Gateway Protocol 4 (BGP-4) update header. Update messages are used to transfer routing information between BGP peers. .PP\fBParameters:\fP.RS 4\fIunfeasible_rt_len\fP indicates the length of the (next) 'withdrawn routes' field in bytes .br\fIwithdrawn_rt\fP list of IP addresses prefixes for the routes that are being withdrawn; each IP address prefix is built as a 2-tuple <length (1 byte), prefix (variable)> .br\fItotal_path_attr_len\fP indicates the length of the (next) 'path attributes' field in bytes .br\fIpath_attributes\fP each attribute is a 3-tuple <type (2 bytes), length, value> .br\fIinfo_len\fP indicates the length of the (next) 'network layer reachability information' field in bytes (needed for internal memory size calculation) .br\fIreachability_info\fP 2-tuples <length (1 byte), prefix (variable)>. .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_bootpv4 (u_int8_t opcode, u_int8_t htype, u_int8_t hlen, u_int8_t hopcount, u_int32_t xid, u_int16_t secs, u_int16_t flags, u_int32_t cip, u_int32_t yip, u_int32_t sip, u_int32_t gip, u_int8_t * chaddr, u_int8_t * sname, u_int8_t * file, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PP\fBParameters:\fP.RS 4\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_cdp (u_int8_t version, u_int8_t ttl, u_int16_t sum, u_int16_t type, u_int16_t len, u_int8_t * value, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds a Cisco Discovery Protocol (CDP) header. Cisco Systems designed CDP to aid in the network management of adjacent Cisco devices. The CDP protocol specifies data by using a type/length/value (TLV) setup. The first TLV can specified by using the functions type, length, and value arguments. To specify additional TLVs, the programmer could either use the payload interface or \fBlibnet_build_data()\fP to construct them. .PP\fBParameters:\fP.RS 4\fIversion\fP CDP version .br\fIttl\fP time to live (time information should be cached by recipient) .br\fIsum\fP checksum (0 for libnet to autofill) .br\fItype\fP type of data contained in value .br\fIlen\fP length of value arugment .br\fIvalue\fP the CDP information string .br\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_data (u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds a generic libnet protocol header. This is useful for including an optional payload to a packet that might need to change repeatedly inside of a loop. .PP\fBParameters:\fP.RS 4\fIpayload\fP optional payload or NULL .br\fIpayload_s\fP payload length or 0 .br\fIl\fP pointer to a libnet context .br\fIptag\fP protocol tag to modify an existing header, 0 to build a new one .RE.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -