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

📄 libnet-functions.h.3

📁 在unix环境下编写网络编程一个很好的开发包
💻 3
📖 第 1 页 / 共 5 页
字号:
.SS "libnet_ptag_t libnet_build_dhcpv4 (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_dnsv4 (u_int16_t h_len, u_int16_t id, u_int16_t flags, u_int16_t num_q, u_int16_t num_anws_rr, u_int16_t num_auth_rr, u_int16_t num_addi_rr, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an RFC 1035 version 4 DNS header. Additional DNS payload information should be specified using the payload interface. .PP\fBParameters:\fP.RS 4\fIid\fP DNS packet id .br\fIflags\fP control flags .br\fInum_q\fP number of questions .br\fInum_anws_rr\fP number of answer resource records .br\fInum_auth_rr\fP number of authority resource records .br\fInum_addi_rr\fP number of additional resource records .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_egre (u_int16_t fv, u_int16_t type, u_int16_t sum, u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPGeneric Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any protocol. Hence, the IP part of the packet is usually referred as 'delivery header'. It is then followed by the GRE header and finally the encapsulated packet (IP or whatever). As GRE is very modular, the first GRE header describes the structure of the header, using bits and flag to specify which fields will be present in the header. .PP\fBParameters:\fP.RS 4\fIfv\fP the 16 0 to 7: which fields are included in the header (checksum, seq. number, key, ...), bits 8 to 12: flag, bits 13 to 15: version. .br\fIpayload\fP optional payload or NULL .br\fItype\fP which protocol is encapsulated (PPP, IP, ...) .br\fIsum\fP checksum (0 for libnet to autofill). .br\fIoffset\fP byte offset from the start of the routing field to the first byte of the SRE .br\fIkey\fP inserted by the encapsulator to authenticate the source .br\fIseq\fP sequence number used by the receiver to sort the packets .br\fIlen\fP size of the GRE packet .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_ethernet (u_int8_t * dst, u_int8_t * src, u_int16_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an Ethernet header. The RFC 894 Ethernet II header is almost identical to the IEEE 802.3 header, with the exception that the field immediately following the source address holds the layer 3 protocol (as opposed to frame's length). 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\fItype\fP upper layer protocol type .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_fddi (u_int8_t fc, u_int8_t * dst, u_int8_t * src, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t * org, u_int16_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds a Fiber Distributed Data Interface (FDDI) header. .PP\fBParameters:\fP.RS 4\fIfc\fP class format and priority  dst destination fddi address  src source fddi address .br\fIdsap\fP destination service access point .br\fIssap\fP source service access point .br\fIcf\fP cf .br\fIorg\fP 3 byte IEEE organizational code .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_gre (u_int16_t fv, u_int16_t type, u_int16_t sum, u_int16_t offset, u_int32_t key, u_int32_t seq, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPGeneric Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any protocol. Hence, the IP part of the packet is usually referred as 'delivery header'. It is then followed by the GRE header and finally the encapsulated packet (IP or whatever). As GRE is very modular, the first GRE header describes the structure of the header, using bits and flag to specify which fields will be present in the header. .PP\fBParameters:\fP.RS 4\fIfv\fP the 16 0 to 7: which fields are included in the header (checksum, seq. number, key, ...), bits 8 to 12: flag, bits 13 to 15: version. .br\fIpayload\fP optional payload or NULL .br\fItype\fP which protocol is encapsulated (PPP, IP, ...) .br\fIsum\fP checksum (0 for libnet to autofill). .br\fIoffset\fP byte offset from the start of the routing field to the first byte of the SRE .br\fIkey\fP inserted by the encapsulator to authenticate the source .br\fIseq\fP sequence number used by the receiver to sort the packets .br\fIlen\fP size of the GRE packet .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_gre_last_sre (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_gre_sre (u_int16_t af, u_int8_t offset, u_int8_t length, u_int8_t * routing, 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_icmpv4_echo (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) echo request/reply header .PP\fBParameters:\fP.RS 4\fItype\fP type of ICMP packet (should be ICMP_ECHOREPLY or ICMP_ECHO) .br\fIcode\fP code of ICMP packet (should be 0) .br\fIsum\fP checksum (0 for libnet to autofill) .br\fIid\fP identification number .br\fIseq\fP packet sequence number .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_icmpv4_mask (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, u_int32_t mask, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) IP netmask request/reply header. .PP\fBParameters:\fP.RS 4\fItype\fP type of ICMP packet (should be ICMP_MASKREQ or ICMP_MASKREPLY) .br\fIcode\fP code of ICMP packet (should be 0) .br\fIsum\fP checksum (0 for libnet to autofill) .br\fIid\fP identification number .br\fIseq\fP packet sequence number .br\fImask\fP subnet mask .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_icmpv4_redirect (u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t gateway, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an IP version 4 RFC 792 Internet Message Control Protocol (ICMP) redirect header. The additional arguments enable the application programmer to easily specify the original IP header values (the IP header of the packet that supposedly caused the ICMP redirect message in the first place). .PP\fBParameters:\fP.RS 4\fItype\fP type of ICMP packet (should be ICMP_REDIRECT) .br\fIcode\fP code of ICMP packet (should be one of the four redirect codes) .br\fIsum\fP checksum (0 for libnet to autofill) .br\fIorig_id\fP original IP header identification .br\fIorig_frag\fP original IP header fragmentation information .br\fIorig_ttl\fP orginal IP header time to live .br\fIorig_prot\fP original IP header protocol .br\fIorig_check\fP original IP header checksum .br\fIorig_src\fP original IP header source address .br\fIorig_dst\fP original IP header destination 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_icmpv4_timeexceed (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t orig_len, u_int8_t orig_tos, u_int16_t orig_id, u_int16_t orig_frag, u_int8_t orig_ttl, u_int8_t orig_prot, u_int16_t orig_check, u_int32_t orig_src, u_int32_t orig_dst, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) time exceeded header. The additional arguments enable the application programmer to easily specify the original IPv4 header values (the IP header of the packet that supposedly caused the ICMP time exceeded message in the first place). .PP\fBParameters:\fP.RS 4\fItype\fP type of ICMP packet (should be ICMP_TIMXCEED) .br\fIcode\fP code of ICMP packet (ICMP_TIMXCEED_INTRANS / ICMP_TIMXCEED_REASS) .br\fIsum\fP checksum (0 for libnet to autofill) .br\fIorig_id\fP original IP header identification .br\fIorig_frag\fP original IP header fragmentation information .br\fIorig_ttl\fP orginal IP header time to live .br\fIorig_prot\fP original IP header protocol .br\fIorig_check\fP original IP header checksum .br\fIorig_src\fP original IP header source address .br\fIorig_dst\fP original IP header destination address .br\fIpayload\fP optional payload or NULL .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

⌨️ 快捷键说明

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