📄 libnet-functions.h
字号:
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ipsec_esp_ftr(
u_char, /* padding length */
u_char, /* next header pointer */
char *, /* authentication 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_ipsec_ah
*
* Function builds an IPsec AH header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ipsec_ah(
u_char, /* next header */
u_char, /* payload length */
u_short, /* reserved */
u_long, /* security parameter index */
u_long, /* AH sequence number */
u_long, /* authentication 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_dns
*
* Function builds a DNSv4 header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_dnsv4(
u_short, /* ID */
u_short, /* flags */
u_short, /* number of questions */
u_short, /* number of answer resource records */
u_short, /* number of authority resource records */
u_short, /* number of additional resource records */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_rip
*
* Function builds a RIP header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_rip(
u_char, /* command */
u_char, /* version */
u_short, /* zero (v1) or routing domain (v2) */
u_short, /* address family */
u_short, /* zero (v1) or route tag (v2) */
u_long, /* IP address */
u_long, /* zero (v1) or subnet mask (v2) */
u_long, /* zero (v1) or next hop IP address (v2) */
u_long, /* metric */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_stp_conf
*
* Function builds an STP conf header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_stp_conf(
u_short, /* protocol id */
u_char, /* protocol version */
u_char, /* bridge protocol data unit type */
u_char, /* control flags */
u_char *, /* root id */
u_long, /* root path cost */
u_char *, /* bridge id */
u_short, /* port id */
u_short, /* message age */
u_short, /* max age */
u_short, /* hello time */
u_short, /* forward delay */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_stp_tcn
*
* Function builds an STP tcn header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_stp_tcn(
u_short, /* protocol id */
u_char, /* protocol version */
u_char, /* bridge protocol data unit type */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_vrrp
*
* Function builds a VRRP header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_vrrp(
u_char, /* version */
u_char, /* packet type */
u_char, /* virtual router id */
u_char, /* priority */
u_char, /* number of IP addresses */
u_char, /* auth type */
u_char, /* advertisement interval */
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_ntp
*
* Function builds an NTP header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ntp(
u_char, /* leap indicator */
u_char, /* version */
u_char, /* mode */
u_char, /* stratum */
u_char, /* polling interval */
u_char, /* precision */
u_short, /* root delay integer */
u_short, /* root delay fraction */
u_short, /* root dispersion integer */
u_short, /* root dispersion fraction */
u_long, /* reference ID */
u_long, /* reference timestamp integer */
u_long, /* reference timestamp fraction */
u_long, /* originate timestamp integer */
u_long, /* originate timestamp fraction */
u_long, /* receive timestamp integer */
u_long, /* receive timestamp fraction */
u_long, /* transmit timestamp integer */
u_long, /* transmit timestamp fraction */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_ospfv2
*
* Function builds a V2 OSPF header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ospfv2(
u_short, /* length of entire OSPF packet */
u_char, /* type */
u_long, /* router id */
u_long, /* area id */
u_short, /* checksum */
u_short, /* auth type */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_ospf_hellov2
*
* Function builds an OSPF hello header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ospfv2_hello(
u_long, /* netmask */
u_short, /* interval (seconds since last packet sent) */
u_char, /* options */
u_char, /* priority */
u_int, /* time til router is deemed down */
u_long, /* network's designated router */
u_long, /* network's backup router */
u_long, /* neighbor */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_ospfv2_dbd
*
* Function builds an OSPF dbd header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ospfv2_dbd(
u_short, /* MTU of interface */
u_char, /* options */
u_char, /* type of exchange */
u_int, /* DBD 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_ospfv2_lsr
*
* Function builds an OSPF lsr header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ospfv2_lsr(
u_int, /* type link state being requested */
u_int, /* link state ID */
u_long, /* advertising router */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_ospfv2_lsu
*
* Function builds an OSPF lsu header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ospfv2_lsu(
u_int, /* number of LSU's that will be broadcasted */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_ospfv2_lsa
*
* Function builds an OSPF lsa header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ospfv2_lsa(
u_short, /* age */
u_char, /* options */
u_char, /* type */
u_int, /* link state id */
u_long, /* advertisting router */
u_int, /* sequence number */
u_short, /* checksum */
u_short, /* packet length */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_ospfv2_lsa_rtr
*
* Function builds an OSPF lsa rtr header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ospfv2_lsa_rtr(
u_short, /* flags */
u_short, /* number */
u_int, /* id */
u_int, /* data */
u_char, /* type */
u_char, /* type of service */
u_short, /* metric */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_ospfv2_lsa_net
*
* Function builds an OSPF lsa net header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ospfv2_lsa_net(
u_long, /* netmask */
u_int, /* router id */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_ospfv2_lsa_sum
*
* Function builds an OSPF lsa sum header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ospfv2_lsa_sum(
u_long, /* netmask */
u_int, /* metric */
u_int, /* type of service */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_ospfv2_lsa_as
*
* Function builds an OSPF lsa as header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_ospfv2_lsa_as(
u_long, /* netmask */
u_int, /* metric */
u_long, /* forward address */
u_int, /* tag */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_data
*
* Function builds a generic data unit.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_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_dhcpv4
*
* Function builds a DHCPv4 header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_dhcpv4(
u_char, /* opcode */
u_char, /* hardware address type */
u_char, /* hardware address length */
u_char, /* hopcount */
u_long, /* transaction ID */
u_short, /* number of seconds since trying to bootstrap */
u_short, /* unused */
u_long, /* client's IP */
u_long, /* your IP */
u_long, /* server's IP */
u_long, /* gateway IP */
u_char *, /* client hardware address */
u_char *, /* server host name */
u_char *, /* boot file name */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_build_bootpv4
*
* Function builds a BOOTPv4 header.
*/
libnet_ptag_t /* packet id on success, -1 on failure */
libnet_build_bootpv4(
u_char, /* opcode */
u_char, /* hardware address type */
u_char, /* hardware address length */
u_char, /* hopcount */
u_long, /* transaction ID */
u_short, /* number of seconds since trying to bootstrap */
u_short, /* flags */
u_long, /* client's IP */
u_long, /* your IP */
u_long, /* server's IP */
u_long, /* gateway IP */
u_char *, /* client hardware address */
u_char *, /* server host name */
u_char *, /* boot file name */
u_char *, /* pointer to packet data (or NULL) */
u_long, /* payload length */
libnet_t *, /* libnet context pointer */
libnet_ptag_t /* packet id */
);
/*
* libnet_write
*
* Function writes a packet to the wire. Libnet will know which injection
* method to use, as well as if the user wants checksums to be calculated.
* Planned functionality for multiple packets will allow for tunable sleep
* times between packet writes.
*/
int /* number of bytes written if successful, -1 on error */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -