Annotation of embedaddon/libnet/doc/man/man3/libnet-functions.h.3, revision 1.1.1.1

1.1       misho       1: .TH "libnet-functions.h" 3 "10 Mar 2004" "libnet" \" -*- nroff -*-
                      2: .ad l
                      3: .nh
                      4: .SH NAME
                      5: libnet-functions.h \- libnet exported function prototypes  
                      6: 
                      7: .SH SYNOPSIS
                      8: .br
                      9: .PP
                     10: .SS "Functions"
                     11: 
                     12: .in +1c
                     13: .ti -1c
                     14: .RI "libnet_t * \fBlibnet_init\fP (int injection_type, char *device, char *err_buf)"
                     15: .br
                     16: .ti -1c
                     17: .RI "void \fBlibnet_destroy\fP (libnet_t *l)"
                     18: .br
                     19: .ti -1c
                     20: .RI "void \fBlibnet_clear_packet\fP (libnet_t *l)"
                     21: .br
                     22: .ti -1c
                     23: .RI "void \fBlibnet_stats\fP (libnet_t *l, struct libnet_stats *ls)"
                     24: .br
                     25: .ti -1c
                     26: .RI "int \fBlibnet_getfd\fP (libnet_t *l)"
                     27: .br
                     28: .ti -1c
                     29: .RI "int8_t * \fBlibnet_getdevice\fP (libnet_t *l)"
                     30: .br
                     31: .ti -1c
                     32: .RI "u_int8_t * \fBlibnet_getpbuf\fP (libnet_t *l, libnet_ptag_t ptag)"
                     33: .br
                     34: .ti -1c
                     35: .RI "u_int32_t \fBlibnet_getpbuf_size\fP (libnet_t *l, libnet_ptag_t ptag)"
                     36: .br
                     37: .ti -1c
                     38: .RI "char * \fBlibnet_geterror\fP (libnet_t *l)"
                     39: .br
                     40: .ti -1c
                     41: .RI "u_int32_t \fBlibnet_getpacket_size\fP (libnet_t *l)"
                     42: .br
                     43: .ti -1c
                     44: .RI "int \fBlibnet_seed_prand\fP (libnet_t *l)"
                     45: .br
                     46: .ti -1c
                     47: .RI "u_int32_t \fBlibnet_get_prand\fP (int mod)"
                     48: .br
                     49: .ti -1c
                     50: .RI "int \fBlibnet_toggle_checksum\fP (libnet_t *l, libnet_ptag_t ptag, int mode)"
                     51: .br
                     52: .ti -1c
                     53: .RI "char * \fBlibnet_addr2name4\fP (u_int32_t in, u_int8_t use_name)"
                     54: .br
                     55: .ti -1c
                     56: .RI "u_int32_t \fBlibnet_name2addr4\fP (libnet_t *l, char *host_name, u_int8_t use_name)"
                     57: .br
                     58: .ti -1c
                     59: .RI "libnet_in6_addr \fBlibnet_name2addr6\fP (libnet_t *l, char *host_name, u_int8_t use_name)"
                     60: .br
                     61: .ti -1c
                     62: .RI "void \fBlibnet_addr2name6_r\fP (struct libnet_in6_addr addr, u_int8_t use_name, char *host_name, int host_name_len)"
                     63: .br
                     64: .ti -1c
                     65: .RI "int \fBlibnet_plist_chain_new\fP (libnet_t *l, libnet_plist_t **plist, char *token_list)"
                     66: .br
                     67: .ti -1c
                     68: .RI "int \fBlibnet_plist_chain_next_pair\fP (libnet_plist_t *plist, u_int16_t *bport, u_int16_t *eport)"
                     69: .br
                     70: .ti -1c
                     71: .RI "int \fBlibnet_plist_chain_dump\fP (libnet_plist_t *plist)"
                     72: .br
                     73: .ti -1c
                     74: .RI "char * \fBlibnet_plist_chain_dump_string\fP (libnet_plist_t *plist)"
                     75: .br
                     76: .ti -1c
                     77: .RI "int \fBlibnet_plist_chain_free\fP (libnet_plist_t *plist)"
                     78: .br
                     79: .ti -1c
                     80: .RI "libnet_ptag_t \fBlibnet_build_802_1q\fP (u_int8_t *dst, u_int8_t *src, u_int16_t tpi, u_int8_t priority, u_int8_t cfi, u_int16_t vlan_id, u_int16_t len_proto, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                     81: .br
                     82: .ti -1c
                     83: .RI "libnet_ptag_t \fBlibnet_build_802_1x\fP (u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                     84: .br
                     85: .ti -1c
                     86: .RI "libnet_ptag_t \fBlibnet_build_802_2\fP (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                     87: .br
                     88: .ti -1c
                     89: .RI "libnet_ptag_t \fBlibnet_build_802_2snap\fP (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t *oui, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                     90: .br
                     91: .ti -1c
                     92: .RI "libnet_ptag_t \fBlibnet_build_802_3\fP (u_int8_t *dst, u_int8_t *src, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                     93: .br
                     94: .ti -1c
                     95: .RI "libnet_ptag_t \fBlibnet_build_ethernet\fP (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)"
                     96: .br
                     97: .ti -1c
                     98: .RI "libnet_ptag_t \fBlibnet_autobuild_ethernet\fP (u_int8_t *dst, u_int16_t type, libnet_t *l)"
                     99: .br
                    100: .ti -1c
                    101: .RI "libnet_ptag_t \fBlibnet_build_fddi\fP (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)"
                    102: .br
                    103: .ti -1c
                    104: .RI "libnet_ptag_t \fBlibnet_autobuild_fddi\fP (u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, libnet_t *l)"
                    105: .br
                    106: .ti -1c
                    107: .RI "libnet_ptag_t \fBlibnet_build_arp\fP (u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln, u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    108: .br
                    109: .ti -1c
                    110: .RI "libnet_ptag_t \fBlibnet_autobuild_arp\fP (u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa, libnet_t *l)"
                    111: .br
                    112: .ti -1c
                    113: .RI "libnet_ptag_t \fBlibnet_build_tcp\fP (u_int16_t sp, u_int16_t dp, u_int32_t seq, u_int32_t ack, u_int8_t control, u_int16_t win, u_int16_t sum, u_int16_t urg, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    114: .br
                    115: .ti -1c
                    116: .RI "libnet_ptag_t \fBlibnet_build_tcp_options\fP (u_int8_t *options, u_int32_t options_s, libnet_t *l, libnet_ptag_t ptag)"
                    117: .br
                    118: .ti -1c
                    119: .RI "libnet_ptag_t \fBlibnet_build_udp\fP (u_int16_t sp, u_int16_t dp, u_int16_t len, u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    120: .br
                    121: .ti -1c
                    122: .RI "libnet_ptag_t \fBlibnet_build_cdp\fP (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 *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    123: .br
                    124: .ti -1c
                    125: .RI "libnet_ptag_t \fBlibnet_build_icmpv4_echo\fP (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)"
                    126: .br
                    127: .ti -1c
                    128: .RI "libnet_ptag_t \fBlibnet_build_icmpv4_mask\fP (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)"
                    129: .br
                    130: .ti -1c
                    131: .RI "libnet_ptag_t \fBlibnet_build_icmpv4_unreach\fP (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)"
                    132: .br
                    133: .ti -1c
                    134: .RI "libnet_ptag_t \fBlibnet_build_icmpv4_redirect\fP (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)"
                    135: .br
                    136: .ti -1c
                    137: .RI "libnet_ptag_t \fBlibnet_build_icmpv4_timeexceed\fP (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)"
                    138: .br
                    139: .ti -1c
                    140: .RI "libnet_ptag_t \fBlibnet_build_icmpv4_timestamp\fP (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)"
                    141: .br
                    142: .ti -1c
                    143: .RI "libnet_ptag_t \fBlibnet_build_igmp\fP (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)"
                    144: .br
                    145: .ti -1c
                    146: .RI "libnet_ptag_t \fBlibnet_build_ipv4\fP (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)"
                    147: .br
                    148: .ti -1c
                    149: .RI "libnet_ptag_t \fBlibnet_build_ipv4_options\fP (u_int8_t *options, u_int32_t options_s, libnet_t *l, libnet_ptag_t ptag)"
                    150: .br
                    151: .ti -1c
                    152: .RI "libnet_ptag_t \fBlibnet_autobuild_ipv4\fP (u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t *l)"
                    153: .br
                    154: .ti -1c
                    155: .RI "libnet_ptag_t \fBlibnet_build_ipv6\fP (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)"
                    156: .br
                    157: .ti -1c
                    158: .RI "libnet_ptag_t \fBlibnet_build_ipv6_frag\fP (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)"
                    159: .br
                    160: .ti -1c
                    161: .RI "libnet_ptag_t \fBlibnet_build_ipv6_routing\fP (u_int8_t nh, u_int8_t len, u_int8_t rtype, u_int8_t segments, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    162: .br
                    163: .ti -1c
                    164: .RI "libnet_ptag_t \fBlibnet_build_ipv6_destopts\fP (u_int8_t nh, u_int8_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    165: .br
                    166: .ti -1c
                    167: .RI "libnet_ptag_t \fBlibnet_build_ipv6_hbhopts\fP (u_int8_t nh, u_int8_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    168: .br
                    169: .ti -1c
                    170: .RI "libnet_ptag_t \fBlibnet_autobuild_ipv6\fP (u_int16_t len, u_int8_t nh, struct libnet_in6_addr dst, libnet_t *l)"
                    171: .br
                    172: .ti -1c
                    173: .RI "libnet_ptag_t \fBlibnet_build_isl\fP (u_int8_t *dhost, u_int8_t type, u_int8_t user, u_int8_t *shost, u_int16_t len, u_int8_t *snap, u_int16_t vid, u_int16_t index, u_int16_t reserved, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    174: .br
                    175: .ti -1c
                    176: .RI "libnet_ptag_t \fBlibnet_build_ipsec_esp_hdr\fP (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)"
                    177: .br
                    178: .ti -1c
                    179: .RI "libnet_ptag_t \fBlibnet_build_ipsec_esp_ftr\fP (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)"
                    180: .br
                    181: .ti -1c
                    182: .RI "libnet_ptag_t \fBlibnet_build_ipsec_ah\fP (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)"
                    183: .br
                    184: .ti -1c
                    185: .RI "libnet_ptag_t \fBlibnet_build_dnsv4\fP (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)"
                    186: .br
                    187: .ti -1c
                    188: .RI "libnet_ptag_t \fBlibnet_build_rip\fP (u_int8_t cmd, u_int8_t version, u_int16_t rd, u_int16_t af, u_int16_t rt, u_int32_t addr, u_int32_t mask, u_int32_t next_hop, u_int32_t metric, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    189: .br
                    190: .ti -1c
                    191: .RI "libnet_ptag_t \fBlibnet_build_rpc_call\fP (u_int32_t rm, u_int32_t xid, u_int32_t prog_num, u_int32_t prog_vers, u_int32_t procedure, u_int32_t cflavor, u_int32_t clength, u_int8_t *cdata, u_int32_t vflavor, u_int32_t vlength, u_int8_t *vdata, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    192: .br
                    193: .ti -1c
                    194: .RI "libnet_ptag_t \fBlibnet_build_stp_conf\fP (u_int16_t id, u_int8_t version, u_int8_t bpdu_type, u_int8_t flags, u_int8_t *root_id, u_int32_t root_pc, u_int8_t *bridge_id, u_int16_t port_id, u_int16_t message_age, u_int16_t max_age, u_int16_t hello_time, u_int16_t f_delay, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    195: .br
                    196: .ti -1c
                    197: .RI "libnet_ptag_t \fBlibnet_build_stp_tcn\fP (u_int16_t id, u_int8_t version, u_int8_t bpdu_type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    198: .br
                    199: .ti -1c
                    200: .RI "libnet_ptag_t \fBlibnet_build_token_ring\fP (u_int8_t ac, 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)"
                    201: .br
                    202: .ti -1c
                    203: .RI "libnet_ptag_t \fBlibnet_autobuild_token_ring\fP (u_int8_t ac, u_int8_t fc, u_int8_t *dst, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t *org, u_int16_t type, libnet_t *l)"
                    204: .br
                    205: .ti -1c
                    206: .RI "libnet_ptag_t \fBlibnet_build_vrrp\fP (u_int8_t version, u_int8_t type, u_int8_t vrouter_id, u_int8_t priority, u_int8_t ip_count, u_int8_t auth_type, u_int8_t advert_int, u_int16_t sum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    207: .br
                    208: .ti -1c
                    209: .RI "libnet_ptag_t \fBlibnet_build_mpls\fP (u_int32_t label, u_int8_t experimental, u_int8_t bos, u_int8_t ttl, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    210: .br
                    211: .ti -1c
                    212: .RI "libnet_ptag_t \fBlibnet_build_ntp\fP (u_int8_t leap_indicator, u_int8_t version, u_int8_t mode, u_int8_t stratum, u_int8_t poll, u_int8_t precision, u_int16_t delay_int, u_int16_t delay_frac, u_int16_t dispersion_int, u_int16_t dispersion_frac, u_int32_t reference_id, u_int32_t ref_ts_int, u_int32_t ref_ts_frac, u_int32_t orig_ts_int, u_int32_t orig_ts_frac, u_int32_t rec_ts_int, u_int32_t rec_ts_frac, u_int32_t xmt_ts_int, u_int32_t xmt_ts_frac, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    213: .br
                    214: .ti -1c
                    215: .RI "libnet_ptag_t \fBlibnet_build_ospfv2\fP (u_int16_t len, u_int8_t type, u_int32_t rtr_id, u_int32_t area_id, u_int16_t sum, u_int16_t autype, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    216: .br
                    217: .ti -1c
                    218: .RI "libnet_ptag_t \fBlibnet_build_ospfv2_hello\fP (u_int32_t netmask, u_int16_t interval, u_int8_t opts, u_int8_t priority, u_int dead_int, u_int32_t des_rtr, u_int32_t bkup_rtr, u_int32_t neighbor, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    219: .br
                    220: .ti -1c
                    221: .RI "libnet_ptag_t \fBlibnet_build_ospfv2_dbd\fP (u_int16_t dgram_len, u_int8_t opts, u_int8_t type, u_int seqnum, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    222: .br
                    223: .ti -1c
                    224: .RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsr\fP (u_int type, u_int lsid, u_int32_t advrtr, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    225: .br
                    226: .ti -1c
                    227: .RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsu\fP (u_int num, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    228: .br
                    229: .ti -1c
                    230: .RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsa\fP (u_int16_t age, u_int8_t opts, u_int8_t type, u_int lsid, u_int32_t advrtr, u_int seqnum, u_int16_t sum, u_int16_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    231: .br
                    232: .ti -1c
                    233: .RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsa_rtr\fP (u_int16_t flags, u_int16_t num, u_int id, u_int data, u_int8_t type, u_int8_t tos, u_int16_t metric, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    234: .br
                    235: .ti -1c
                    236: .RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsa_net\fP (u_int32_t nmask, u_int rtrid, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    237: .br
                    238: .ti -1c
                    239: .RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsa_sum\fP (u_int32_t nmask, u_int metric, u_int tos, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    240: .br
                    241: .ti -1c
                    242: .RI "libnet_ptag_t \fBlibnet_build_ospfv2_lsa_as\fP (u_int32_t nmask, u_int metric, u_int32_t fwdaddr, u_int tag, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    243: .br
                    244: .ti -1c
                    245: .RI "libnet_ptag_t \fBlibnet_build_data\fP (u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    246: .br
                    247: .ti -1c
                    248: .RI "libnet_ptag_t \fBlibnet_build_dhcpv4\fP (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)"
                    249: .br
                    250: .ti -1c
                    251: .RI "libnet_ptag_t \fBlibnet_build_bootpv4\fP (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)"
                    252: .br
                    253: .ti -1c
                    254: .RI "u_int32_t \fBlibnet_getgre_length\fP (u_int16_t fv)"
                    255: .br
                    256: .ti -1c
                    257: .RI "libnet_ptag_t \fBlibnet_build_gre\fP (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)"
                    258: .br
                    259: .ti -1c
                    260: .RI "libnet_ptag_t \fBlibnet_build_egre\fP (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)"
                    261: .br
                    262: .ti -1c
                    263: .RI "libnet_ptag_t \fBlibnet_build_gre_sre\fP (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)"
                    264: .br
                    265: .ti -1c
                    266: .RI "libnet_ptag_t \fBlibnet_build_gre_last_sre\fP (libnet_t *l, libnet_ptag_t ptag)"
                    267: .br
                    268: .ti -1c
                    269: .RI "libnet_ptag_t \fBlibnet_build_bgp4_header\fP (u_int8_t marker[LIBNET_BGP4_MARKER_SIZE], u_int16_t len, u_int8_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    270: .br
                    271: .ti -1c
                    272: .RI "libnet_ptag_t \fBlibnet_build_bgp4_open\fP (u_int8_t version, u_int16_t src_as, u_int16_t hold_time, u_int32_t bgp_id, u_int8_t opt_len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    273: .br
                    274: .ti -1c
                    275: .RI "libnet_ptag_t \fBlibnet_build_bgp4_update\fP (u_int16_t unfeasible_rt_len, u_int8_t *withdrawn_rt, u_int16_t total_path_attr_len, u_int8_t *path_attributes, u_int16_t info_len, u_int8_t *reachability_info, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    276: .br
                    277: .ti -1c
                    278: .RI "libnet_ptag_t \fBlibnet_build_bgp4_notification\fP (u_int8_t err_code, u_int8_t err_subcode, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    279: .br
                    280: .ti -1c
                    281: .RI "libnet_ptag_t \fBlibnet_build_sebek\fP (u_int32_t magic, u_int16_t version, u_int16_t type, u_int32_t counter, u_int32_t time_sec, u_int32_t time_usec, u_int32_t pid, u_int32_t uid, u_int32_t fd, u_int8_t cmd[SEBEK_CMD_LENGTH], u_int32_t length, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    282: .br
                    283: .ti -1c
                    284: .RI "libnet_ptag_t \fBlibnet_build_link\fP (u_int8_t *dst, u_int8_t *src, u_int8_t *oui, u_int16_t type, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)"
                    285: .br
                    286: .ti -1c
                    287: .RI "libnet_ptag_t \fBlibnet_autobuild_link\fP (u_int8_t *dst, u_int8_t *oui, u_int16_t type, libnet_t *l)"
                    288: .br
                    289: .ti -1c
                    290: .RI "int \fBlibnet_write\fP (libnet_t *l)"
                    291: .br
                    292: .ti -1c
                    293: .RI "u_int32_t \fBlibnet_get_ipaddr4\fP (libnet_t *l)"
                    294: .br
                    295: .ti -1c
                    296: .RI "libnet_in6_addr \fBlibnet_get_ipaddr6\fP (libnet_t *l)"
                    297: .br
                    298: .ti -1c
                    299: .RI "libnet_ether_addr * \fBlibnet_get_hwaddr\fP (libnet_t *l)"
                    300: .br
                    301: .ti -1c
                    302: .RI "u_int8_t * \fBlibnet_hex_aton\fP (int8_t *s, int *len)"
                    303: .br
                    304: .ti -1c
                    305: .RI "int \fBlibnet_adv_cull_packet\fP (libnet_t *l, u_int8_t **packet, u_int32_t *packet_s)"
                    306: .br
                    307: .ti -1c
                    308: .RI "int \fBlibnet_adv_cull_header\fP (libnet_t *l, libnet_ptag_t ptag, u_int8_t **header, u_int32_t *header_s)"
                    309: .br
                    310: .ti -1c
                    311: .RI "int \fBlibnet_adv_write_link\fP (libnet_t *l, u_int8_t *packet, u_int32_t packet_s)"
                    312: .br
                    313: .ti -1c
                    314: .RI "void \fBlibnet_adv_free_packet\fP (libnet_t *l, u_int8_t *packet)"
                    315: .br
                    316: .ti -1c
                    317: .RI "int \fBlibnet_cq_add\fP (libnet_t *l, char *label)"
                    318: .br
                    319: .ti -1c
                    320: .RI "libnet_t * \fBlibnet_cq_remove\fP (libnet_t *l)"
                    321: .br
                    322: .ti -1c
                    323: .RI "libnet_t * \fBlibnet_cq_remove_by_label\fP (char *label)"
                    324: .br
                    325: .ti -1c
                    326: .RI "int8_t * \fBlibnet_cq_getlabel\fP (libnet_t *l)"
                    327: .br
                    328: .ti -1c
                    329: .RI "libnet_t * \fBlibnet_cq_find_by_label\fP (char *label)"
                    330: .br
                    331: .ti -1c
                    332: .RI "void \fBlibnet_cq_destroy\fP ()"
                    333: .br
                    334: .ti -1c
                    335: .RI "libnet_t * \fBlibnet_cq_head\fP ()"
                    336: .br
                    337: .ti -1c
                    338: .RI "int \fBlibnet_cq_last\fP ()"
                    339: .br
                    340: .ti -1c
                    341: .RI "libnet_t * \fBlibnet_cq_next\fP ()"
                    342: .br
                    343: .ti -1c
                    344: .RI "u_int32_t \fBlibnet_cq_size\fP ()"
                    345: .br
                    346: .ti -1c
                    347: .RI "void \fBlibnet_diag_dump_context\fP (libnet_t *l)"
                    348: .br
                    349: .ti -1c
                    350: .RI "void \fBlibnet_diag_dump_pblock\fP (libnet_t *l)"
                    351: .br
                    352: .ti -1c
                    353: .RI "char * \fBlibnet_diag_dump_pblock_type\fP (u_int8_t type)"
                    354: .br
                    355: .ti -1c
                    356: .RI "void \fBlibnet_diag_dump_hex\fP (u_int8_t *packet, u_int32_t len, int swap, FILE *stream)"
                    357: .br
                    358: .ti -1c
                    359: .RI "int \fBlibnet_write_raw_ipv4\fP (libnet_t *l, u_int8_t *packet, u_int32_t size)"
                    360: .br
                    361: .ti -1c
                    362: .RI "int \fBlibnet_write_raw_ipv6\fP (libnet_t *l, u_int8_t *packet, u_int32_t size)"
                    363: .br
                    364: .ti -1c
                    365: .RI "int \fBlibnet_write_link\fP (libnet_t *l, u_int8_t *packet, u_int32_t size)"
                    366: .br
                    367: .ti -1c
                    368: .RI "int \fBlibnet_open_raw4\fP (libnet_t *l)"
                    369: .br
                    370: .ti -1c
                    371: .RI "int \fBlibnet_close_raw4\fP (libnet_t *l)"
                    372: .br
                    373: .ti -1c
                    374: .RI "int \fBlibnet_open_raw6\fP (libnet_t *l)"
                    375: .br
                    376: .ti -1c
                    377: .RI "int \fBlibnet_close_raw6\fP (libnet_t *l)"
                    378: .br
                    379: .ti -1c
                    380: .RI "int \fBlibnet_select_device\fP (libnet_t *l)"
                    381: .br
                    382: .ti -1c
                    383: .RI "int \fBlibnet_open_link\fP (libnet_t *l)"
                    384: .br
                    385: .ti -1c
                    386: .RI "int \fBlibnet_close_link\fP (libnet_t *l)"
                    387: .br
                    388: .ti -1c
                    389: .RI "int \fBlibnet_do_checksum\fP (libnet_t *l, u_int8_t *packet, int protocol, int len)"
                    390: .br
                    391: .ti -1c
                    392: .RI "u_int32_t \fBlibnet_compute_crc\fP (u_int8_t *buf, u_int32_t len)"
                    393: .br
                    394: .ti -1c
                    395: .RI "u_int16_t \fBlibnet_ip_check\fP (u_int16_t *addr, int len)"
                    396: .br
                    397: .ti -1c
                    398: .RI "int \fBlibnet_in_cksum\fP (u_int16_t *addr, int len)"
                    399: .br
                    400: .ti -1c
                    401: .RI "libnet_pblock_t * \fBlibnet_pblock_probe\fP (libnet_t *l, libnet_ptag_t ptag, u_int32_t n, u_int8_t type)"
                    402: .br
                    403: .ti -1c
                    404: .RI "libnet_pblock_t * \fBlibnet_pblock_new\fP (libnet_t *l, u_int32_t size)"
                    405: .br
                    406: .ti -1c
                    407: .RI "int \fBlibnet_pblock_swap\fP (libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)"
                    408: .br
                    409: .ti -1c
                    410: .RI "int \fBlibnet_pblock_insert_before\fP (libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)"
                    411: .br
                    412: .ti -1c
                    413: .RI "void \fBlibnet_pblock_delete\fP (libnet_t *l, libnet_pblock_t *p)"
                    414: .br
                    415: .ti -1c
                    416: .RI "libnet_ptag_t \fBlibnet_pblock_update\fP (libnet_t *l, libnet_pblock_t *p, u_int32_t h, u_int8_t type)"
                    417: .br
                    418: .ti -1c
                    419: .RI "libnet_pblock_t * \fBlibnet_pblock_find\fP (libnet_t *l, libnet_ptag_t ptag)"
                    420: .br
                    421: .ti -1c
                    422: .RI "int \fBlibnet_pblock_append\fP (libnet_t *l, libnet_pblock_t *p, u_int8_t *buf, u_int32_t len)"
                    423: .br
                    424: .ti -1c
                    425: .RI "void \fBlibnet_pblock_setflags\fP (libnet_pblock_t *p, u_int8_t flags)"
                    426: .br
                    427: .ti -1c
                    428: .RI "int \fBlibnet_pblock_p2p\fP (u_int8_t type)"
                    429: .br
                    430: .ti -1c
                    431: .RI "int \fBlibnet_pblock_coalesce\fP (libnet_t *l, u_int8_t **packet, u_int32_t *size)"
                    432: .br
                    433: .ti -1c
                    434: .RI "int \fBlibnet_check_iface\fP (libnet_t *l)"
                    435: .br
                    436: .in -1c
                    437: .SS "Variables"
                    438: 
                    439: .in +1c
                    440: .ti -1c
                    441: .RI "const  struct libnet_in6_addr \fBin6addr_error\fP"
                    442: .br
                    443: .in -1c
                    444: .SH "Detailed Description"
                    445: .PP 
                    446: libnet exported function prototypes 
                    447: 
                    448: 
                    449: .SH "Function Documentation"
                    450: .PP 
                    451: .SS "char* libnet_addr2name4 (u_int32_t in, u_int8_t use_name)"
                    452: .PP
                    453: Takes a network byte ordered IPv4 address and returns a pointer to either a canonical DNS name (if it has one) or a string of dotted decimals. This may incur a DNS lookup if the hostname and mode is set to LIBNET_RESOLVE. If mode is set to LIBNET_DONT_RESOLVE, no DNS lookup will be performed and the function will return a pointer to a dotted decimal string. The function cannot fail -- if no canonical name exists, it will fall back on returning a dotted decimal string. This function is non-reentrant. 
                    454: .PP
                    455: \fBParameters:\fP
                    456: .RS 4
                    457: \fIin\fP network byte ordered IPv4 address 
                    458: .br
                    459: \fIuse_name\fP LIBNET_RESOLVE or LIBNET_DONT_RESOLVE 
                    460: .RE
                    461: .PP
                    462: \fBReturns:\fP
                    463: .RS 4
                    464: a pointer to presentation format string 
                    465: .RE
                    466: .PP
                    467: 
                    468: .SS "void libnet_addr2name6_r (struct libnet_in6_addr addr, u_int8_t use_name, char * host_name, int host_name_len)"
                    469: .PP
                    470: Should document this baby right here. 
                    471: .SS "int libnet_adv_cull_header (libnet_t * l, libnet_ptag_t ptag, u_int8_t ** header, u_int32_t * header_s)"
                    472: .PP
                    473: [Advanced Interface] Pulls the header from the specified ptag from the given libnet context. This function is part of the advanced interface and is only available when libnet is initialized in advanced mode. If the function fails \fBlibnet_geterror()\fP can tell you why. 
                    474: .PP
                    475: \fBParameters:\fP
                    476: .RS 4
                    477: \fIl\fP pointer to a libnet context 
                    478: .br
                    479: \fIptag\fP the ptag referencing the header to pull 
                    480: .br
                    481: \fIheader\fP will contain the header 
                    482: .br
                    483: \fIheader_s\fP will contain the header size 
                    484: .RE
                    485: .PP
                    486: \fBReturns:\fP
                    487: .RS 4
                    488: 1 on success, -1 on failure 
                    489: .RE
                    490: .PP
                    491: 
                    492: .SS "int libnet_adv_cull_packet (libnet_t * l, u_int8_t ** packet, u_int32_t * packet_s)"
                    493: .PP
                    494: [Advanced Interface] Yanks a prebuilt, wire-ready packet from the given libnet context. If libnet was configured to do so (which it is by default) the packet will have all checksums written in. This function is part of the advanced interface and is only available when libnet is initialized in advanced mode. It is important to note that the function performs an implicit malloc() and a corresponding call to \fBlibnet_adv_free_packet()\fP should be made to free the memory packet occupies. If the function fails \fBlibnet_geterror()\fP can tell you why. 
                    495: .PP
                    496: \fBParameters:\fP
                    497: .RS 4
                    498: \fIl\fP pointer to a libnet context 
                    499: .br
                    500: \fIpacket\fP will contain the wire-ready packet 
                    501: .br
                    502: \fIpacket_s\fP will contain the packet size 
                    503: .RE
                    504: .PP
                    505: \fBReturns:\fP
                    506: .RS 4
                    507: 1 on success, -1 on failure 
                    508: .RE
                    509: .PP
                    510: 
                    511: .SS "void libnet_adv_free_packet (libnet_t * l, u_int8_t * packet)"
                    512: .PP
                    513: [Advanced Interface] Frees the memory allocated when \fBlibnet_adv_cull_packet()\fP is called. 
                    514: .PP
                    515: \fBParameters:\fP
                    516: .RS 4
                    517: \fIl\fP pointer to a libnet context 
                    518: .br
                    519: \fIpacket\fP a pointer to the packet to free 
                    520: .RE
                    521: .PP
                    522: 
                    523: .SS "int libnet_adv_write_link (libnet_t * l, u_int8_t * packet, u_int32_t packet_s)"
                    524: .PP
                    525: [Advanced Interface] Writes a packet the network at the link layer. This function is useful to write a packet that has been constructed by hand by the application programmer or, more commonly, to write a packet that has been returned by a call to \fBlibnet_adv_cull_packet()\fP. This function is part of the advanced interface and is only available when libnet is initialized in advanced mode. If the function fails \fBlibnet_geterror()\fP can tell you why. 
                    526: .PP
                    527: \fBParameters:\fP
                    528: .RS 4
                    529: \fIl\fP pointer to a libnet context 
                    530: .br
                    531: \fIpacket\fP a pointer to the packet to inject 
                    532: .br
                    533: \fIpacket_s\fP the size of the packet 
                    534: .RE
                    535: .PP
                    536: \fBReturns:\fP
                    537: .RS 4
                    538: the number of bytes written, or -1 on failure 
                    539: .RE
                    540: .PP
                    541: 
                    542: .SS "libnet_ptag_t libnet_autobuild_arp (u_int16_t op, u_int8_t * sha, u_int8_t * spa, u_int8_t * tha, u_int8_t * tpa, libnet_t * l)"
                    543: .PP
                    544: Autouilds an Address Resolution Protocol (ARP) header. Depending on the op value, the function builds one of several different types of RFC 826 or RFC 903 RARP packets. 
                    545: .PP
                    546: \fBParameters:\fP
                    547: .RS 4
                    548: \fIop\fP ARP operation type 
                    549: .br
                    550: \fIsha\fP sender's hardware address 
                    551: .br
                    552: \fIspa\fP sender's protocol address 
                    553: .br
                    554: \fItha\fP target hardware address 
                    555: .br
                    556: \fItpa\fP targer protocol address 
                    557: .br
                    558: \fIl\fP pointer to a libnet context 
                    559: .RE
                    560: .PP
                    561: \fBReturns:\fP
                    562: .RS 4
                    563: protocol tag value on success, -1 on error 
                    564: .RE
                    565: .PP
                    566: 
                    567: .SS "libnet_ptag_t libnet_autobuild_ethernet (u_int8_t * dst, u_int16_t type, libnet_t * l)"
                    568: .PP
                    569: Autobuilds 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. 
                    570: .PP
                    571: \fBParameters:\fP
                    572: .RS 4
                    573: \fIdst\fP destination ethernet address 
                    574: .br
                    575: \fItype\fP upper layer protocol type 
                    576: .br
                    577: \fIl\fP pointer to a libnet context 
                    578: .RE
                    579: .PP
                    580: \fBReturns:\fP
                    581: .RS 4
                    582: protocol tag value on success, -1 on error 
                    583: .RE
                    584: .PP
                    585: 
                    586: .SS "libnet_ptag_t libnet_autobuild_fddi (u_int8_t fc, u_int8_t * dst, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t * org, u_int16_t type, libnet_t * l)"
                    587: .PP
                    588: Autobuilds a Fiber Distributed Data Interface (FDDI) header. 
                    589: .PP
                    590: \fBParameters:\fP
                    591: .RS 4
                    592: \fIfc\fP class format and priority  dst destination fddi address 
                    593: .br
                    594: \fIdsap\fP destination service access point 
                    595: .br
                    596: \fIssap\fP source service access point 
                    597: .br
                    598: \fIcf\fP cf 
                    599: .br
                    600: \fIorg\fP IEEE organizational code 
                    601: .br
                    602: \fItype\fP upper layer protocol 
                    603: .br
                    604: \fIl\fP pointer to a libnet context 
                    605: .RE
                    606: .PP
                    607: \fBReturns:\fP
                    608: .RS 4
                    609: protocol tag value on success, -1 on error 
                    610: .RE
                    611: .PP
                    612: 
                    613: .SS "libnet_ptag_t libnet_autobuild_ipv4 (u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t * l)"
                    614: .PP
                    615: Autobuilds a version 4 Internet Protocol (IP) header. The function is useful * to build an IP header quickly when you do not need a granular level of control. The function takes the same len, prot, and dst arguments as \fBlibnet_build_ipv4()\fP. The function does not accept a ptag argument, but it does return a ptag. In other words, you can use it to build a new IP header but not to modify an existing one. 
                    616: .PP
                    617: \fBParameters:\fP
                    618: .RS 4
                    619: \fIlen\fP total length of the IP packet including all subsequent data 
                    620: .br
                    621: \fIprot\fP upper layer protocol 
                    622: .br
                    623: \fIdst\fP destination IPv4 address (little endian) 
                    624: .br
                    625: \fIl\fP pointer to a libnet context 
                    626: .RE
                    627: .PP
                    628: \fBReturns:\fP
                    629: .RS 4
                    630: protocol tag value on success, -1 on error 
                    631: .RE
                    632: .PP
                    633: 
                    634: .SS "libnet_ptag_t libnet_autobuild_ipv6 (u_int16_t len, u_int8_t nh, struct libnet_in6_addr dst, libnet_t * l)"
                    635: .PP
                    636: This function is not yet implement and is a NONOP. 
                    637: .PP
                    638: \fBParameters:\fP
                    639: .RS 4
                    640: \fIlen\fP length 
                    641: .br
                    642: \fInh\fP next header 
                    643: .br
                    644: \fIdst\fP destination IPv6 address 
                    645: .br
                    646: \fIpayload\fP optional payload or NULL 
                    647: .br
                    648: \fIpayload_s\fP payload length or 0 
                    649: .br
                    650: \fIl\fP pointer to a libnet context 
                    651: .br
                    652: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                    653: .RE
                    654: .PP
                    655: \fBReturns:\fP
                    656: .RS 4
                    657: protocol tag value on success, -1 on error 
                    658: .RE
                    659: .PP
                    660: 
                    661: .SS "libnet_ptag_t libnet_autobuild_link (u_int8_t * dst, u_int8_t * oui, u_int16_t type, libnet_t * l)"
                    662: .PP
                    663: Automatically builds a link layer header for an initialized l. The function determines the proper link layer header format from how l was initialized. The function current supports Ethernet and Token Ring link layers. 
                    664: .PP
                    665: \fBParameters:\fP
                    666: .RS 4
                    667: \fIdst\fP the destination MAC address 
                    668: .br
                    669: \fIoui\fP Organizationally Unique Identifier (unused for Ethernet) 
                    670: .br
                    671: \fItype\fP the upper layer protocol type 
                    672: .br
                    673: \fIl\fP pointer to a libnet context 
                    674: .RE
                    675: .PP
                    676: \fBReturns:\fP
                    677: .RS 4
                    678: protocol tag value on success, -1 on error 
                    679: .RE
                    680: .PP
                    681: 
                    682: .SS "libnet_ptag_t libnet_autobuild_token_ring (u_int8_t ac, u_int8_t fc, u_int8_t * dst, u_int8_t dsap, u_int8_t ssap, u_int8_t cf, u_int8_t * org, u_int16_t type, libnet_t * l)"
                    683: .PP
                    684: Auto-builds a token ring header. 
                    685: .PP
                    686: \fBParameters:\fP
                    687: .RS 4
                    688: \fIac\fP access control 
                    689: .br
                    690: \fIfc\fP frame control 
                    691: .br
                    692: \fIdst\fP destination address 
                    693: .br
                    694: \fIdsap\fP destination service access point 
                    695: .br
                    696: \fIssap\fP source service access point 
                    697: .br
                    698: \fIcf\fP control field 
                    699: .br
                    700: \fIoui\fP Organizationally Unique Identifier 
                    701: .br
                    702: \fItype\fP upper layer protocol type 
                    703: .br
                    704: \fIl\fP pointer to a libnet context 
                    705: .RE
                    706: .PP
                    707: \fBReturns:\fP
                    708: .RS 4
                    709: protocol tag value on success, -1 on error 
                    710: .RE
                    711: .PP
                    712: 
                    713: .SS "libnet_ptag_t libnet_build_802_1q (u_int8_t * dst, u_int8_t * src, u_int16_t tpi, u_int8_t priority, u_int8_t cfi, u_int16_t vlan_id, u_int16_t len_proto, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                    714: .PP
                    715: Builds an IEEE 802.1q VLAN tagging header. Depending on the value of len_proto, the function wraps the 802.1q header inside either an IEEE 802.3 header or an RFC 894 Ethernet II (DIX) header (both resulting in an 18-byte frame). If len is 1500 or less, most receiving protocol stacks parse the frame as an IEEE 802.3 encapsulated frame. If len is one of the Ethernet type values, most protocol stacks parse the frame as an RFC 894 Ethernet II encapsulated frame. Note the length value is calculated without the 802.1q header of 18 bytes. 
                    716: .PP
                    717: \fBParameters:\fP
                    718: .RS 4
                    719: \fIdst\fP pointer to a six byte source ethernet address 
                    720: .br
                    721: \fIsrc\fP pointer to a six byte destination ethernet address 
                    722: .br
                    723: \fItpi\fP tag protocol identifier 
                    724: .br
                    725: \fIpriority\fP priority 
                    726: .br
                    727: \fIcfi\fP canonical format indicator 
                    728: .br
                    729: \fIvlan_id\fP vlan identifier 
                    730: .br
                    731: \fIlen_proto\fP length (802.3) protocol (Ethernet II) 
                    732: .br
                    733: \fIpayload\fP optional payload or NULL 
                    734: .br
                    735: \fIpayload_s\fP payload length or 0 
                    736: .br
                    737: \fIl\fP pointer to a libnet context 
                    738: .br
                    739: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                    740: .RE
                    741: .PP
                    742: \fBReturns:\fP
                    743: .RS 4
                    744: protocol tag value on success, -1 on error 
                    745: .RE
                    746: .PP
                    747: 
                    748: .SS "libnet_ptag_t libnet_build_802_1x (u_int8_t eap_ver, u_int8_t eap_type, u_int16_t length, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                    749: .PP
                    750: Builds an IEEE 802.1x extended authentication protocol header. 
                    751: .PP
                    752: \fBParameters:\fP
                    753: .RS 4
                    754: \fIeap_ver\fP the EAP version 
                    755: .br
                    756: \fIeap_type\fP the EAP type 
                    757: .br
                    758: \fIlength\fP frame length 
                    759: .br
                    760: \fIpayload\fP optional payload or NULL 
                    761: .br
                    762: \fIpayload_s\fP payload length or 0 
                    763: .br
                    764: \fIl\fP pointer to a libnet context 
                    765: .br
                    766: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                    767: .RE
                    768: .PP
                    769: \fBReturns:\fP
                    770: .RS 4
                    771: protocol tag value on success, -1 on error 
                    772: .RE
                    773: .PP
                    774: 
                    775: .SS "libnet_ptag_t libnet_build_802_2 (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                    776: .PP
                    777: Builds an IEEE 802.2 LLC header. 
                    778: .PP
                    779: \fBParameters:\fP
                    780: .RS 4
                    781: \fIdsap\fP destination service access point 
                    782: .br
                    783: \fIssap\fP source service access point 
                    784: .br
                    785: \fIcontrol\fP control field 
                    786: .br
                    787: \fIpayload\fP optional payload or NULL 
                    788: .br
                    789: \fIpayload_s\fP payload length or 0 
                    790: .br
                    791: \fIl\fP pointer to a libnet context 
                    792: .br
                    793: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                    794: .RE
                    795: .PP
                    796: \fBReturns:\fP
                    797: .RS 4
                    798: protocol tag value on success, -1 on error 
                    799: .RE
                    800: .PP
                    801: 
                    802: .SS "libnet_ptag_t libnet_build_802_2snap (u_int8_t dsap, u_int8_t ssap, u_int8_t control, u_int8_t * oui, u_int16_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                    803: .PP
                    804: Builds an IEEE 802.2 LLC SNAP header. 
                    805: .PP
                    806: \fBParameters:\fP
                    807: .RS 4
                    808: \fIdsap\fP destination service access point 
                    809: .br
                    810: \fIssap\fP source service access point 
                    811: .br
                    812: \fIcontrol\fP control field 
                    813: .br
                    814: \fIoui\fP Organizationally Unique Identifier 
                    815: .br
                    816: \fItype\fP upper layer protocol 
                    817: .br
                    818: \fIpayload\fP optional payload or NULL 
                    819: .br
                    820: \fIpayload_s\fP payload length or 0 
                    821: .br
                    822: \fIl\fP pointer to a libnet context 
                    823: .br
                    824: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                    825: .RE
                    826: .PP
                    827: \fBReturns:\fP
                    828: .RS 4
                    829: protocol tag value on success, -1 on error 
                    830: .RE
                    831: .PP
                    832: 
                    833: .SS "libnet_ptag_t libnet_build_802_3 (u_int8_t * dst, u_int8_t * src, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                    834: .PP
                    835: Builds an IEEE 802.3 header. The 802.3 header is almost identical to the RFC 894 Ethernet II header, the exception being that the field immediately following the source address holds the frame's length (as opposed to the layer 3 protocol). You should only use this function when libnet is initialized with the LIBNET_LINK interface. 
                    836: .PP
                    837: \fBParameters:\fP
                    838: .RS 4
                    839: \fIdst\fP destination ethernet address 
                    840: .br
                    841: \fIsrc\fP source ethernet address 
                    842: .br
                    843: \fIlen\fP frame length sans header 
                    844: .br
                    845: \fIpayload\fP optional payload or NULL 
                    846: .br
                    847: \fIpayload_s\fP payload length or 0 
                    848: .br
                    849: \fIl\fP pointer to a libnet context 
                    850: .br
                    851: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                    852: .RE
                    853: .PP
                    854: \fBReturns:\fP
                    855: .RS 4
                    856: protocol tag value on success, -1 on error 
                    857: .RE
                    858: .PP
                    859: 
                    860: .SS "libnet_ptag_t libnet_build_arp (u_int16_t hrd, u_int16_t pro, u_int8_t hln, u_int8_t pln, u_int16_t op, u_int8_t * sha, u_int8_t * spa, u_int8_t * tha, u_int8_t * tpa, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                    861: .PP
                    862: Builds an Address Resolution Protocol (ARP) header. Depending on the op value, the function builds one of several different types of RFC 826 or RFC 903 RARP packets. 
                    863: .PP
                    864: \fBParameters:\fP
                    865: .RS 4
                    866: \fIhrd\fP hardware address format 
                    867: .br
                    868: \fIpro\fP protocol address format 
                    869: .br
                    870: \fIhln\fP hardware address length 
                    871: .br
                    872: \fIpln\fP protocol address length 
                    873: .br
                    874: \fIop\fP ARP operation type 
                    875: .br
                    876: \fIsha\fP sender's hardware address 
                    877: .br
                    878: \fIspa\fP sender's protocol address 
                    879: .br
                    880: \fItha\fP target hardware address 
                    881: .br
                    882: \fItpa\fP targer protocol address 
                    883: .br
                    884: \fIpayload\fP optional payload or NULL 
                    885: .br
                    886: \fIpayload_s\fP payload length or 0 
                    887: .br
                    888: \fIl\fP pointer to a libnet context 
                    889: .br
                    890: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                    891: .RE
                    892: .PP
                    893: \fBReturns:\fP
                    894: .RS 4
                    895: protocol tag value on success, -1 on error 
                    896: .RE
                    897: .PP
                    898: 
                    899: .SS "libnet_ptag_t libnet_build_bgp4_header (u_int8_t marker[LIBNET_BGP4_MARKER_SIZE], u_int16_t len, u_int8_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                    900: .PP
                    901: Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) header. The primary function of a BGP speaking system is to exchange network reachability information with other BGP systems. This network reachability information includes information on the list of Autonomous Systems (ASs) that reachability information traverses. This information is sufficient to construct a graph of AS connectivity from which routing loops may be pruned and some policy decisions at the AS level may be enforced. This function builds the base BGP header which is used as a preamble before any other BGP header. For example, a BGP KEEPALIVE message may be built with only this function, while an error notification requires a subsequent call to libnet_build_bgp4_notification. 
                    902: .PP
                    903: \fBParameters:\fP
                    904: .RS 4
                    905: \fImarker\fP a value the receiver can predict (if the message type is not BGP OPEN, or no authentication is used, these 16 bytes are normally set as all ones) 
                    906: .br
                    907: \fIlen\fP total length of the BGP message, including the header 
                    908: .br
                    909: \fItype\fP type code of the message (OPEN, UPDATE, NOTIFICATION or KEEPALIVE) 
                    910: .br
                    911: \fIpayload\fP optional payload or NULL 
                    912: .br
                    913: \fIpayload_s\fP payload length or 0 
                    914: .br
                    915: \fIl\fP pointer to a libnet context 
                    916: .br
                    917: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                    918: .RE
                    919: .PP
                    920: \fBReturns:\fP
                    921: .RS 4
                    922: protocol tag value on success, -1 on error 
                    923: .RE
                    924: .PP
                    925: 
                    926: .SS "libnet_ptag_t libnet_build_bgp4_notification (u_int8_t err_code, u_int8_t err_subcode, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                    927: .PP
                    928: Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) notification header. A NOTIFICATION message is sent when an error condition is detected. Specific error information may be passed through the payload interface. 
                    929: .PP
                    930: \fBParameters:\fP
                    931: .RS 4
                    932: \fIerr_code\fP type of notification 
                    933: .br
                    934: \fIerr_subcode\fP more specific information about the reported error. 
                    935: .br
                    936: \fIpayload\fP optional payload or NULL 
                    937: .br
                    938: \fIpayload_s\fP payload length or 0 
                    939: .br
                    940: \fIl\fP pointer to a libnet context 
                    941: .br
                    942: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                    943: .RE
                    944: .PP
                    945: \fBReturns:\fP
                    946: .RS 4
                    947: protocol tag value on success, -1 on error 
                    948: .RE
                    949: .PP
                    950: 
                    951: .SS "libnet_ptag_t libnet_build_bgp4_open (u_int8_t version, u_int16_t src_as, u_int16_t hold_time, u_int32_t bgp_id, u_int8_t opt_len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                    952: .PP
                    953: Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) OPEN header. This is the first message sent by each side of a BGP connection. The optional parameters options should be constructed using the payload interface (see RFC 1771 for the options structures). 
                    954: .PP
                    955: \fBParameters:\fP
                    956: .RS 4
                    957: \fIversion\fP protocol version (should be set to 4) 
                    958: .br
                    959: \fIsrc_as\fP Autonomous System of the sender 
                    960: .br
                    961: \fIhold_time\fP used to compute the maximum allowed time between the receipt of KEEPALIVE, and/or UPDATE messages by the sender 
                    962: .br
                    963: \fIbgp_id\fP BGP identifier of the sender 
                    964: .br
                    965: \fIopt_len\fP total length of the optional parameters field in bytes 
                    966: .br
                    967: \fIpayload\fP optional payload or NULL 
                    968: .br
                    969: \fIpayload_s\fP payload length or 0 
                    970: .br
                    971: \fIl\fP pointer to a libnet context 
                    972: .br
                    973: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                    974: .RE
                    975: .PP
                    976: \fBReturns:\fP
                    977: .RS 4
                    978: protocol tag value on success, -1 on error 
                    979: .RE
                    980: .PP
                    981: 
                    982: .SS "libnet_ptag_t libnet_build_bgp4_update (u_int16_t unfeasible_rt_len, u_int8_t * withdrawn_rt, u_int16_t total_path_attr_len, u_int8_t * path_attributes, u_int16_t info_len, u_int8_t * reachability_info, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                    983: .PP
                    984: Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) update header. Update messages are used to transfer routing information between BGP peers. 
                    985: .PP
                    986: \fBParameters:\fP
                    987: .RS 4
                    988: \fIunfeasible_rt_len\fP indicates the length of the (next) 'withdrawn routes' field in bytes 
                    989: .br
                    990: \fIwithdrawn_rt\fP list of IP addresses prefixes for the routes that are being withdrawn; each IP address prefix is built as a 2-tuple <length (1 byte), prefix (variable)> 
                    991: .br
                    992: \fItotal_path_attr_len\fP indicates the length of the (next) 'path attributes' field in bytes 
                    993: .br
                    994: \fIpath_attributes\fP each attribute is a 3-tuple <type (2 bytes), length, value> 
                    995: .br
                    996: \fIinfo_len\fP indicates the length of the (next) 'network layer reachability information' field in bytes (needed for internal memory size calculation) 
                    997: .br
                    998: \fIreachability_info\fP 2-tuples <length (1 byte), prefix (variable)>. 
                    999: .br
                   1000: \fIpayload\fP optional payload or NULL 
                   1001: .br
                   1002: \fIpayload_s\fP payload length or 0 
                   1003: .br
                   1004: \fIl\fP pointer to a libnet context 
                   1005: .br
                   1006: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1007: .RE
                   1008: .PP
                   1009: \fBReturns:\fP
                   1010: .RS 4
                   1011: protocol tag value on success, -1 on error 
                   1012: .RE
                   1013: .PP
                   1014: 
                   1015: .SS "libnet_ptag_t libnet_build_bootpv4 (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)"
                   1016: .PP
                   1017: \fBParameters:\fP
                   1018: .RS 4
                   1019: \fIpayload\fP optional payload or NULL 
                   1020: .br
                   1021: \fIpayload_s\fP payload length or 0 
                   1022: .br
                   1023: \fIl\fP pointer to a libnet context 
                   1024: .br
                   1025: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1026: .RE
                   1027: .PP
                   1028: \fBReturns:\fP
                   1029: .RS 4
                   1030: protocol tag value on success, -1 on error 
                   1031: .RE
                   1032: .PP
                   1033: 
                   1034: .SS "libnet_ptag_t 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 * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   1035: .PP
                   1036: Builds a Cisco Discovery Protocol (CDP) header. Cisco Systems designed CDP to aid in the network management of adjacent Cisco devices. The CDP protocol specifies data by using a type/length/value (TLV) setup. The first TLV can specified by using the functions type, length, and value arguments. To specify additional TLVs, the programmer could either use the payload interface or \fBlibnet_build_data()\fP to construct them. 
                   1037: .PP
                   1038: \fBParameters:\fP
                   1039: .RS 4
                   1040: \fIversion\fP CDP version 
                   1041: .br
                   1042: \fIttl\fP time to live (time information should be cached by recipient) 
                   1043: .br
                   1044: \fIsum\fP checksum (0 for libnet to autofill) 
                   1045: .br
                   1046: \fItype\fP type of data contained in value 
                   1047: .br
                   1048: \fIlen\fP length of value arugment 
                   1049: .br
                   1050: \fIvalue\fP the CDP information string 
                   1051: .br
                   1052: \fIpayload\fP optional payload or NULL 
                   1053: .br
                   1054: \fIpayload_s\fP payload length or 0 
                   1055: .br
                   1056: \fIl\fP pointer to a libnet context 
                   1057: .br
                   1058: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1059: .RE
                   1060: .PP
                   1061: \fBReturns:\fP
                   1062: .RS 4
                   1063: protocol tag value on success, -1 on error 
                   1064: .RE
                   1065: .PP
                   1066: 
                   1067: .SS "libnet_ptag_t libnet_build_data (u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   1068: .PP
                   1069: Builds a generic libnet protocol header. This is useful for including an optional payload to a packet that might need to change repeatedly inside of a loop. 
                   1070: .PP
                   1071: \fBParameters:\fP
                   1072: .RS 4
                   1073: \fIpayload\fP optional payload or NULL 
                   1074: .br
                   1075: \fIpayload_s\fP payload length or 0 
                   1076: .br
                   1077: \fIl\fP pointer to a libnet context 
                   1078: .br
                   1079: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1080: .RE
                   1081: .PP
                   1082: \fBReturns:\fP
                   1083: .RS 4
                   1084: protocol tag value on success, -1 on error 
                   1085: .RE
                   1086: .PP
                   1087: 
                   1088: .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)"
                   1089: .PP
                   1090: \fBParameters:\fP
                   1091: .RS 4
                   1092: \fIpayload\fP optional payload or NULL 
                   1093: .br
                   1094: \fIpayload_s\fP payload length or 0 
                   1095: .br
                   1096: \fIl\fP pointer to a libnet context 
                   1097: .br
                   1098: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1099: .RE
                   1100: .PP
                   1101: \fBReturns:\fP
                   1102: .RS 4
                   1103: protocol tag value on success, -1 on error 
                   1104: .RE
                   1105: .PP
                   1106: 
                   1107: .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)"
                   1108: .PP
                   1109: Builds an RFC 1035 version 4 DNS header. Additional DNS payload information should be specified using the payload interface. 
                   1110: .PP
                   1111: \fBParameters:\fP
                   1112: .RS 4
                   1113: \fIid\fP DNS packet id 
                   1114: .br
                   1115: \fIflags\fP control flags 
                   1116: .br
                   1117: \fInum_q\fP number of questions 
                   1118: .br
                   1119: \fInum_anws_rr\fP number of answer resource records 
                   1120: .br
                   1121: \fInum_auth_rr\fP number of authority resource records 
                   1122: .br
                   1123: \fInum_addi_rr\fP number of additional resource records 
                   1124: .br
                   1125: \fIpayload\fP optional payload or NULL 
                   1126: .br
                   1127: \fIpayload_s\fP payload length or 0 
                   1128: .br
                   1129: \fIl\fP pointer to a libnet context 
                   1130: .br
                   1131: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1132: .RE
                   1133: .PP
                   1134: \fBReturns:\fP
                   1135: .RS 4
                   1136: protocol tag value on success, -1 on error 
                   1137: .RE
                   1138: .PP
                   1139: 
                   1140: .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)"
                   1141: .PP
                   1142: Generic 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. 
                   1143: .PP
                   1144: \fBParameters:\fP
                   1145: .RS 4
                   1146: \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. 
                   1147: .br
                   1148: \fIpayload\fP optional payload or NULL 
                   1149: .br
                   1150: \fItype\fP which protocol is encapsulated (PPP, IP, ...) 
                   1151: .br
                   1152: \fIsum\fP checksum (0 for libnet to autofill). 
                   1153: .br
                   1154: \fIoffset\fP byte offset from the start of the routing field to the first byte of the SRE 
                   1155: .br
                   1156: \fIkey\fP inserted by the encapsulator to authenticate the source 
                   1157: .br
                   1158: \fIseq\fP sequence number used by the receiver to sort the packets 
                   1159: .br
                   1160: \fIlen\fP size of the GRE packet 
                   1161: .br
                   1162: \fIpayload_s\fP payload length or 0 
                   1163: .br
                   1164: \fIl\fP pointer to a libnet context 
                   1165: .br
                   1166: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1167: .RE
                   1168: .PP
                   1169: \fBReturns:\fP
                   1170: .RS 4
                   1171: protocol tag value on success, -1 on error 
                   1172: .RE
                   1173: .PP
                   1174: 
                   1175: .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)"
                   1176: .PP
                   1177: Builds 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. 
                   1178: .PP
                   1179: \fBParameters:\fP
                   1180: .RS 4
                   1181: \fIdst\fP destination ethernet address 
                   1182: .br
                   1183: \fIsrc\fP source ethernet address 
                   1184: .br
                   1185: \fItype\fP upper layer protocol type 
                   1186: .br
                   1187: \fIpayload\fP optional payload or NULL 
                   1188: .br
                   1189: \fIpayload_s\fP payload length or 0 
                   1190: .br
                   1191: \fIl\fP pointer to a libnet context 
                   1192: .br
                   1193: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1194: .RE
                   1195: .PP
                   1196: \fBReturns:\fP
                   1197: .RS 4
                   1198: protocol tag value on success, -1 on error 
                   1199: .RE
                   1200: .PP
                   1201: 
                   1202: .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)"
                   1203: .PP
                   1204: Builds a Fiber Distributed Data Interface (FDDI) header. 
                   1205: .PP
                   1206: \fBParameters:\fP
                   1207: .RS 4
                   1208: \fIfc\fP class format and priority  dst destination fddi address  src source fddi address 
                   1209: .br
                   1210: \fIdsap\fP destination service access point 
                   1211: .br
                   1212: \fIssap\fP source service access point 
                   1213: .br
                   1214: \fIcf\fP cf 
                   1215: .br
                   1216: \fIorg\fP 3 byte IEEE organizational code 
                   1217: .br
                   1218: \fItype\fP upper layer protocol 
                   1219: .br
                   1220: \fIpayload\fP optional payload or NULL 
                   1221: .br
                   1222: \fIpayload_s\fP payload length or 0 
                   1223: .br
                   1224: \fIl\fP pointer to a libnet context 
                   1225: .br
                   1226: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1227: .RE
                   1228: .PP
                   1229: \fBReturns:\fP
                   1230: .RS 4
                   1231: protocol tag value on success, -1 on error 
                   1232: .RE
                   1233: .PP
                   1234: 
                   1235: .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)"
                   1236: .PP
                   1237: Generic 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. 
                   1238: .PP
                   1239: \fBParameters:\fP
                   1240: .RS 4
                   1241: \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. 
                   1242: .br
                   1243: \fIpayload\fP optional payload or NULL 
                   1244: .br
                   1245: \fItype\fP which protocol is encapsulated (PPP, IP, ...) 
                   1246: .br
                   1247: \fIsum\fP checksum (0 for libnet to autofill). 
                   1248: .br
                   1249: \fIoffset\fP byte offset from the start of the routing field to the first byte of the SRE 
                   1250: .br
                   1251: \fIkey\fP inserted by the encapsulator to authenticate the source 
                   1252: .br
                   1253: \fIseq\fP sequence number used by the receiver to sort the packets 
                   1254: .br
                   1255: \fIlen\fP size of the GRE packet 
                   1256: .br
                   1257: \fIpayload_s\fP payload length or 0 
                   1258: .br
                   1259: \fIl\fP pointer to a libnet context 
                   1260: .br
                   1261: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1262: .RE
                   1263: .PP
                   1264: \fBReturns:\fP
                   1265: .RS 4
                   1266: protocol tag value on success, -1 on error 
                   1267: .RE
                   1268: .PP
                   1269: 
                   1270: .SS "libnet_ptag_t libnet_build_gre_last_sre (libnet_t * l, libnet_ptag_t ptag)"
                   1271: .PP
                   1272: \fBParameters:\fP
                   1273: .RS 4
                   1274: \fIpayload\fP optional payload or NULL 
                   1275: .br
                   1276: \fIpayload_s\fP payload length or 0 
                   1277: .br
                   1278: \fIl\fP pointer to a libnet context 
                   1279: .br
                   1280: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1281: .RE
                   1282: .PP
                   1283: \fBReturns:\fP
                   1284: .RS 4
                   1285: protocol tag value on success, -1 on error 
                   1286: .RE
                   1287: .PP
                   1288: 
                   1289: .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)"
                   1290: .PP
                   1291: \fBParameters:\fP
                   1292: .RS 4
                   1293: \fIpayload\fP optional payload or NULL 
                   1294: .br
                   1295: \fIpayload_s\fP payload length or 0 
                   1296: .br
                   1297: \fIl\fP pointer to a libnet context 
                   1298: .br
                   1299: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1300: .RE
                   1301: .PP
                   1302: \fBReturns:\fP
                   1303: .RS 4
                   1304: protocol tag value on success, -1 on error 
                   1305: .RE
                   1306: .PP
                   1307: 
                   1308: .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)"
                   1309: .PP
                   1310: Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) echo request/reply header 
                   1311: .PP
                   1312: \fBParameters:\fP
                   1313: .RS 4
                   1314: \fItype\fP type of ICMP packet (should be ICMP_ECHOREPLY or ICMP_ECHO) 
                   1315: .br
                   1316: \fIcode\fP code of ICMP packet (should be 0) 
                   1317: .br
                   1318: \fIsum\fP checksum (0 for libnet to autofill) 
                   1319: .br
                   1320: \fIid\fP identification number 
                   1321: .br
                   1322: \fIseq\fP packet sequence number 
                   1323: .br
                   1324: \fIpayload\fP optional payload or NULL 
                   1325: .br
                   1326: \fIpayload_s\fP payload length or 0 
                   1327: .br
                   1328: \fIl\fP pointer to a libnet context 
                   1329: .br
                   1330: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1331: .RE
                   1332: .PP
                   1333: \fBReturns:\fP
                   1334: .RS 4
                   1335: protocol tag value on success, -1 on error 
                   1336: .RE
                   1337: .PP
                   1338: 
                   1339: .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)"
                   1340: .PP
                   1341: Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) IP netmask request/reply header. 
                   1342: .PP
                   1343: \fBParameters:\fP
                   1344: .RS 4
                   1345: \fItype\fP type of ICMP packet (should be ICMP_MASKREQ or ICMP_MASKREPLY) 
                   1346: .br
                   1347: \fIcode\fP code of ICMP packet (should be 0) 
                   1348: .br
                   1349: \fIsum\fP checksum (0 for libnet to autofill) 
                   1350: .br
                   1351: \fIid\fP identification number 
                   1352: .br
                   1353: \fIseq\fP packet sequence number 
                   1354: .br
                   1355: \fImask\fP subnet mask 
                   1356: .br
                   1357: \fIpayload\fP optional payload or NULL 
                   1358: .br
                   1359: \fIpayload_s\fP payload length or 0 
                   1360: .br
                   1361: \fIl\fP pointer to a libnet context 
                   1362: .br
                   1363: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1364: .RE
                   1365: .PP
                   1366: \fBReturns:\fP
                   1367: .RS 4
                   1368: protocol tag value on success, -1 on error 
                   1369: .RE
                   1370: .PP
                   1371: 
                   1372: .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)"
                   1373: .PP
                   1374: Builds 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). 
                   1375: .PP
                   1376: \fBParameters:\fP
                   1377: .RS 4
                   1378: \fItype\fP type of ICMP packet (should be ICMP_REDIRECT) 
                   1379: .br
                   1380: \fIcode\fP code of ICMP packet (should be one of the four redirect codes) 
                   1381: .br
                   1382: \fIsum\fP checksum (0 for libnet to autofill) 
                   1383: .br
                   1384: \fIorig_id\fP original IP header identification 
                   1385: .br
                   1386: \fIorig_frag\fP original IP header fragmentation information 
                   1387: .br
                   1388: \fIorig_ttl\fP orginal IP header time to live 
                   1389: .br
                   1390: \fIorig_prot\fP original IP header protocol 
                   1391: .br
                   1392: \fIorig_check\fP original IP header checksum 
                   1393: .br
                   1394: \fIorig_src\fP original IP header source address 
                   1395: .br
                   1396: \fIorig_dst\fP original IP header destination address 
                   1397: .br
                   1398: \fIpayload\fP optional payload or NULL 
                   1399: .br
                   1400: \fIpayload_s\fP payload length or 0 
                   1401: .br
                   1402: \fIl\fP pointer to a libnet context 
                   1403: .br
                   1404: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1405: .RE
                   1406: .PP
                   1407: \fBReturns:\fP
                   1408: .RS 4
                   1409: protocol tag value on success, -1 on error 
                   1410: .RE
                   1411: .PP
                   1412: 
                   1413: .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)"
                   1414: .PP
                   1415: Builds 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). 
                   1416: .PP
                   1417: \fBParameters:\fP
                   1418: .RS 4
                   1419: \fItype\fP type of ICMP packet (should be ICMP_TIMXCEED) 
                   1420: .br
                   1421: \fIcode\fP code of ICMP packet (ICMP_TIMXCEED_INTRANS / ICMP_TIMXCEED_REASS) 
                   1422: .br
                   1423: \fIsum\fP checksum (0 for libnet to autofill) 
                   1424: .br
                   1425: \fIorig_id\fP original IP header identification 
                   1426: .br
                   1427: \fIorig_frag\fP original IP header fragmentation information 
                   1428: .br
                   1429: \fIorig_ttl\fP orginal IP header time to live 
                   1430: .br
                   1431: \fIorig_prot\fP original IP header protocol 
                   1432: .br
                   1433: \fIorig_check\fP original IP header checksum 
                   1434: .br
                   1435: \fIorig_src\fP original IP header source address 
                   1436: .br
                   1437: \fIorig_dst\fP original IP header destination address 
                   1438: .br
                   1439: \fIpayload\fP optional payload or NULL 
                   1440: .br
                   1441: \fIpayload\fP optional payload or NULL 
                   1442: .br
                   1443: \fIpayload_s\fP payload length or 0 
                   1444: .br
                   1445: \fIl\fP pointer to a libnet context 
                   1446: .br
                   1447: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1448: .RE
                   1449: .PP
                   1450: \fBReturns:\fP
                   1451: .RS 4
                   1452: protocol tag value on success, -1 on error 
                   1453: .RE
                   1454: .PP
                   1455: 
                   1456: .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)"
                   1457: .PP
                   1458: Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) timestamp request/reply header. 
                   1459: .PP
                   1460: \fBParameters:\fP
                   1461: .RS 4
                   1462: \fItype\fP type of ICMP packet (should be ICMP_TSTAMP or ICMP_TSTAMPREPLY) 
                   1463: .br
                   1464: \fIcode\fP code of ICMP packet (should be 0) 
                   1465: .br
                   1466: \fIsum\fP checksum (0 for libnet to autofill) 
                   1467: .br
                   1468: \fIid\fP identification number 
                   1469: .br
                   1470: \fIseq\fP sequence number 
                   1471: .br
                   1472: \fIotime\fP originate timestamp 
                   1473: .br
                   1474: \fIrtime\fP receive timestamp 
                   1475: .br
                   1476: \fIttime\fP transmit timestamp 
                   1477: .br
                   1478: \fIpayload\fP optional payload or NULL 
                   1479: .br
                   1480: \fIpayload_s\fP payload length or 0 
                   1481: .br
                   1482: \fIl\fP pointer to a libnet context 
                   1483: .br
                   1484: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1485: .RE
                   1486: .PP
                   1487: \fBReturns:\fP
                   1488: .RS 4
                   1489: protocol tag value on success, -1 on error 
                   1490: .RE
                   1491: .PP
                   1492: 
                   1493: .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)"
                   1494: .PP
                   1495: Builds 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). 
                   1496: .PP
                   1497: \fBParameters:\fP
                   1498: .RS 4
                   1499: \fItype\fP type of ICMP packet (should be ICMP_UNREACH) 
                   1500: .br
                   1501: \fIcode\fP code of ICMP packet (should be one of the 16 unreachable codes) 
                   1502: .br
                   1503: \fIsum\fP checksum (0 for libnet to autofill) 
                   1504: .br
                   1505: \fIorig_id\fP original IP header identification 
                   1506: .br
                   1507: \fIorig_frag\fP original IP header fragmentation information 
                   1508: .br
                   1509: \fIorig_ttl\fP orginal IP header time to live 
                   1510: .br
                   1511: \fIorig_prot\fP original IP header protocol 
                   1512: .br
                   1513: \fIorig_check\fP original IP header checksum 
                   1514: .br
                   1515: \fIorig_src\fP original IP header source address 
                   1516: .br
                   1517: \fIorig_dst\fP original IP header destination address 
                   1518: .br
                   1519: \fIpayload\fP optional payload or NULL 
                   1520: .br
                   1521: \fIpayload_s\fP payload length or 0 
                   1522: .br
                   1523: \fIl\fP pointer to a libnet context 
                   1524: .br
                   1525: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1526: .RE
                   1527: .PP
                   1528: \fBReturns:\fP
                   1529: .RS 4
                   1530: protocol tag value on success, -1 on error 
                   1531: .RE
                   1532: .PP
                   1533: 
                   1534: .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)"
                   1535: .PP
                   1536: Builds an RFC 1112 Internet Group Memebership Protocol (IGMP) header. 
                   1537: .PP
                   1538: \fBParameters:\fP
                   1539: .RS 4
                   1540: \fItype\fP packet type 
                   1541: .br
                   1542: \fIcode\fP packet code (should be 0) 
                   1543: .br
                   1544: \fIsum\fP checksum (0 for libnet to autofill) 
                   1545: .br
                   1546: \fIip\fP IPv4 address 
                   1547: .br
                   1548: \fIpayload\fP optional payload or NULL 
                   1549: .br
                   1550: \fIpayload_s\fP payload length or 0 
                   1551: .br
                   1552: \fIl\fP pointer to a libnet context 
                   1553: .br
                   1554: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1555: .RE
                   1556: .PP
                   1557: \fBReturns:\fP
                   1558: .RS 4
                   1559: protocol tag value on success, -1 on error 
                   1560: .RE
                   1561: .PP
                   1562: 
                   1563: .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)"
                   1564: .PP
                   1565: Builds an Internet Protocol Security Authentication header. 
                   1566: .PP
                   1567: \fBParameters:\fP
                   1568: .RS 4
                   1569: \fInh\fP next header 
                   1570: .br
                   1571: \fIlen\fP payload length 
                   1572: .br
                   1573: \fIres\fP reserved 
                   1574: .br
                   1575: \fIspi\fP security parameter index 
                   1576: .br
                   1577: \fIseq\fP sequence number 
                   1578: .br
                   1579: \fIauth\fP authentication data 
                   1580: .br
                   1581: \fIpayload\fP optional payload or NULL 
                   1582: .br
                   1583: \fIpayload_s\fP payload length or 0 
                   1584: .br
                   1585: \fIl\fP pointer to a libnet context 
                   1586: .br
                   1587: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1588: .RE
                   1589: .PP
                   1590: \fBReturns:\fP
                   1591: .RS 4
                   1592: protocol tag value on success, -1 on error 
                   1593: .RE
                   1594: .PP
                   1595: 
                   1596: .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)"
                   1597: .PP
                   1598: Builds an Internet Protocol Security Encapsulating Security Payload footer. 
                   1599: .PP
                   1600: \fBParameters:\fP
                   1601: .RS 4
                   1602: \fIlen\fP padding length 
                   1603: .br
                   1604: \fInh\fP next header 
                   1605: .br
                   1606: \fIauth\fP authentication data 
                   1607: .br
                   1608: \fIpayload\fP optional payload or NULL 
                   1609: .br
                   1610: \fIpayload_s\fP payload length or 0 
                   1611: .br
                   1612: \fIl\fP pointer to a libnet context 
                   1613: .br
                   1614: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1615: .RE
                   1616: .PP
                   1617: \fBReturns:\fP
                   1618: .RS 4
                   1619: protocol tag value on success, -1 on error 
                   1620: .RE
                   1621: .PP
                   1622: 
                   1623: .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)"
                   1624: .PP
                   1625: Builds an Internet Protocol Security Encapsulating Security Payload header. 
                   1626: .PP
                   1627: \fBParameters:\fP
                   1628: .RS 4
                   1629: \fIspi\fP security parameter index 
                   1630: .br
                   1631: \fIseq\fP ESP sequence number 
                   1632: .br
                   1633: \fIiv\fP initialization vector 
                   1634: .br
                   1635: \fIpayload\fP optional payload or NULL 
                   1636: .br
                   1637: \fIpayload_s\fP payload length or 0 
                   1638: .br
                   1639: \fIl\fP pointer to a libnet context 
                   1640: .br
                   1641: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1642: .RE
                   1643: .PP
                   1644: \fBReturns:\fP
                   1645: .RS 4
                   1646: protocol tag value on success, -1 on error 
                   1647: .RE
                   1648: .PP
                   1649: 
                   1650: .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)"
                   1651: .PP
                   1652: Builds a version 4 RFC 791 Internet Protocol (IP) header. 
                   1653: .PP
                   1654: \fBParameters:\fP
                   1655: .RS 4
                   1656: \fIlen\fP total length of the IP packet including all subsequent data 
                   1657: .br
                   1658: \fItos\fP type of service bits 
                   1659: .br
                   1660: \fIid\fP IP identification number 
                   1661: .br
                   1662: \fIfrag\fP fragmentation bits and offset 
                   1663: .br
                   1664: \fIttl\fP time to live in the network 
                   1665: .br
                   1666: \fIprot\fP upper layer protocol 
                   1667: .br
                   1668: \fIsum\fP checksum (0 for libnet to autofill) 
                   1669: .br
                   1670: \fIsrc\fP source IPv4 address (little endian) 
                   1671: .br
                   1672: \fIdst\fP destination IPv4 address (little endian) 
                   1673: .br
                   1674: \fIpayload\fP optional payload or NULL 
                   1675: .br
                   1676: \fIpayload_s\fP payload length or 0 
                   1677: .br
                   1678: \fIl\fP pointer to a libnet context 
                   1679: .br
                   1680: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1681: .RE
                   1682: .PP
                   1683: \fBReturns:\fP
                   1684: .RS 4
                   1685: protocol tag value on success, -1 on error 
                   1686: .RE
                   1687: .PP
                   1688: 
                   1689: .SS "libnet_ptag_t libnet_build_ipv4_options (u_int8_t * options, u_int32_t options_s, libnet_t * l, libnet_ptag_t ptag)"
                   1690: .PP
                   1691: Builds 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. 
                   1692: .PP
                   1693: \fBParameters:\fP
                   1694: .RS 4
                   1695: \fIoptions\fP byte string of IP options 
                   1696: .br
                   1697: \fIoptions_s\fP length of options string 
                   1698: .br
                   1699: \fIl\fP pointer to a libnet context 
                   1700: .br
                   1701: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1702: .RE
                   1703: .PP
                   1704: \fBReturns:\fP
                   1705: .RS 4
                   1706: protocol tag value on success, -1 on error 
                   1707: .RE
                   1708: .PP
                   1709: 
                   1710: .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)"
                   1711: .PP
                   1712: Builds a version 6 RFC 2460 Internet Protocol (IP) header. 
                   1713: .PP
                   1714: \fBParameters:\fP
                   1715: .RS 4
                   1716: \fItc\fP traffic class 
                   1717: .br
                   1718: \fIfl\fP flow label 
                   1719: .br
                   1720: \fIlen\fP total length of the IP packet 
                   1721: .br
                   1722: \fInh\fP next header 
                   1723: .br
                   1724: \fIhl\fP hop limit 
                   1725: .br
                   1726: \fIsrc\fP source IPv6 address 
                   1727: .br
                   1728: \fIdst\fP destination IPv6 address 
                   1729: .br
                   1730: \fIpayload\fP optional payload or NULL 
                   1731: .br
                   1732: \fIpayload_s\fP payload length or 0 
                   1733: .br
                   1734: \fIl\fP pointer to a libnet context 
                   1735: .br
                   1736: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1737: .RE
                   1738: .PP
                   1739: \fBReturns:\fP
                   1740: .RS 4
                   1741: protocol tag value on success, -1 on error 
                   1742: .RE
                   1743: .PP
                   1744: 
                   1745: .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)"
                   1746: .PP
                   1747: Builds 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. 
                   1748: .PP
                   1749: \fBParameters:\fP
                   1750: .RS 4
                   1751: \fInh\fP next header 
                   1752: .br
                   1753: \fIlen\fP length of the header in 8-byte octets not including the first 8 octets 
                   1754: .br
                   1755: \fIpayload\fP options payload 
                   1756: .br
                   1757: \fIpayload_s\fP payload length 
                   1758: .br
                   1759: \fIl\fP pointer to a libnet context 
                   1760: .br
                   1761: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1762: .RE
                   1763: .PP
                   1764: \fBReturns:\fP
                   1765: .RS 4
                   1766: protocol tag value on success, -1 on error 
                   1767: .RE
                   1768: .PP
                   1769: 
                   1770: .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)"
                   1771: .PP
                   1772: Builds a version 6 RFC 2460 Internet Protocol (IP) fragmentation header. 
                   1773: .PP
                   1774: \fBParameters:\fP
                   1775: .RS 4
                   1776: \fInh\fP next header 
                   1777: .br
                   1778: \fIreserved\fP unused value... OR IS IT! 
                   1779: .br
                   1780: \fIfrag\fP fragmentation bits (ala ipv4) 
                   1781: .br
                   1782: \fIid\fP packet identification 
                   1783: .br
                   1784: \fIpayload\fP optional payload or NULL 
                   1785: .br
                   1786: \fIpayload_s\fP payload length or 0 
                   1787: .br
                   1788: \fIl\fP pointer to a libnet context 
                   1789: .br
                   1790: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1791: .RE
                   1792: .PP
                   1793: \fBReturns:\fP
                   1794: .RS 4
                   1795: protocol tag value on success, -1 on error 
                   1796: .RE
                   1797: .PP
                   1798: 
                   1799: .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)"
                   1800: .PP
                   1801: Builds 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. 
                   1802: .PP
                   1803: \fBParameters:\fP
                   1804: .RS 4
                   1805: \fInh\fP next header 
                   1806: .br
                   1807: \fIlen\fP length of the header in 8-byte octets not including the first 8 octets 
                   1808: .br
                   1809: \fIpayload\fP options payload 
                   1810: .br
                   1811: \fIpayload_s\fP payload length 
                   1812: .br
                   1813: \fIl\fP pointer to a libnet context 
                   1814: .br
                   1815: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1816: .RE
                   1817: .PP
                   1818: \fBReturns:\fP
                   1819: .RS 4
                   1820: protocol tag value on success, -1 on error 
                   1821: .RE
                   1822: .PP
                   1823: 
                   1824: .SS "libnet_ptag_t libnet_build_ipv6_routing (u_int8_t nh, u_int8_t len, u_int8_t rtype, u_int8_t segments, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   1825: .PP
                   1826: Builds a version 6 RFC 2460 Internet Protocol (IP) routing header. This function is special in that it uses the payload interface to include the 'type-specific data'; that is the routing information. Most often this will be a number of 128-bit IPv6 addresses. The application programmer will build a byte string of IPv6 address and pass them to the function using the payload interface. 
                   1827: .PP
                   1828: \fBParameters:\fP
                   1829: .RS 4
                   1830: \fInh\fP next header 
                   1831: .br
                   1832: \fIlen\fP length of the header in 8-byte octets not including the first 8 octets  routing header type 
                   1833: .br
                   1834: \fIsegments\fP number of routing segments that follow 
                   1835: .br
                   1836: \fIpayload\fP optional payload of routing information 
                   1837: .br
                   1838: \fIpayload_s\fP payload length 
                   1839: .br
                   1840: \fIl\fP pointer to a libnet context 
                   1841: .br
                   1842: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1843: .RE
                   1844: .PP
                   1845: \fBReturns:\fP
                   1846: .RS 4
                   1847: protocol tag value on success, -1 on error 
                   1848: .RE
                   1849: .PP
                   1850: 
                   1851: .SS "libnet_ptag_t libnet_build_isl (u_int8_t * dhost, u_int8_t type, u_int8_t user, u_int8_t * shost, u_int16_t len, u_int8_t * snap, u_int16_t vid, u_int16_t index, u_int16_t reserved, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   1852: .PP
                   1853: Builds a Cisco Inter-Switch Link (ISL) header. 
                   1854: .PP
                   1855: \fBParameters:\fP
                   1856: .RS 4
                   1857: \fIdhost\fP destination address (should be 01:00:0c:00:00) 
                   1858: .br
                   1859: \fItype\fP type of frame 
                   1860: .br
                   1861: \fIuser\fP user defined data 
                   1862: .br
                   1863: \fIshost\fP source mac address 
                   1864: .br
                   1865: \fIlen\fP total length of the encapuslated packet less 18 bytes 
                   1866: .br
                   1867: \fIsnap\fP SNAP information (0xaaaa03 + vendor code) 
                   1868: .br
                   1869: \fIvid\fP 15 bit VLAN ID, 1 bit BPDU or CDP indicator 
                   1870: .br
                   1871: \fIindex\fP port index 
                   1872: .br
                   1873: \fIreserved\fP used for FDDI and token ring 
                   1874: .br
                   1875: \fIpayload\fP optional payload or NULL 
                   1876: .br
                   1877: \fIpayload_s\fP payload length or 0 
                   1878: .br
                   1879: \fIl\fP pointer to a libnet context 
                   1880: .br
                   1881: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1882: .RE
                   1883: .PP
                   1884: \fBReturns:\fP
                   1885: .RS 4
                   1886: protocol tag value on success, -1 on error 
                   1887: .RE
                   1888: .PP
                   1889: 
                   1890: .SS "libnet_ptag_t libnet_build_link (u_int8_t * dst, u_int8_t * src, u_int8_t * oui, u_int16_t type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   1891: .PP
                   1892: Builds a link layer header for an initialized l. The function determines the proper link layer header format from how l was initialized. The function current supports Ethernet and Token Ring link layers. 
                   1893: .PP
                   1894: \fBParameters:\fP
                   1895: .RS 4
                   1896: \fIdst\fP the destination MAC address 
                   1897: .br
                   1898: \fIsrc\fP the source MAC address 
                   1899: .br
                   1900: \fIoui\fP Organizationally Unique Identifier (unused for Ethernet) 
                   1901: .br
                   1902: \fItype\fP the upper layer protocol type 
                   1903: .br
                   1904: \fIpayload\fP optional payload or NULL 
                   1905: .br
                   1906: \fIpayload_s\fP payload length or 0 
                   1907: .br
                   1908: \fIl\fP pointer to a libnet context 
                   1909: .br
                   1910: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1911: .RE
                   1912: .PP
                   1913: \fBReturns:\fP
                   1914: .RS 4
                   1915: protocol tag value on success, -1 on error 
                   1916: .RE
                   1917: .PP
                   1918: 
                   1919: .SS "libnet_ptag_t libnet_build_mpls (u_int32_t label, u_int8_t experimental, u_int8_t bos, u_int8_t ttl, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   1920: .PP
                   1921: Builds an RFC 3032 Multi-Protocol Label Switching (MPLS) header. 
                   1922: .PP
                   1923: \fBParameters:\fP
                   1924: .RS 4
                   1925: \fIlabel\fP 20-bit label value 
                   1926: .br
                   1927: \fIexperimental\fP 3-bit reserved field 
                   1928: .br
                   1929: \fIbos\fP 1-bit bottom of stack identifier 
                   1930: .br
                   1931: \fIttl\fP time to live 
                   1932: .br
                   1933: \fIpayload\fP optional payload or NULL 
                   1934: .br
                   1935: \fIpayload_s\fP payload length or 0 
                   1936: .br
                   1937: \fIl\fP pointer to a libnet context 
                   1938: .br
                   1939: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1940: .RE
                   1941: .PP
                   1942: \fBReturns:\fP
                   1943: .RS 4
                   1944: protocol tag value on success, -1 on error 
                   1945: .RE
                   1946: .PP
                   1947: 
                   1948: .SS "libnet_ptag_t libnet_build_ntp (u_int8_t leap_indicator, u_int8_t version, u_int8_t mode, u_int8_t stratum, u_int8_t poll, u_int8_t precision, u_int16_t delay_int, u_int16_t delay_frac, u_int16_t dispersion_int, u_int16_t dispersion_frac, u_int32_t reference_id, u_int32_t ref_ts_int, u_int32_t ref_ts_frac, u_int32_t orig_ts_int, u_int32_t orig_ts_frac, u_int32_t rec_ts_int, u_int32_t rec_ts_frac, u_int32_t xmt_ts_int, u_int32_t xmt_ts_frac, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   1949: .PP
                   1950: Builds an RFC 958 Network Time Protocol (NTP) header. 
                   1951: .PP
                   1952: \fBParameters:\fP
                   1953: .RS 4
                   1954: \fIleap_indicator\fP the leap indicator 
                   1955: .br
                   1956: \fIversion\fP NTP protocol version 
                   1957: .br
                   1958: \fImode\fP NTP mode 
                   1959: .br
                   1960: \fIstratum\fP stratum 
                   1961: .br
                   1962: \fIpoll\fP polling interval 
                   1963: .br
                   1964: \fIprecision\fP precision 
                   1965: .br
                   1966: \fIdelay_interval\fP delay interval 
                   1967: .br
                   1968: \fIdelay_frac\fP delay fraction 
                   1969: .br
                   1970: \fIdispersion_int\fP dispersion interval 
                   1971: .br
                   1972: \fIdispersion_frac\fP dispersion fraction 
                   1973: .br
                   1974: \fIreference_id\fP reference id 
                   1975: .br
                   1976: \fIref_ts_int\fP reference timestamp integer 
                   1977: .br
                   1978: \fIref_ts_frac\fP reference timestamp fraction 
                   1979: .br
                   1980: \fIorig_ts_int\fP original timestamp integer 
                   1981: .br
                   1982: \fIorig_ts_frac\fP original timestamp fraction 
                   1983: .br
                   1984: \fIrec_ts_int\fP receiver timestamp integer 
                   1985: .br
                   1986: \fIrec_ts_frac\fP reciever timestamp fraction 
                   1987: .br
                   1988: \fIxmt_ts_int\fP transmit timestamp integer 
                   1989: .br
                   1990: \fIxmt_ts_frac\fP transmit timestamp integer 
                   1991: .br
                   1992: \fIpayload\fP optional payload or NULL 
                   1993: .br
                   1994: \fIpayload_s\fP payload length or 0 
                   1995: .br
                   1996: \fIl\fP pointer to a libnet context 
                   1997: .br
                   1998: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   1999: .RE
                   2000: .PP
                   2001: \fBReturns:\fP
                   2002: .RS 4
                   2003: protocol tag value on success, -1 on error 
                   2004: .RE
                   2005: .PP
                   2006: 
                   2007: .SS "libnet_ptag_t libnet_build_ospfv2 (u_int16_t len, u_int8_t type, u_int32_t rtr_id, u_int32_t area_id, u_int16_t sum, u_int16_t autype, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2008: .PP
                   2009: \fBParameters:\fP
                   2010: .RS 4
                   2011: \fIpayload\fP optional payload or NULL 
                   2012: .br
                   2013: \fIpayload_s\fP payload length or 0 
                   2014: .br
                   2015: \fIl\fP pointer to a libnet context 
                   2016: .br
                   2017: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2018: .RE
                   2019: .PP
                   2020: \fBReturns:\fP
                   2021: .RS 4
                   2022: protocol tag value on success, -1 on error 
                   2023: .RE
                   2024: .PP
                   2025: 
                   2026: .SS "libnet_ptag_t libnet_build_ospfv2_dbd (u_int16_t dgram_len, u_int8_t opts, u_int8_t type, u_int seqnum, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2027: .PP
                   2028: \fBParameters:\fP
                   2029: .RS 4
                   2030: \fIpayload\fP optional payload or NULL 
                   2031: .br
                   2032: \fIpayload_s\fP payload length or 0 
                   2033: .br
                   2034: \fIl\fP pointer to a libnet context 
                   2035: .br
                   2036: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2037: .RE
                   2038: .PP
                   2039: \fBReturns:\fP
                   2040: .RS 4
                   2041: protocol tag value on success, -1 on error 
                   2042: .RE
                   2043: .PP
                   2044: 
                   2045: .SS "libnet_ptag_t libnet_build_ospfv2_hello (u_int32_t netmask, u_int16_t interval, u_int8_t opts, u_int8_t priority, u_int dead_int, u_int32_t des_rtr, u_int32_t bkup_rtr, u_int32_t neighbor, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2046: .PP
                   2047: \fBParameters:\fP
                   2048: .RS 4
                   2049: \fIpayload\fP optional payload or NULL 
                   2050: .br
                   2051: \fIpayload_s\fP payload length or 0 
                   2052: .br
                   2053: \fIl\fP pointer to a libnet context 
                   2054: .br
                   2055: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2056: .RE
                   2057: .PP
                   2058: \fBReturns:\fP
                   2059: .RS 4
                   2060: protocol tag value on success, -1 on error 
                   2061: .RE
                   2062: .PP
                   2063: 
                   2064: .SS "libnet_ptag_t libnet_build_ospfv2_lsa (u_int16_t age, u_int8_t opts, u_int8_t type, u_int lsid, u_int32_t advrtr, u_int seqnum, u_int16_t sum, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2065: .PP
                   2066: \fBParameters:\fP
                   2067: .RS 4
                   2068: \fIpayload\fP optional payload or NULL 
                   2069: .br
                   2070: \fIpayload_s\fP payload length or 0 
                   2071: .br
                   2072: \fIl\fP pointer to a libnet context 
                   2073: .br
                   2074: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2075: .RE
                   2076: .PP
                   2077: \fBReturns:\fP
                   2078: .RS 4
                   2079: protocol tag value on success, -1 on error 
                   2080: .RE
                   2081: .PP
                   2082: 
                   2083: .SS "libnet_ptag_t libnet_build_ospfv2_lsa_as (u_int32_t nmask, u_int metric, u_int32_t fwdaddr, u_int tag, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2084: .PP
                   2085: \fBParameters:\fP
                   2086: .RS 4
                   2087: \fIpayload\fP optional payload or NULL 
                   2088: .br
                   2089: \fIpayload_s\fP payload length or 0 
                   2090: .br
                   2091: \fIl\fP pointer to a libnet context 
                   2092: .br
                   2093: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2094: .RE
                   2095: .PP
                   2096: \fBReturns:\fP
                   2097: .RS 4
                   2098: protocol tag value on success, -1 on error 
                   2099: .RE
                   2100: .PP
                   2101: 
                   2102: .SS "libnet_ptag_t libnet_build_ospfv2_lsa_net (u_int32_t nmask, u_int rtrid, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2103: .PP
                   2104: \fBParameters:\fP
                   2105: .RS 4
                   2106: \fIpayload\fP optional payload or NULL 
                   2107: .br
                   2108: \fIpayload_s\fP payload length or 0 
                   2109: .br
                   2110: \fIl\fP pointer to a libnet context 
                   2111: .br
                   2112: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2113: .RE
                   2114: .PP
                   2115: \fBReturns:\fP
                   2116: .RS 4
                   2117: protocol tag value on success, -1 on error 
                   2118: .RE
                   2119: .PP
                   2120: 
                   2121: .SS "libnet_ptag_t libnet_build_ospfv2_lsa_rtr (u_int16_t flags, u_int16_t num, u_int id, u_int data, u_int8_t type, u_int8_t tos, u_int16_t metric, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2122: .PP
                   2123: \fBParameters:\fP
                   2124: .RS 4
                   2125: \fIpayload\fP optional payload or NULL 
                   2126: .br
                   2127: \fIpayload_s\fP payload length or 0 
                   2128: .br
                   2129: \fIl\fP pointer to a libnet context 
                   2130: .br
                   2131: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2132: .RE
                   2133: .PP
                   2134: \fBReturns:\fP
                   2135: .RS 4
                   2136: protocol tag value on success, -1 on error 
                   2137: .RE
                   2138: .PP
                   2139: 
                   2140: .SS "libnet_ptag_t libnet_build_ospfv2_lsa_sum (u_int32_t nmask, u_int metric, u_int tos, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2141: .PP
                   2142: \fBParameters:\fP
                   2143: .RS 4
                   2144: \fIpayload\fP optional payload or NULL 
                   2145: .br
                   2146: \fIpayload_s\fP payload length or 0 
                   2147: .br
                   2148: \fIl\fP pointer to a libnet context 
                   2149: .br
                   2150: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2151: .RE
                   2152: .PP
                   2153: \fBReturns:\fP
                   2154: .RS 4
                   2155: protocol tag value on success, -1 on error 
                   2156: .RE
                   2157: .PP
                   2158: 
                   2159: .SS "libnet_ptag_t libnet_build_ospfv2_lsr (u_int type, u_int lsid, u_int32_t advrtr, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2160: .PP
                   2161: \fBParameters:\fP
                   2162: .RS 4
                   2163: \fIpayload\fP optional payload or NULL 
                   2164: .br
                   2165: \fIpayload_s\fP payload length or 0 
                   2166: .br
                   2167: \fIl\fP pointer to a libnet context 
                   2168: .br
                   2169: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2170: .RE
                   2171: .PP
                   2172: \fBReturns:\fP
                   2173: .RS 4
                   2174: protocol tag value on success, -1 on error 
                   2175: .RE
                   2176: .PP
                   2177: 
                   2178: .SS "libnet_ptag_t libnet_build_ospfv2_lsu (u_int num, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2179: .PP
                   2180: \fBParameters:\fP
                   2181: .RS 4
                   2182: \fIpayload\fP optional payload or NULL 
                   2183: .br
                   2184: \fIpayload_s\fP payload length or 0 
                   2185: .br
                   2186: \fIl\fP pointer to a libnet context 
                   2187: .br
                   2188: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2189: .RE
                   2190: .PP
                   2191: \fBReturns:\fP
                   2192: .RS 4
                   2193: protocol tag value on success, -1 on error 
                   2194: .RE
                   2195: .PP
                   2196: 
                   2197: .SS "libnet_ptag_t libnet_build_rip (u_int8_t cmd, u_int8_t version, u_int16_t rd, u_int16_t af, u_int16_t rt, u_int32_t addr, u_int32_t mask, u_int32_t next_hop, u_int32_t metric, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2198: .PP
                   2199: Builds a Routing Information Protocol header (RFCs 1058 and 2453). 
                   2200: .PP
                   2201: \fBParameters:\fP
                   2202: .RS 4
                   2203: \fIcmd\fP command 
                   2204: .br
                   2205: \fIversion\fP protocol version 
                   2206: .br
                   2207: \fIrd\fP version one: 0, version two: routing domain 
                   2208: .br
                   2209: \fIaf\fP address family 
                   2210: .br
                   2211: \fIrt\fP version one: 0, version two: route tag 
                   2212: .br
                   2213: \fIaddr\fP IPv4 address 
                   2214: .br
                   2215: \fImask\fP version one: 0, version two: subnet mask 
                   2216: .br
                   2217: \fInext_hop\fP version one: 0, version two: next hop address 
                   2218: .br
                   2219: \fImetric\fP routing metric 
                   2220: .br
                   2221: \fIpayload\fP optional payload or NULL 
                   2222: .br
                   2223: \fIpayload_s\fP payload length or 0 
                   2224: .br
                   2225: \fIl\fP pointer to a libnet context 
                   2226: .br
                   2227: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2228: .RE
                   2229: .PP
                   2230: \fBReturns:\fP
                   2231: .RS 4
                   2232: protocol tag value on success, -1 on error 
                   2233: .RE
                   2234: .PP
                   2235: 
                   2236: .SS "libnet_ptag_t libnet_build_rpc_call (u_int32_t rm, u_int32_t xid, u_int32_t prog_num, u_int32_t prog_vers, u_int32_t procedure, u_int32_t cflavor, u_int32_t clength, u_int8_t * cdata, u_int32_t vflavor, u_int32_t vlength, u_int8_t * vdata, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2237: .PP
                   2238: Builds an Remote Procedure Call (Version 2) Call message header as specified in RFC 1831. This builder provides the option for specifying the record marking which is required when used with streaming protocols (TCP). 
                   2239: .PP
                   2240: \fBParameters:\fP
                   2241: .RS 4
                   2242: \fIrm\fP record marking indicating the position in a stream, 0 otherwise 
                   2243: .br
                   2244: \fIxid\fP transaction identifier used to link calls and replies 
                   2245: .br
                   2246: \fIprog_num\fP remote program specification typically between 0 - 1fffffff 
                   2247: .br
                   2248: \fIprog_vers\fP remote program version specification 
                   2249: .br
                   2250: \fIprocedure\fP procedure to be performed by remote program 
                   2251: .br
                   2252: \fIcflavor\fP authentication credential type 
                   2253: .br
                   2254: \fIclength\fP credential length (should be 0) 
                   2255: .br
                   2256: \fIcdata\fP opaque credential data (currently unused) 
                   2257: .br
                   2258: \fIvflavor\fP authentication verifier type 
                   2259: .br
                   2260: \fIvlength\fP verifier length (should be 0) 
                   2261: .br
                   2262: \fIvdata\fP opaque verifier data (currently unused) 
                   2263: .br
                   2264: \fIpayload\fP optional payload or NULL 
                   2265: .br
                   2266: \fIpayload_s\fP payload length or 0 
                   2267: .br
                   2268: \fIl\fP pointer to a libnet context 
                   2269: .br
                   2270: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2271: .RE
                   2272: .PP
                   2273: \fBReturns:\fP
                   2274: .RS 4
                   2275: protocol tag value on success, -1 on error 
                   2276: .RE
                   2277: .PP
                   2278: 
                   2279: .SS "libnet_ptag_t libnet_build_sebek (u_int32_t magic, u_int16_t version, u_int16_t type, u_int32_t counter, u_int32_t time_sec, u_int32_t time_usec, u_int32_t pid, u_int32_t uid, u_int32_t fd, u_int8_t cmd[SEBEK_CMD_LENGTH], u_int32_t length, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2280: .PP
                   2281: Builds a Sebek header. The Sebek protocol was designed by the Honeynet Project as a transport mechanism for post-intrusion forensic data. More information may be found here: http://www.honeynet.org/papers/sebek.pdf.
                   2282: .PP
                   2283: \fBParameters:\fP
                   2284: .RS 4
                   2285: \fImagic\fP identify packets that should be hidden 
                   2286: .br
                   2287: \fIversion\fP protocol version, currently 1 
                   2288: .br
                   2289: \fItype\fP type of record (read data is type 0, write data is type 1) 
                   2290: .br
                   2291: \fIcounter\fP PDU counter used to identify when packet are lost 
                   2292: .br
                   2293: \fItime_sec\fP seconds since EPOCH according to the honeypot 
                   2294: .br
                   2295: \fItime_usec\fP residual microseconds 
                   2296: .br
                   2297: \fIpid\fP PID 
                   2298: .br
                   2299: \fIuid\fP UID 
                   2300: .br
                   2301: \fIfd\fP FD 
                   2302: .br
                   2303: \fIcmd[SEBEK_CMD_LENGTH]\fP 12 first characters of the command 
                   2304: .br
                   2305: \fIlength\fP length in bytes of the PDU's body 
                   2306: .br
                   2307: \fIpayload\fP optional payload or NULL 
                   2308: .br
                   2309: \fIpayload_s\fP payload length or 0 
                   2310: .br
                   2311: \fIl\fP pointer to a libnet context 
                   2312: .br
                   2313: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2314: .RE
                   2315: .PP
                   2316: \fBReturns:\fP
                   2317: .RS 4
                   2318: protocol tag value on success, -1 on error 
                   2319: .RE
                   2320: .PP
                   2321: 
                   2322: .SS "libnet_ptag_t libnet_build_stp_conf (u_int16_t id, u_int8_t version, u_int8_t bpdu_type, u_int8_t flags, u_int8_t * root_id, u_int32_t root_pc, u_int8_t * bridge_id, u_int16_t port_id, u_int16_t message_age, u_int16_t max_age, u_int16_t hello_time, u_int16_t f_delay, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2323: .PP
                   2324: Builds an IEEE 802.1d Spanning Tree Protocol (STP) configuration header. STP frames are usually encapsulated inside of an 802.2 + 802.3 frame combination. 
                   2325: .PP
                   2326: \fBParameters:\fP
                   2327: .RS 4
                   2328: \fIid\fP protocol id 
                   2329: .br
                   2330: \fIversion\fP protocol version 
                   2331: .br
                   2332: \fIbpdu_type\fP bridge protocol data unit type 
                   2333: .br
                   2334: \fIflags\fP flags 
                   2335: .br
                   2336: \fIroot_id\fP root id 
                   2337: .br
                   2338: \fIroot_pc\fP root path cost 
                   2339: .br
                   2340: \fIbridge_id\fP bridge id 
                   2341: .br
                   2342: \fIport_id\fP port id 
                   2343: .br
                   2344: \fImessage_age\fP message age 
                   2345: .br
                   2346: \fImax_age\fP max age 
                   2347: .br
                   2348: \fIhello_time\fP hello time 
                   2349: .br
                   2350: \fIf_delay\fP forward delay 
                   2351: .br
                   2352: \fIpayload\fP optional payload or NULL 
                   2353: .br
                   2354: \fIpayload_s\fP payload length or 0 
                   2355: .br
                   2356: \fIl\fP pointer to a libnet context 
                   2357: .br
                   2358: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2359: .RE
                   2360: .PP
                   2361: \fBReturns:\fP
                   2362: .RS 4
                   2363: protocol tag value on success, -1 on error 
                   2364: .RE
                   2365: .PP
                   2366: 
                   2367: .SS "libnet_ptag_t libnet_build_stp_tcn (u_int16_t id, u_int8_t version, u_int8_t bpdu_type, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2368: .PP
                   2369: Builds an IEEE 802.1d Spanning Tree Protocol (STP) topology change notification header. STP frames are usually encapsulated inside of an 802.2 + 802.3 frame combination. 
                   2370: .PP
                   2371: \fBParameters:\fP
                   2372: .RS 4
                   2373: \fIid\fP protocol id 
                   2374: .br
                   2375: \fIversion\fP protocol version 
                   2376: .br
                   2377: \fIbpdu_type\fP bridge protocol data unit type 
                   2378: .br
                   2379: \fIpayload\fP optional payload or NULL 
                   2380: .br
                   2381: \fIpayload_s\fP payload length or 0 
                   2382: .br
                   2383: \fIl\fP pointer to a libnet context 
                   2384: .br
                   2385: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2386: .RE
                   2387: .PP
                   2388: \fBReturns:\fP
                   2389: .RS 4
                   2390: protocol tag value on success, -1 on error 
                   2391: .RE
                   2392: .PP
                   2393: 
                   2394: .SS "libnet_ptag_t libnet_build_tcp (u_int16_t sp, u_int16_t dp, u_int32_t seq, u_int32_t ack, u_int8_t control, u_int16_t win, u_int16_t sum, u_int16_t urg, u_int16_t len, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2395: .PP
                   2396: Builds an RFC 793 Transmission Control Protocol (TCP) header. 
                   2397: .PP
                   2398: \fBParameters:\fP
                   2399: .RS 4
                   2400: \fIsp\fP source port 
                   2401: .br
                   2402: \fIdp\fP destination port 
                   2403: .br
                   2404: \fIseq\fP sequence number 
                   2405: .br
                   2406: \fIack\fP acknowledgement number 
                   2407: .br
                   2408: \fIcontrol\fP control flags 
                   2409: .br
                   2410: \fIwin\fP window size 
                   2411: .br
                   2412: \fIsum\fP checksum (0 for libnet to autofill) 
                   2413: .br
                   2414: \fIurg\fP urgent pointer  len total length of the TCP packet (for checksum calculation) 
                   2415: .br
                   2416: \fIpayload_s\fP payload length or 0 
                   2417: .br
                   2418: \fIl\fP pointer to a libnet context 
                   2419: .br
                   2420: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2421: .RE
                   2422: .PP
                   2423: \fBReturns:\fP
                   2424: .RS 4
                   2425: protocol tag value on success, -1 on error 
                   2426: .RE
                   2427: .PP
                   2428: 
                   2429: .SS "libnet_ptag_t libnet_build_tcp_options (u_int8_t * options, u_int32_t options_s, libnet_t * l, libnet_ptag_t ptag)"
                   2430: .PP
                   2431: Builds an RFC 793 Transmission Control Protocol (TCP) options header. The function expects options to be a valid TCP options string of size options_s, which is no larger than 40 bytes (the maximum size of an options string). The function checks to ensure that the packet consists of a TCP header preceded by an IPv4 header, and that the addition of 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 TCP header length value as necessary. 
                   2432: .PP
                   2433: \fBParameters:\fP
                   2434: .RS 4
                   2435: \fIoptions\fP byte string of TCP options 
                   2436: .br
                   2437: \fIoptions_s\fP length of options string 
                   2438: .br
                   2439: \fIl\fP pointer to a libnet context 
                   2440: .br
                   2441: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2442: .RE
                   2443: .PP
                   2444: \fBReturns:\fP
                   2445: .RS 4
                   2446: protocol tag value on success, -1 on error 
                   2447: .RE
                   2448: .PP
                   2449: 
                   2450: .SS "libnet_ptag_t libnet_build_token_ring (u_int8_t ac, 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)"
                   2451: .PP
                   2452: Builds a token ring header. 
                   2453: .PP
                   2454: \fBParameters:\fP
                   2455: .RS 4
                   2456: \fIac\fP access control 
                   2457: .br
                   2458: \fIfc\fP frame control 
                   2459: .br
                   2460: \fIdst\fP destination address 
                   2461: .br
                   2462: \fIsrc\fP source address 
                   2463: .br
                   2464: \fIdsap\fP destination service access point 
                   2465: .br
                   2466: \fIssap\fP source service access point 
                   2467: .br
                   2468: \fIcf\fP control field 
                   2469: .br
                   2470: \fIoui\fP Organizationally Unique Identifier 
                   2471: .br
                   2472: \fItype\fP upper layer protocol type 
                   2473: .br
                   2474: \fIpayload\fP optional payload or NULL 
                   2475: .br
                   2476: \fIpayload_s\fP payload length or 0 
                   2477: .br
                   2478: \fIl\fP pointer to a libnet context 
                   2479: .br
                   2480: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2481: .RE
                   2482: .PP
                   2483: \fBReturns:\fP
                   2484: .RS 4
                   2485: protocol tag value on success, -1 on error 
                   2486: .RE
                   2487: .PP
                   2488: 
                   2489: .SS "libnet_ptag_t libnet_build_udp (u_int16_t sp, u_int16_t dp, u_int16_t len, u_int16_t sum, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2490: .PP
                   2491: Builds an RFC 768 User Datagram Protocol (UDP) header. 
                   2492: .PP
                   2493: \fBParameters:\fP
                   2494: .RS 4
                   2495: \fIsp\fP source port 
                   2496: .br
                   2497: \fIdp\fP destination port 
                   2498: .br
                   2499: \fIlen\fP total length of the UDP packet 
                   2500: .br
                   2501: \fIsum\fP checksum (0 for libnet to autofill) 
                   2502: .br
                   2503: \fIpayload\fP optional payload or NULL 
                   2504: .br
                   2505: \fIpayload_s\fP payload length or 0 
                   2506: .br
                   2507: \fIl\fP pointer to a libnet context 
                   2508: .br
                   2509: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2510: .RE
                   2511: .PP
                   2512: \fBReturns:\fP
                   2513: .RS 4
                   2514: protocol tag value on success, -1 on error 
                   2515: .RE
                   2516: .PP
                   2517: 
                   2518: .SS "libnet_ptag_t libnet_build_vrrp (u_int8_t version, u_int8_t type, u_int8_t vrouter_id, u_int8_t priority, u_int8_t ip_count, u_int8_t auth_type, u_int8_t advert_int, u_int16_t sum, u_int8_t * payload, u_int32_t payload_s, libnet_t * l, libnet_ptag_t ptag)"
                   2519: .PP
                   2520: Builds an RFC 2338 Virtual Router Redundacy Protool (VRRP) header. Use the payload interface to specify address and autthentication information. To build a 'legal' packet, the destination IPv4 address should be the multicast * address 224.0.0.18, the IP TTL should be set to 255, and the IP protocol should be set to 112. 
                   2521: .PP
                   2522: \fBParameters:\fP
                   2523: .RS 4
                   2524: \fIversion\fP VRRP version (should be 2) 
                   2525: .br
                   2526: \fItype\fP VRRP packet type (should be 1 -- ADVERTISEMENT) 
                   2527: .br
                   2528: \fIvrouter_id\fP virtual router identification 
                   2529: .br
                   2530: \fIpriority\fP priority (higher numbers indicate higher priority) 
                   2531: .br
                   2532: \fIip_count\fP number of IPv4 addresses contained in this advertisement 
                   2533: .br
                   2534: \fIauth_type\fP type of authentication (0, 1, 2 -- see RFC) 
                   2535: .br
                   2536: \fIadvert_int\fP interval between advertisements 
                   2537: .br
                   2538: \fIsum\fP checksum (0 for libnet to autofill) 
                   2539: .br
                   2540: \fIpayload\fP optional payload or NULL 
                   2541: .br
                   2542: \fIpayload_s\fP payload length or 0 
                   2543: .br
                   2544: \fIl\fP pointer to a libnet context 
                   2545: .br
                   2546: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2547: .RE
                   2548: .PP
                   2549: \fBReturns:\fP
                   2550: .RS 4
                   2551: protocol tag value on success, -1 on error 
                   2552: .RE
                   2553: .PP
                   2554: 
                   2555: .SS "void libnet_clear_packet (libnet_t * l)"
                   2556: .PP
                   2557: Clears the current packet referenced and frees all pblocks. Should be called when the programmer want to send a completely new packet of a different type using the same context. 
                   2558: .PP
                   2559: \fBParameters:\fP
                   2560: .RS 4
                   2561: \fIl\fP pointer to a libnet context 
                   2562: .RE
                   2563: .PP
                   2564: 
                   2565: .SS "int libnet_cq_add (libnet_t * l, char * label)"
                   2566: .PP
                   2567: [Context Queue] Adds a new context to the libnet context queue. If no queue exists, this function will create the queue and add the specified libnet context as the first entry on the list. The functions checks to ensure niether l nor label are NULL, and that label doesn't refer to an existing context already in the queue. Additionally, l should refer to a libnet context previously initialized with a call to \fBlibnet_init()\fP. If the context queue in write locked, this function will fail. 
                   2568: .PP
                   2569: \fBParameters:\fP
                   2570: .RS 4
                   2571: \fIl\fP pointer to a libnet context 
                   2572: .br
                   2573: \fIlabel\fP a canonical name given to recognize the new context, no longer than LIBNET_LABEL_SIZE 
                   2574: .RE
                   2575: .PP
                   2576: \fBReturns:\fP
                   2577: .RS 4
                   2578: 1 on success, -1 on failure 
                   2579: .RE
                   2580: .PP
                   2581: 
                   2582: .SS "void libnet_cq_destroy ()"
                   2583: .PP
                   2584: [Context Queue] Destroys the entire context queue, calling \fBlibnet_destroy()\fP on each member context. 
                   2585: .SS "libnet_t* libnet_cq_find_by_label (char * label)"
                   2586: .PP
                   2587: [Context Queue] Locates a libnet context from the queue, indexed by a canonical label. 
                   2588: .PP
                   2589: \fBParameters:\fP
                   2590: .RS 4
                   2591: \fIlabel\fP canonical label of the libnet context to retrieve 
                   2592: .RE
                   2593: .PP
                   2594: \fBReturns:\fP
                   2595: .RS 4
                   2596: the expected libnet context, NULL on failure 
                   2597: .RE
                   2598: .PP
                   2599: 
                   2600: .SS "int8_t* libnet_cq_getlabel (libnet_t * l)"
                   2601: .PP
                   2602: [Context Queue] Returns the canonical label associated with the context. 
                   2603: .PP
                   2604: \fBParameters:\fP
                   2605: .RS 4
                   2606: \fIl\fP pointer to a libnet context 
                   2607: .RE
                   2608: .PP
                   2609: \fBReturns:\fP
                   2610: .RS 4
                   2611: pointer to the libnet context's label 
                   2612: .RE
                   2613: .PP
                   2614: 
                   2615: .SS "libnet_t* libnet_cq_head ()"
                   2616: .PP
                   2617: [Context Queue] Intiailizes the interator interface and set a write lock on the entire queue. This function is intended to be called just prior to interating through the entire list of contexts (with the probable intent of inject a series of packets in rapid succession). This function is often used as per the following:
                   2618: .PP
                   2619: for (l = \fBlibnet_cq_head()\fP; \fBlibnet_cq_last()\fP; l = \fBlibnet_cq_next()\fP) { ... }
                   2620: .PP
                   2621: Much of the time, the application programmer will use the iterator as it is written above; as such, libnet provides a macro to do exactly that, \fBfor_each_context_in_cq(l)\fP. Warning: do not call the iterator more than once in a single loop. 
                   2622: .PP
                   2623: \fBReturns:\fP
                   2624: .RS 4
                   2625: the head of the context queue 
                   2626: .RE
                   2627: .PP
                   2628: 
                   2629: .SS "int libnet_cq_last ()"
                   2630: .PP
                   2631: [Context Queue] Check whether the iterator is at the last context in the queue. 
                   2632: .PP
                   2633: \fBReturns:\fP
                   2634: .RS 4
                   2635: 1 if at the end of the context queue, 0 otherwise 
                   2636: .RE
                   2637: .PP
                   2638: 
                   2639: .SS "libnet_t* libnet_cq_next ()"
                   2640: .PP
                   2641: [Context Queue] Get next context from the context queue.  the next context from the context queue 
                   2642: .SS "libnet_t* libnet_cq_remove (libnet_t * l)"
                   2643: .PP
                   2644: [Context Queue] Removes a specified context from the libnet context queue by specifying the libnet context pointer. Note the function will remove the specified context from the context queue and cleanup internal memory from the queue, it is up to the application programmer to free the returned libnet context with a call to \fBlibnet_destroy()\fP. Also, as it is not necessary to keep the libnet context pointer when initially adding it to the context queue, most application programmers will prefer to refer to entries on the context queue by canonical name and would use \fBlibnet_cq_remove_by_label()\fP. If the context queue is write locked, this function will fail. 
                   2645: .PP
                   2646: \fBParameters:\fP
                   2647: .RS 4
                   2648: \fIl\fP pointer to a libnet context 
                   2649: .RE
                   2650: .PP
                   2651: \fBReturns:\fP
                   2652: .RS 4
                   2653: the pointer to the removed libnet context, NULL on failure 
                   2654: .RE
                   2655: .PP
                   2656: 
                   2657: .SS "libnet_t* libnet_cq_remove_by_label (char * label)"
                   2658: .PP
                   2659: [Context Queue] Removes a specified context from the libnet context queue by specifying the canonical name. Note the function will remove the specified context from the context queue and cleanup internal memory from the queue, it is up to the application programmer to free the returned libnet context with a call to \fBlibnet_destroy()\fP. If the context queue is write locked, this function will fail. 
                   2660: .PP
                   2661: \fBParameters:\fP
                   2662: .RS 4
                   2663: \fIlabel\fP canonical name of the context to remove 
                   2664: .RE
                   2665: .PP
                   2666: \fBReturns:\fP
                   2667: .RS 4
                   2668: the pointer to the removed libnet context, NULL on failure 
                   2669: .RE
                   2670: .PP
                   2671: 
                   2672: .SS "u_int32_t libnet_cq_size ()"
                   2673: .PP
                   2674: [Context Queue] Function returns the number of libnet contexts that are in the queue. 
                   2675: .PP
                   2676: \fBReturns:\fP
                   2677: .RS 4
                   2678: the number of libnet contexts currently in the queue 
                   2679: .RE
                   2680: .PP
                   2681: 
                   2682: .SS "void libnet_destroy (libnet_t * l)"
                   2683: .PP
                   2684: Shuts down the libnet session referenced by l. It closes the network interface and frees all internal memory structures associated with l. 
                   2685: .PP
                   2686: \fBParameters:\fP
                   2687: .RS 4
                   2688: \fIl\fP pointer to a libnet context 
                   2689: .RE
                   2690: .PP
                   2691: 
                   2692: .SS "void libnet_diag_dump_context (libnet_t * l)"
                   2693: .PP
                   2694: [Diagnostic] Prints the contents of the given context. 
                   2695: .PP
                   2696: \fBParameters:\fP
                   2697: .RS 4
                   2698: \fIl\fP pointer to a libnet context 
                   2699: .RE
                   2700: .PP
                   2701: 
                   2702: .SS "void libnet_diag_dump_hex (u_int8_t * packet, u_int32_t len, int swap, FILE * stream)"
                   2703: .PP
                   2704: [Diagnostic] Function prints the contents of the supplied buffer to the supplied stream pointer. Will swap endianness based disposition of mode variable. Useful to be used in conjunction with the advanced interface and a culled packet. 
                   2705: .PP
                   2706: \fBParameters:\fP
                   2707: .RS 4
                   2708: \fIpacket\fP the packet to print 
                   2709: .br
                   2710: \fIlen\fP length of the packet in bytes 
                   2711: .br
                   2712: \fIswap\fP 1 to swap byte order, 0 to not 
                   2713: .br
                   2714: \fIstream\fP a stream pointer to print to 
                   2715: .RE
                   2716: .PP
                   2717: 
                   2718: .SS "void libnet_diag_dump_pblock (libnet_t * l)"
                   2719: .PP
                   2720: [Diagnostic] Prints the contents of every pblock. 
                   2721: .PP
                   2722: \fBParameters:\fP
                   2723: .RS 4
                   2724: \fIl\fP pointer to a libnet context 
                   2725: .RE
                   2726: .PP
                   2727: 
                   2728: .SS "char* libnet_diag_dump_pblock_type (u_int8_t type)"
                   2729: .PP
                   2730: [Diagnostic] Returns the canonical name of the pblock type. 
                   2731: .PP
                   2732: \fBParameters:\fP
                   2733: .RS 4
                   2734: \fItype\fP pblock type 
                   2735: .RE
                   2736: .PP
                   2737: \fBReturns:\fP
                   2738: .RS 4
                   2739: a string representing the pblock type type or 'unknown' for an unknown value 
                   2740: .RE
                   2741: .PP
                   2742: 
                   2743: .SS "struct libnet_ether_addr* libnet_get_hwaddr (libnet_t * l)"
                   2744: .PP
                   2745: Returns the MAC address for the device libnet was initialized with. If libnet was initialized without a device the function will attempt to find one. If the function fails and returns NULL a call to \fBlibnet_geterror()\fP will tell you why. 
                   2746: .PP
                   2747: \fBParameters:\fP
                   2748: .RS 4
                   2749: \fIl\fP pointer to a libnet context 
                   2750: .RE
                   2751: .PP
                   2752: \fBReturns:\fP
                   2753: .RS 4
                   2754: a pointer to the MAC address or NULL 
                   2755: .RE
                   2756: .PP
                   2757: 
                   2758: .SS "u_int32_t libnet_get_ipaddr4 (libnet_t * l)"
                   2759: .PP
                   2760: Returns the IP address for the device libnet was initialized with. If libnet was initialized without a device (in raw socket mode) the function will attempt to find one. If the function fails and returns -1 a call to libnet_geterrror() will tell you why. 
                   2761: .PP
                   2762: \fBParameters:\fP
                   2763: .RS 4
                   2764: \fIl\fP pointer to a libnet context 
                   2765: .RE
                   2766: .PP
                   2767: \fBReturns:\fP
                   2768: .RS 4
                   2769: a big endian IP address suitable for use in a libnet_build function or -1 
                   2770: .RE
                   2771: .PP
                   2772: 
                   2773: .SS "struct libnet_in6_addr libnet_get_ipaddr6 (libnet_t * l)"
                   2774: .PP
                   2775: This function is not yet implemented under IPv6. 
                   2776: .PP
                   2777: \fBParameters:\fP
                   2778: .RS 4
                   2779: \fIl\fP pointer to a libnet context 
                   2780: .RE
                   2781: .PP
                   2782: \fBReturns:\fP
                   2783: .RS 4
                   2784: well, nothing yet 
                   2785: .RE
                   2786: .PP
                   2787: 
                   2788: .SS "u_int32_t libnet_get_prand (int mod)"
                   2789: .PP
                   2790: Generates an unsigned psuedo-random value within the range specified by mod. LIBNET_PR2 0 - 1 LIBNET_PR8 0 - 255 LIBNET_PR16 0 - 32767 LIBNET_PRu16 0 - 65535 LIBNET_PR32 0 - 2147483647 LIBNET_PRu32 0 - 4294967295
                   2791: .PP
                   2792: \fBParameters:\fP
                   2793: .RS 4
                   2794: \fImod\fP one the of LIBNET_PR* constants 
                   2795: .RE
                   2796: .PP
                   2797: \fBReturns:\fP
                   2798: .RS 4
                   2799: 1 on success, -1 on failure 
                   2800: .RE
                   2801: .PP
                   2802: 
                   2803: .SS "int8_t* libnet_getdevice (libnet_t * l)"
                   2804: .PP
                   2805: Returns the canonical name of the device used for packet injection. 
                   2806: .PP
                   2807: \fBParameters:\fP
                   2808: .RS 4
                   2809: \fIl\fP pointer to a libnet context 
                   2810: .RE
                   2811: .PP
                   2812: \fBReturns:\fP
                   2813: .RS 4
                   2814: the canonical name of the device used for packet injection. Note it can be NULL without being an error. 
                   2815: .RE
                   2816: .PP
                   2817: 
                   2818: .SS "char* libnet_geterror (libnet_t * l)"
                   2819: .PP
                   2820: Returns the last error set inside of the referenced libnet context. This function should be called anytime a function fails or an error condition is detected inside of libnet. 
                   2821: .PP
                   2822: \fBParameters:\fP
                   2823: .RS 4
                   2824: \fIl\fP pointer to a libnet context 
                   2825: .RE
                   2826: .PP
                   2827: \fBReturns:\fP
                   2828: .RS 4
                   2829: an error string or NULL if no error has occured 
                   2830: .RE
                   2831: .PP
                   2832: 
                   2833: .SS "int libnet_getfd (libnet_t * l)"
                   2834: .PP
                   2835: Returns the FILENO of the file descriptor used for packet injection. 
                   2836: .PP
                   2837: \fBParameters:\fP
                   2838: .RS 4
                   2839: \fIl\fP pointer to a libnet context 
                   2840: .RE
                   2841: .PP
                   2842: \fBReturns:\fP
                   2843: .RS 4
                   2844: the file number of the file descriptor used for packet injection 
                   2845: .RE
                   2846: .PP
                   2847: 
                   2848: .SS "u_int32_t libnet_getgre_length (u_int16_t fv)\fC [inline]\fP"
                   2849: .PP
                   2850: \fBParameters:\fP
                   2851: .RS 4
                   2852: \fIpayload\fP optional payload or NULL 
                   2853: .br
                   2854: \fIpayload_s\fP payload length or 0 
                   2855: .br
                   2856: \fIl\fP pointer to a libnet context 
                   2857: .br
                   2858: \fIptag\fP protocol tag to modify an existing header, 0 to build a new one 
                   2859: .RE
                   2860: .PP
                   2861: \fBReturns:\fP
                   2862: .RS 4
                   2863: protocol tag value on success, -1 on error 
                   2864: .RE
                   2865: .PP
                   2866: 
                   2867: .SS "u_int32_t libnet_getpacket_size (libnet_t * l)"
                   2868: .PP
                   2869: Returns the sum of the size of all of the pblocks inside of l (this should be the resuling packet size). 
                   2870: .PP
                   2871: \fBParameters:\fP
                   2872: .RS 4
                   2873: \fIl\fP pointer to a libnet context 
                   2874: .RE
                   2875: .PP
                   2876: \fBReturns:\fP
                   2877: .RS 4
                   2878: the size of the packet in l 
                   2879: .RE
                   2880: .PP
                   2881: 
                   2882: .SS "u_int8_t* libnet_getpbuf (libnet_t * l, libnet_ptag_t ptag)"
                   2883: .PP
                   2884: Returns the pblock buffer contents for the specified ptag; a subsequent call to \fBlibnet_getpbuf_size()\fP should be made to determine the size of the buffer. 
                   2885: .PP
                   2886: \fBParameters:\fP
                   2887: .RS 4
                   2888: \fIl\fP pointer to a libnet context 
                   2889: .br
                   2890: \fIptag\fP the ptag reference number 
                   2891: .RE
                   2892: .PP
                   2893: \fBReturns:\fP
                   2894: .RS 4
                   2895: a pointer to the pblock buffer or NULL on error 
                   2896: .RE
                   2897: .PP
                   2898: 
                   2899: .SS "u_int32_t libnet_getpbuf_size (libnet_t * l, libnet_ptag_t ptag)"
                   2900: .PP
                   2901: Returns the pblock buffer size for the specified ptag; a previous call to \fBlibnet_getpbuf()\fP should be made to pull the actual buffer contents. 
                   2902: .PP
                   2903: \fBParameters:\fP
                   2904: .RS 4
                   2905: \fIl\fP pointer to a libnet context 
                   2906: .br
                   2907: \fIptag\fP the ptag reference number 
                   2908: .RE
                   2909: .PP
                   2910: \fBReturns:\fP
                   2911: .RS 4
                   2912: the size of the pblock buffer 
                   2913: .RE
                   2914: .PP
                   2915: 
                   2916: .SS "u_int8_t* libnet_hex_aton (int8_t * s, int * len)"
                   2917: .PP
                   2918: Takes a colon separated hexidecimal address (from the command line) and returns a bytestring suitable for use in a libnet_build function. Note this function performs an implicit malloc and the return value should be freed after its use. 
                   2919: .PP
                   2920: \fBParameters:\fP
                   2921: .RS 4
                   2922: \fIs\fP the string to be parsed 
                   2923: .br
                   2924: \fIlen\fP the resulting size of the returned byte string 
                   2925: .RE
                   2926: .PP
                   2927: \fBReturns:\fP
                   2928: .RS 4
                   2929: a byte string or NULL on failure 
                   2930: .RE
                   2931: .PP
                   2932: 
                   2933: .SS "libnet_t* libnet_init (int injection_type, char * device, char * err_buf)"
                   2934: .PP
                   2935: Creates the libnet environment. It initializes the library and returns a libnet context. If the injection_type is LIBNET_LINK or LIBNET_LINK_ADV, the function initializes the injection primitives for the link-layer interface enabling the application programmer to build packets starting at the data-link layer (which also provides more granular control over the IP layer). If libnet uses the link-layer and the device argument is non-NULL, the function attempts to use the specified network device for packet injection. This is either a canonical string that references the device (such as 'eth0' for a 100MB Ethernet card on Linux or 'fxp0' for a 100MB Ethernet card on OpenBSD) or the dots and decimals representation of the device's IP address (192.168.0.1). If device is NULL, libnet attempts to find a suitable device to use. If the injection_type is LIBNET_RAW4 or LIBNET_RAW4_ADV, the function initializes the injection primitives for the IPv4 raw socket interface. The final argument, err_buf, should be a buffer of size LIBNET_ERRBUF_SIZE and holds an error message if the function fails. This function requires root privileges to execute successfully. Upon success, the function returns a valid libnet context for use in later function calls; upon failure, the function returns NULL. 
                   2936: .PP
                   2937: \fBParameters:\fP
                   2938: .RS 4
                   2939: \fIinjection_type\fP packet injection type (LIBNET_LINK, LIBNET_LINK_ADV, LIBNET_RAW4, LIBNET_RAW4_ADV, LIBNET_RAW6, LIBNET_RAW6_ADV) 
                   2940: .br
                   2941: \fIdevice\fP the interface to use (NULL and libnet will choose one) 
                   2942: .br
                   2943: \fIerr_buf\fP will contain an error message on failure 
                   2944: .RE
                   2945: .PP
                   2946: \fBReturns:\fP
                   2947: .RS 4
                   2948: libnet context ready for use or NULL on error. 
                   2949: .RE
                   2950: .PP
                   2951: 
                   2952: .SS "u_int32_t libnet_name2addr4 (libnet_t * l, char * host_name, u_int8_t use_name)"
                   2953: .PP
                   2954: Takes a dotted decimal string or a canonical DNS name and returns a network byte ordered IPv4 address. This may incur a DNS lookup if mode is set to LIBNET_RESOLVE and host_name refers to a canonical DNS name. If mode is set to LIBNET_DONT_RESOLVE no DNS lookup will occur. The function can fail if DNS lookup fails or if mode is set to LIBNET_DONT_RESOLVE and host_name refers to a canonical DNS name. 
                   2955: .PP
                   2956: \fBParameters:\fP
                   2957: .RS 4
                   2958: \fIl\fP pointer to a libnet context 
                   2959: .br
                   2960: \fIhost_name\fP pointer to a string containing a presentation format host name 
                   2961: .br
                   2962: \fIuse_name\fP LIBNET_RESOLVE or LIBNET_DONT_RESOLVE 
                   2963: .RE
                   2964: .PP
                   2965: \fBReturns:\fP
                   2966: .RS 4
                   2967: network byte ordered IPv4 address or -1 (2^32 - 1) on error 
                   2968: .RE
                   2969: .PP
                   2970: 
                   2971: .SS "struct libnet_in6_addr libnet_name2addr6 (libnet_t * l, char * host_name, u_int8_t use_name)"
                   2972: .PP
                   2973: Takes a dotted decimal string or a canonical DNS name and returns a network byte ordered IPv6 address. This may incur a DNS lookup if mode is set to LIBNET_RESOLVE and host_name refers to a canonical DNS name. If mode is set to LIBNET_DONT_RESOLVE no DNS lookup will occur. The function can fail if DNS lookup fails or if mode is set to LIBNET_DONT_RESOLVE and host_name refers to a canonical DNS name. 
                   2974: .PP
                   2975: \fBParameters:\fP
                   2976: .RS 4
                   2977: \fIl\fP pointer to a libnet context 
                   2978: .br
                   2979: \fIhost_name\fP pointer to a string containing a presentation format host name 
                   2980: .br
                   2981: \fIuse_name\fP LIBNET_RESOLVE or LIBNET_DONT_RESOLVE 
                   2982: .RE
                   2983: .PP
                   2984: \fBReturns:\fP
                   2985: .RS 4
                   2986: network byte ordered IPv6 address structure 
                   2987: .RE
                   2988: .PP
                   2989: 
                   2990: .SS "int libnet_plist_chain_dump (libnet_plist_t * plist)"
                   2991: .PP
                   2992: Runs through the port list and prints the contents of the port list chain list to stdout. 
                   2993: .PP
                   2994: \fBParameters:\fP
                   2995: .RS 4
                   2996: \fIplist\fP previously created portlist 
                   2997: .RE
                   2998: .PP
                   2999: \fBReturns:\fP
                   3000: .RS 4
                   3001: 1 on success, -1 on failure 
                   3002: .RE
                   3003: .PP
                   3004: 
                   3005: .SS "char* libnet_plist_chain_dump_string (libnet_plist_t * plist)"
                   3006: .PP
                   3007: Runs through the port list and prints the contents of the port list chain list to string. This function uses strdup and is not re-entrant. It also has a memory leak and should not really be used. 
                   3008: .PP
                   3009: \fBParameters:\fP
                   3010: .RS 4
                   3011: \fIplist\fP previously created portlist 
                   3012: .RE
                   3013: .PP
                   3014: \fBReturns:\fP
                   3015: .RS 4
                   3016: a printable string containing the port list contents on success NULL on error 
                   3017: .RE
                   3018: .PP
                   3019: 
                   3020: .SS "int libnet_plist_chain_free (libnet_plist_t * plist)"
                   3021: .PP
                   3022: Frees all memory associated with port list chain. 
                   3023: .PP
                   3024: \fBParameters:\fP
                   3025: .RS 4
                   3026: \fIplist\fP previously created portlist 
                   3027: .RE
                   3028: .PP
                   3029: \fBReturns:\fP
                   3030: .RS 4
                   3031: 1 on success, -1 on failure 
                   3032: .RE
                   3033: .PP
                   3034: 
                   3035: .SS "int libnet_plist_chain_new (libnet_t * l, libnet_plist_t ** plist, char * token_list)"
                   3036: .PP
                   3037: Creates a new port list. Port list chains are useful for TCP and UDP-based applications that need to send packets to a range of ports (contiguous or otherwise). The port list chain, which token_list points to, should contain a series of int8_tacters from the following list: '0123456789,-' of the general format 'x - y, z', where 'xyz' are port numbers between 0 and 65,535. plist points to the front of the port list chain list for use in further libnet_plist_chain() functions. Upon success, the function returns 1. Upon failure, the function returns -1 and \fBlibnet_geterror()\fP can tell you why. 
                   3038: .PP
                   3039: \fBParameters:\fP
                   3040: .RS 4
                   3041: \fIl\fP pointer to a libnet context 
                   3042: .br
                   3043: \fIplist\fP if successful, will refer to the portlist, if not, NULL 
                   3044: .br
                   3045: \fItoken_list\fP string containing the port list primitive 
                   3046: .RE
                   3047: .PP
                   3048: \fBReturns:\fP
                   3049: .RS 4
                   3050: 1 on success, -1 on failure 
                   3051: .RE
                   3052: .PP
                   3053: 
                   3054: .SS "int libnet_plist_chain_next_pair (libnet_plist_t * plist, u_int16_t * bport, u_int16_t * eport)"
                   3055: .PP
                   3056: Returns the next port list chain pair from the port list chain plist. bport and eport contain the starting port number and ending port number, respectively. Upon success, the function returns 1 and fills in the port variables; however, if the list is empty, the function returns 0 and sets both port variables to 0. Upon failure, the function returns -1. 
                   3057: .PP
                   3058: \fBParameters:\fP
                   3059: .RS 4
                   3060: \fIplist\fP previously created portlist 
                   3061: .br
                   3062: \fIbport\fP will contain the beginning port number or 0 
                   3063: .br
                   3064: \fIeport\fP will contain the ending port number or 0 
                   3065: .RE
                   3066: .PP
                   3067: \fBReturns:\fP
                   3068: .RS 4
                   3069: 1 on success, 0 if empty, -1 on failure 
                   3070: .RE
                   3071: .PP
                   3072: 
                   3073: .SS "int libnet_seed_prand (libnet_t * l)"
                   3074: .PP
                   3075: Seeds the psuedo-random number generator. 
                   3076: .PP
                   3077: \fBParameters:\fP
                   3078: .RS 4
                   3079: \fIl\fP pointer to a libnet context 
                   3080: .RE
                   3081: .PP
                   3082: \fBReturns:\fP
                   3083: .RS 4
                   3084: 1 on success, -1 on failure 
                   3085: .RE
                   3086: .PP
                   3087: 
                   3088: .SS "void libnet_stats (libnet_t * l, struct libnet_stats * ls)"
                   3089: .PP
                   3090: Fills in a libnet_stats structure with packet injection statistics (packets written, bytes written, packet sending errors). 
                   3091: .PP
                   3092: \fBParameters:\fP
                   3093: .RS 4
                   3094: \fIl\fP pointer to a libnet context 
                   3095: .br
                   3096: \fIls\fP pointer to a libnet statistics structure 
                   3097: .RE
                   3098: .PP
                   3099: 
                   3100: .SS "int libnet_toggle_checksum (libnet_t * l, libnet_ptag_t ptag, int mode)"
                   3101: .PP
                   3102: If a given protocol header is built with the checksum field set to '0', by default libnet will calculate the header checksum prior to injection. If the header is set to any other value, by default libnet will not calculate the header checksum. To over-ride this behavior, use \fBlibnet_toggle_checksum()\fP. Switches auto-checksumming on or off for the specified ptag. If mode is set to LIBNET_ON, libnet will mark the specificed ptag to calculate a checksum for the ptag prior to injection. This assumes that the ptag refers to a protocol that has a checksum field. If mode is set to LIBNET_OFF, libnet will clear the checksum flag and no checksum will be computed prior to injection. This assumes that the programmer will assign a value (zero or otherwise) to the checksum field. Often times this is useful if a precomputed checksum or some other predefined value is going to be used. Note that when libnet is initialized with LIBNET_RAW4, the IPv4 header checksum will always be computed by the kernel prior to injection, regardless of what the programmer sets. 
                   3103: .PP
                   3104: \fBParameters:\fP
                   3105: .RS 4
                   3106: \fIl\fP pointer to a libnet context 
                   3107: .br
                   3108: \fIptag\fP the ptag reference number 
                   3109: .br
                   3110: \fImode\fP LIBNET_ON or LIBNET_OFF 
                   3111: .RE
                   3112: .PP
                   3113: \fBReturns:\fP
                   3114: .RS 4
                   3115: 1 on success, -1 on failure 
                   3116: .RE
                   3117: .PP
                   3118: 
                   3119: .SS "int libnet_write (libnet_t * l)"
                   3120: .PP
                   3121: Writes a prebuilt packet to the network. The function assumes that l was previously initialized (via a call to \fBlibnet_init()\fP) and that a previously constructed packet has been built inside this context (via one or more calls to the libnet_build* family of functions) and is ready to go. Depending on how libnet was initialized, the function will write the packet to the wire either via the raw or link layer interface. The function will also bump up the internal libnet stat counters which are retrievable via \fBlibnet_stats()\fP. 
                   3122: .PP
                   3123: \fBParameters:\fP
                   3124: .RS 4
                   3125: \fIl\fP pointer to a libnet context 
                   3126: .RE
                   3127: .PP
                   3128: \fBReturns:\fP
                   3129: .RS 4
                   3130: the number of bytes written, -1 on error 
                   3131: .RE
                   3132: .PP
                   3133: 
                   3134: .SH "Author"
                   3135: .PP 
                   3136: Generated automatically by Doxygen for libnet from the source code.

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>