📄 libnet-functions.h.3
字号:
.PP\fBReturns:\fP.RS 4protocol tag value on success, -1 on error .RE.PP.SS "libnet_ptag_t libnet_build_icmpv4_timestamp (u_int8_t type, u_int8_t code, u_int16_t sum, u_int16_t id, u_int16_t seq, n_time otime, n_time rtime, n_time ttime, 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) timestamp request/reply header. .PP\fBParameters:\fP.RS 4\fItype\fP type of ICMP packet (should be ICMP_TSTAMP or ICMP_TSTAMPREPLY) .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 sequence number .br\fIotime\fP originate timestamp .br\fIrtime\fP receive timestamp .br\fIttime\fP transmit timestamp .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_unreach (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) unreachable 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 unreachable message in the first place). .PP\fBParameters:\fP.RS 4\fItype\fP type of ICMP packet (should be ICMP_UNREACH) .br\fIcode\fP code of ICMP packet (should be one of the 16 unreachable 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_igmp (u_int8_t type, u_int8_t code, u_int16_t sum, u_int32_t ip, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an RFC 1112 Internet Group Memebership Protocol (IGMP) header. .PP\fBParameters:\fP.RS 4\fItype\fP packet type .br\fIcode\fP packet code (should be 0) .br\fIsum\fP checksum (0 for libnet to autofill) .br\fIip\fP IPv4 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_ipsec_ah (u_int8_t nh, u_int8_t len, u_int16_t res, u_int32_t spi, u_int32_t seq, u_int32_t auth, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an Internet Protocol Security Authentication header. .PP\fBParameters:\fP.RS 4\fInh\fP next header .br\fIlen\fP payload length .br\fIres\fP reserved .br\fIspi\fP security parameter index .br\fIseq\fP sequence number .br\fIauth\fP authentication data .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_ipsec_esp_ftr (u_int8_t len, u_int8_t nh, int8_t * auth, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an Internet Protocol Security Encapsulating Security Payload footer. .PP\fBParameters:\fP.RS 4\fIlen\fP padding length .br\fInh\fP next header .br\fIauth\fP authentication data .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_ipsec_esp_hdr (u_int32_t spi, u_int32_t seq, u_int32_t iv, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an Internet Protocol Security Encapsulating Security Payload header. .PP\fBParameters:\fP.RS 4\fIspi\fP security parameter index .br\fIseq\fP ESP sequence number .br\fIiv\fP initialization vector .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_ipv4 (u_int16_t len, u_int8_t tos, u_int16_t id, u_int16_t frag, u_int8_t ttl, u_int8_t prot, u_int16_t sum, u_int32_t src, u_int32_t dst, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds a version 4 RFC 791 Internet Protocol (IP) header. .PP\fBParameters:\fP.RS 4\fIlen\fP total length of the IP packet including all subsequent data .br\fItos\fP type of service bits .br\fIid\fP IP identification number .br\fIfrag\fP fragmentation bits and offset .br\fIttl\fP time to live in the network .br\fIprot\fP upper layer protocol .br\fIsum\fP checksum (0 for libnet to autofill) .br\fIsrc\fP source IPv4 address (little endian) .br\fIdst\fP destination IPv4 address (little endian) .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_ipv4_options (u_int8_t * options, u_int32_t options_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds an version 4 Internet Protocol (IP) options header. The function expects options to be a valid IP options string of size options_s, no larger than 40 bytes (the maximum size of an options string). The function checks to make sure that the preceding header is an IPv4 header and that the options string would not result in a packet larger than 65,535 bytes (IPMAXPACKET). The function counts up the number of 32-bit words in the options string and adjusts the IP header length value as necessary. .PP\fBParameters:\fP.RS 4\fIoptions\fP byte string of IP options .br\fIoptions_s\fP length of options string .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_ipv6 (u_int8_t tc, u_int32_t fl, u_int16_t len, u_int8_t nh, u_int8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds a version 6 RFC 2460 Internet Protocol (IP) header. .PP\fBParameters:\fP.RS 4\fItc\fP traffic class .br\fIfl\fP flow label .br\fIlen\fP total length of the IP packet .br\fInh\fP next header .br\fIhl\fP hop limit .br\fIsrc\fP source IPv6 address .br\fIdst\fP destination IPv6 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_ipv6_destopts (u_int8_t nh, u_int8_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds a version 6 RFC 2460 Internet Protocol (IP) destination options header. This function is special in that it uses the payload interface to include the options data. The application programmer will build an IPv6 options byte string and pass it to the function using the payload interface. .PP\fBParameters:\fP.RS 4\fInh\fP next header .br\fIlen\fP length of the header in 8-byte octets not including the first 8 octets .br\fIpayload\fP options payload .br\fIpayload_s\fP payload length .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_ipv6_frag (u_int8_t nh, u_int8_t reserved, u_int16_t frag, u_int32_t id, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds a version 6 RFC 2460 Internet Protocol (IP) fragmentation header. .PP\fBParameters:\fP.RS 4\fInh\fP next header .br\fIreserved\fP unused value... OR IS IT! .br\fIfrag\fP fragmentation bits (ala ipv4) .br\fIid\fP packet identification .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_ipv6_hbhopts (u_int8_t nh, u_int8_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)".PPBuilds a version 6 RFC 2460 Internet Protocol (IP) hop by hop options header. This function is special in that it uses the payload interface to include the options data. The application programmer will build an IPv6 hop by hop options byte string and pass it to the function using the payload interface. .PP\fBParameters:\fP.RS 4\fInh\fP next header .br\
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -