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

📄 libnet-functions.h

📁 Libnet is a generic networking API that provides access to several protocols. It is not designed as
💻 H
📖 第 1 页 / 共 4 页
字号:
libnet_build_token(
    u_char *,           /* pointer to a 6 byte ethernet address */
    u_char *,           /* pointer to a 6 byte ethernet address */
    u_short,            /* type */
    u_char *,           /* payload (or NULL) */
    u_long,             /* payload length */
    libnet_t *,         /* libnet context pointer */
    libnet_ptag_t       /* packet id */
    );


/*
 *  libnet_autobuild_token (function suggested by Roberto Larcher)
 *
 *  Function builds a Token Ring header, automating the process.
 */
libnet_ptag_t           /* packet id on success, -1 on failure */
libnet_autobuild_token(
    u_char *,           /* pointer to a 6 byte ethernet address */
    u_short,            /* packet type */
    libnet_t *          /* libnet context pointer */
    );

/*
 *  libnet_build_link (function suggested by Roberto Larcher)
 *
 *  Function builds an link-layer header.
 */
libnet_ptag_t           /* packet id on success, -1 on failure */
libnet_build_link(
    u_char *,           /* pointer to a 6 byte ethernet address */
    u_char *,           /* pointer to a 6 byte ethernet address */
    u_short,            /* type */
    u_char *,           /* payload (or NULL) */
    u_long,             /* payload length */
    libnet_t *,         /* libnet context pointer */
    libnet_ptag_t       /* packet id */
    );

/*
 *  libnet_autobuild_link  (function suggested by Roberto Larcher)
 *
 *  Function builds link-layer header, automating the process.
 */
libnet_ptag_t           /* packet id on success, -1 on failure */
libnet_autobuild_link(
    u_char *,           /* pointer to a 6 byte ethernet address */
    u_short,            /* packet 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_short,            /* hardware address type */
    u_short,            /* protocol address type */
    u_char,             /* hardware address length */
    u_char,             /* protocol address length */
    u_short,            /* ARP operation type */
    u_char *,           /* sender hardware address */
    u_char *,           /* sender protocol address */
    u_char *,           /* target hardware address */
    u_char *,           /* target protocol address */
    u_char *,           /* payload or NULL if none */
    u_long,             /* 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_short,            /* Source port */
    u_short,            /* Destination port */
    u_long,             /* Sequence Number */
    u_long,             /* Acknowledgement Number */
    u_char,             /* Control bits */
    u_short,            /* Advertised Window Size */
    u_short,            /* Checksum */
    u_short,            /* Urgent Pointer */
    u_short,            /* length of payload if a protocol header - not data */
    u_char *,           /* Pointer to packet data (or NULL) */
    u_long,             /* 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_char *,           /* options list */
    u_long,             /* 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_short,            /* source port */
    u_short,            /* destination port */
    u_short,            /* total length (header + data) */
    u_short,            /* checksum */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_char,             /* version */
    u_char,             /* ttl */
    u_short,            /* sum */
    u_short,            /* type */
    u_short,            /* len */
    u_char *,           /* value */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_char,             /* type */
    u_char,             /* code */
    u_short,            /* checksum */
    u_short,            /* id */
    u_short,            /* sequence number */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_char,             /* type */
    u_char,             /* code */
    u_short,            /* checksum */
    u_short,            /* id */
    u_short,            /* sequence number */
    u_long,             /* address mask */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_char,             /* type */
    u_char,             /* code */
    u_short,            /* checksum */
    u_short,            /* original Length of packet data */
    u_char,             /* original IP tos */
    u_short,            /* original IP ID */
    u_short,            /* original Fragmentation flags and offset */
    u_char,             /* original TTL */
    u_char,             /* original Protocol */
    u_short,            /* original checksum */
    u_long,             /* original Source IP Address */
    u_long,             /* original Destination IP Address */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_char,             /* type */
    u_char,             /* code */
    u_short,            /* checksum */
    u_long,             /* gateway host that should be used */
    u_short,            /* original length of packet data */
    u_char,             /* original IP tos */
    u_short,            /* original IP ID */
    u_short,            /* original fragmentation flags and offset */
    u_char,             /* original TTL */
    u_char,             /* original protocol */
    u_short,            /* original checksum */
    u_long,             /* original source IP address */
    u_long,             /* original destination IP address */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_char,             /* type */
    u_char,             /* code */
    u_short,            /* checksum */
    u_short,            /* original Length of packet data */
    u_char,             /* original IP tos */
    u_short,            /* original IP ID */
    u_short,            /* original Fragmentation flags and offset */
    u_char,             /* original TTL */
    u_char,             /* original Protocol */
    u_short,            /* original checksum */
    u_long,             /* original Source IP Address */
    u_long,             /* original Destination IP Address */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_char,             /* type */
    u_char,             /* code */
    u_short,            /* checksum */
    u_short,            /* id */
    u_short,            /* sequence number */
    n_time,             /* original timestamp */
    n_time,             /* receive timestamp */
    n_time,             /* transmit timestamp */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_char,             /* type */
    u_char,             /* code */
    u_short,            /* checksum */
    u_long,             /* ip address */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_short,            /* entire packet length */
    u_char,             /* tos */
    u_short,            /* ID */
    u_short,            /* fragmentation flags and offset */
    u_char,             /* TTL */
    u_char,             /* protocol */
    u_short,            /* checksum */
    u_long,             /* source address */
    u_long,             /* destination address */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_char *,           /* options list */
    u_long,             /* 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_short,            /* entire packet length */
    u_char,             /* protocol */
    u_long,             /* dst */
    libnet_t *          /* libnet context pointer */
    );



 /*
 *  libnet_build_ipv6
 *  
 *  Function builds an IPv6 header.
 */ 
libnet_ptag_t
libnet_build_ipv6(
    u_char,             /* traffic control */
    u_long,             /* flow label */
    u_short,            /* length */
    u_char,             /* next header */
    u_char,             /* hop limit */
    struct libnet_in6_addr,/* src */
    struct libnet_in6_addr,/* dst */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* 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_t
libnet_autobuild_ipv6(
    u_short,            /* length */
    u_char,             /* next header */
    struct libnet_in6_addr,/* dst */
    libnet_t *          /* libnet context pointer */
    );


/*
 *  libnet_build_isl
 *
 *  Function builds a Cisco ISL header.
 */
libnet_ptag_t
libnet_build_isl(
    u_char *,
    u_char,
    u_char,
    u_char *,
    u_short,
    u_char *,
    u_short,
    u_short,
    u_short,
    u_char *,
    u_long,
    libnet_t *,
    libnet_ptag_t
    );

/*
 *  libnet_build_ipsec_esp_hdr
 *
 *  Function builds an IPsec ESP header.
 */
libnet_ptag_t           /* packet id on success, -1 on failure */
libnet_build_ipsec_esp_hdr(
    u_long,             /* security parameter index */
    u_long,             /* ESP sequence number */
    u_long,             /* initialization vector */
    u_char *,           /* pointer to packet data (or NULL) */
    u_long,             /* payload length */
    libnet_t *,         /* libnet context pointer */
    libnet_ptag_t       /* packet id */
    );


/*
 *  libnet_build_ipsec_esp_ftr
 *
 *  Function builds an IPsec ESP footer.
 */

⌨️ 快捷键说明

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