📄 libnet-functions.h
字号:
u_int8_t *, /* pointer to a 6 byte ethernet address */ u_int16_t, /* type */ u_int8_t *, /* payload (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_autobuild_ethernet * * Function builds an Ethernet header, automating the process. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_autobuild_ethernet( u_int8_t *, /* pointer to a 6 byte ethernet address */ u_int16_t, /* packet type */ libnet_t * /* libnet context pointer */ );/* * libnet_build_fddi * * Function builds an FDDI header. */libnet_ptag_tlibnet_build_fddi( u_int8_t, /* Frame Control */ u_int8_t *, /* 6 byte FDDI address */ u_int8_t *, /* 6 byte FDDI address */ u_int8_t, /* DSAP */ u_int8_t, /* SSAP */ u_int8_t, /* Control Field */ u_int8_t *, /* 3 byte Organization Code */ u_int16_t, /* Protocol Type */ u_int8_t *, /* Payload or NULL */ u_int32_t, /* Payload length */ libnet_t *, /* Libnet Context Pointer */ libnet_ptag_t /* Packet ID */ );/* * libnet_autobuild_fddi * * Function builds an FDDI header, automating the process. */libnet_ptag_tlibnet_autobuild_fddi( u_int8_t, /* Frame Control */ u_int8_t *, /* 6 byte FDDI address */ u_int8_t, /* DSAP */ u_int8_t, /* SSAP */ u_int8_t, /* Control Field */ u_int8_t *, /* 3 byte Organization Code */ u_int16_t, /* Protocol Type */ libnet_t * /* Libnet Context Pointer */ );/* * libnet_build_arp * * Function builds an ARP header. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_arp( u_int16_t, /* hardware address type */ u_int16_t, /* protocol address type */ u_int8_t, /* hardware address length */ u_int8_t, /* protocol address length */ u_int16_t, /* ARP operation type */ u_int8_t *, /* sender hardware address */ u_int8_t *, /* sender protocol address */ u_int8_t *, /* target hardware address */ u_int8_t *, /* target protocol address */ u_int8_t *, /* payload or NULL if none */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_tcp * * Function builds a TCP header. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_tcp( u_int16_t, /* Source port */ u_int16_t, /* Destination port */ u_int32_t, /* Sequence Number */ u_int32_t, /* Acknowledgement Number */ u_int8_t, /* Control bits */ u_int16_t, /* Advertised Window Size */ u_int16_t, /* Checksum */ u_int16_t, /* Urgent Pointer */ u_int16_t, /* length of payload if a protocol header - not data */ u_int8_t *, /* Pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_tcp_options * * Function builds TCP options list. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_tcp_options( u_int8_t *, /* options list */ u_int32_t, /* options list size */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_udp * * Function builds a UDP header. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_udp( u_int16_t, /* source port */ u_int16_t, /* destination port */ u_int16_t, /* total length (header + data) */ u_int16_t, /* checksum */ u_int8_t *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_cdp * * Function builds a CDP header. */libnet_ptag_t /* packet id on success, -1 on failure */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 *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_icmp4_echo * * Function builds an ICMP echo header. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_icmpv4_echo( u_int8_t, /* type */ u_int8_t, /* code */ u_int16_t, /* checksum */ u_int16_t, /* id */ u_int16_t, /* sequence number */ u_int8_t *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_icmp4_mask * * Function builds an ICMP netmask header. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_icmpv4_mask( u_int8_t, /* type */ u_int8_t, /* code */ u_int16_t, /* checksum */ u_int16_t, /* id */ u_int16_t, /* sequence number */ u_int32_t, /* address mask */ u_int8_t *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_icmp4_unreach * * Function builds an ICMP unreachable header (with corresponding IP header). */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_icmpv4_unreach( u_int8_t, /* type */ u_int8_t, /* code */ u_int16_t, /* checksum */ u_int16_t, /* original Length of packet data */ u_int8_t, /* original IP tos */ u_int16_t, /* original IP ID */ u_int16_t, /* original Fragmentation flags and offset */ u_int8_t, /* original TTL */ u_int8_t, /* original Protocol */ u_int16_t, /* original checksum */ u_int32_t, /* original Source IP Address */ u_int32_t, /* original Destination IP Address */ u_int8_t *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_icmp4_redirect * * Function builds an ICMP redirect header (with corresponding IP header). */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_icmpv4_redirect( u_int8_t, /* type */ u_int8_t, /* code */ u_int16_t, /* checksum */ u_int32_t, /* gateway host that should be used */ u_int16_t, /* original length of packet data */ u_int8_t, /* original IP tos */ u_int16_t, /* original IP ID */ u_int16_t, /* original fragmentation flags and offset */ u_int8_t, /* original TTL */ u_int8_t, /* original protocol */ u_int16_t, /* original checksum */ u_int32_t, /* original source IP address */ u_int32_t, /* original destination IP address */ u_int8_t *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_icmp4_timeexceed * * Function builds an ICMP time exceeded header. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_icmpv4_timeexceed( u_int8_t, /* type */ u_int8_t, /* code */ u_int16_t, /* checksum */ u_int16_t, /* original Length of packet data */ u_int8_t, /* original IP tos */ u_int16_t, /* original IP ID */ u_int16_t, /* original Fragmentation flags and offset */ u_int8_t, /* original TTL */ u_int8_t, /* original Protocol */ u_int16_t, /* original checksum */ u_int32_t, /* original Source IP Address */ u_int32_t, /* original Destination IP Address */ u_int8_t *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_icmp4_timestamp * * Function builds an ICMP timestamp header. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_icmpv4_timestamp( u_int8_t, /* type */ u_int8_t, /* code */ u_int16_t, /* checksum */ u_int16_t, /* id */ u_int16_t, /* sequence number */ n_time, /* original timestamp */ n_time, /* receive timestamp */ n_time, /* transmit timestamp */ u_int8_t *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_igmp * * Function builds an IGMP header. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_igmp( u_int8_t, /* type */ u_int8_t, /* code */ u_int16_t, /* checksum */ u_int32_t, /* ip address */ u_int8_t *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_ipv4 * * Function builds an IPv4 header. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_ipv4( u_int16_t, /* entire packet length */ u_int8_t, /* tos */ u_int16_t, /* ID */ u_int16_t, /* fragmentation flags and offset */ u_int8_t, /* TTL */ u_int8_t, /* protocol */ u_int16_t, /* checksum */ u_int32_t, /* source address */ u_int32_t, /* destination address */ u_int8_t *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_build_ipv4_options * * Function builds IPv4 options list. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_build_ipv4_options( u_int8_t *, /* options list */ u_int32_t, /* options list size */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_autobuild_ipv4 * * Function builds an IPv4 header, automating much of the process. */libnet_ptag_t /* packet id on success, -1 on failure */libnet_autobuild_ipv4( u_int16_t, /* entire packet length */ u_int8_t, /* protocol */ u_int32_t, /* dst */ libnet_t * /* libnet context pointer */ ); /* * libnet_build_ipv6 * * Function builds an IPv6 header. */ libnet_ptag_tlibnet_build_ipv6( u_int8_t, /* traffic control */ u_int32_t, /* flow label */ u_int16_t, /* length */ u_int8_t, /* next header */ u_int8_t, /* hop limit */ struct libnet_in6_addr,/* src */ struct libnet_in6_addr,/* dst */ u_int8_t *, /* pointer to packet data (or NULL) */ u_int32_t, /* payload length */ libnet_t *, /* libnet context pointer */ libnet_ptag_t /* packet id */ );/* * libnet_autobuild_ipv6 * * Function builds an IPv6 header, automating much of the process. */libnet_ptag_tlibnet_autobuild_ipv6( u_int16_t, /* length */ u_int8_t, /* next header */ struct libnet_in6_addr,/* dst */ libnet_t * /* libnet context pointer */ );/* * libnet_build_isl * * Function builds a Cisco ISL header. */libnet_ptag_tlibnet_build_isl(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -