Annotation of embedaddon/libnet/doc/html/libnet-functions_8h.html, revision 1.1.1.1
1.1 misho 1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2: <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3: <title>libnet: libnet-functions.h File Reference</title>
4: <link href="doxygen.css" rel="stylesheet" type="text/css">
5: </head><body>
6: <!-- Generated by Doxygen 1.3.4 -->
7: <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
8: <h1>libnet-functions.h File Reference</h1>libnet exported function prototypes
9: <a href="#_details">More...</a>
10: <p>
11:
12: <p>
13: <a href="libnet-functions_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
14: <tr><td></td></tr>
15: <tr><td colspan=2><br><h2>Functions</h2></td></tr>
16: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a1">libnet_init</a> (int injection_type, char *device, char *err_buf)</td></tr>
17:
18: <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a2">libnet_destroy</a> (libnet_t *l)</td></tr>
19:
20: <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a3">libnet_clear_packet</a> (libnet_t *l)</td></tr>
21:
22: <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a4">libnet_stats</a> (libnet_t *l, struct libnet_stats *ls)</td></tr>
23:
24: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a5">libnet_getfd</a> (libnet_t *l)</td></tr>
25:
26: <tr><td class="memItemLeft" nowrap align=right valign=top>int8_t * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a6">libnet_getdevice</a> (libnet_t *l)</td></tr>
27:
28: <tr><td class="memItemLeft" nowrap align=right valign=top>u_int8_t * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a7">libnet_getpbuf</a> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
29:
30: <tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a8">libnet_getpbuf_size</a> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
31:
32: <tr><td class="memItemLeft" nowrap align=right valign=top>char * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a9">libnet_geterror</a> (libnet_t *l)</td></tr>
33:
34: <tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a10">libnet_getpacket_size</a> (libnet_t *l)</td></tr>
35:
36: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a11">libnet_seed_prand</a> (libnet_t *l)</td></tr>
37:
38: <tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a12">libnet_get_prand</a> (int mod)</td></tr>
39:
40: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a13">libnet_toggle_checksum</a> (libnet_t *l, libnet_ptag_t ptag, int mode)</td></tr>
41:
42: <tr><td class="memItemLeft" nowrap align=right valign=top>char * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a14">libnet_addr2name4</a> (u_int32_t in, u_int8_t use_name)</td></tr>
43:
44: <tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a15">libnet_name2addr4</a> (libnet_t *l, char *host_name, u_int8_t use_name)</td></tr>
45:
46: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_in6_addr </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a16">libnet_name2addr6</a> (libnet_t *l, char *host_name, u_int8_t use_name)</td></tr>
47:
48: <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a17">libnet_addr2name6_r</a> (struct libnet_in6_addr addr, u_int8_t use_name, char *host_name, int host_name_len)</td></tr>
49:
50: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a18">libnet_plist_chain_new</a> (libnet_t *l, libnet_plist_t **plist, char *token_list)</td></tr>
51:
52: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a19">libnet_plist_chain_next_pair</a> (libnet_plist_t *plist, u_int16_t *bport, u_int16_t *eport)</td></tr>
53:
54: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a20">libnet_plist_chain_dump</a> (libnet_plist_t *plist)</td></tr>
55:
56: <tr><td class="memItemLeft" nowrap align=right valign=top>char * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a21">libnet_plist_chain_dump_string</a> (libnet_plist_t *plist)</td></tr>
57:
58: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a22">libnet_plist_chain_free</a> (libnet_plist_t *plist)</td></tr>
59:
60: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a23">libnet_build_802_1q</a> (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)</td></tr>
61:
62: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a24">libnet_build_802_1x</a> (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)</td></tr>
63:
64: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a25">libnet_build_802_2</a> (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)</td></tr>
65:
66: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a26">libnet_build_802_2snap</a> (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)</td></tr>
67:
68: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a27">libnet_build_802_3</a> (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)</td></tr>
69:
70: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a28">libnet_build_ethernet</a> (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)</td></tr>
71:
72: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a29">libnet_autobuild_ethernet</a> (u_int8_t *dst, u_int16_t type, libnet_t *l)</td></tr>
73:
74: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a30">libnet_build_fddi</a> (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)</td></tr>
75:
76: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a31">libnet_autobuild_fddi</a> (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)</td></tr>
77:
78: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a32">libnet_build_arp</a> (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)</td></tr>
79:
80: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a33">libnet_autobuild_arp</a> (u_int16_t op, u_int8_t *sha, u_int8_t *spa, u_int8_t *tha, u_int8_t *tpa, libnet_t *l)</td></tr>
81:
82: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a34">libnet_build_tcp</a> (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)</td></tr>
83:
84: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a35">libnet_build_tcp_options</a> (u_int8_t *options, u_int32_t options_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
85:
86: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a36">libnet_build_udp</a> (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)</td></tr>
87:
88: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a37">libnet_build_cdp</a> (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)</td></tr>
89:
90: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a38">libnet_build_icmpv4_echo</a> (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)</td></tr>
91:
92: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a39">libnet_build_icmpv4_mask</a> (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)</td></tr>
93:
94: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a40">libnet_build_icmpv4_unreach</a> (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)</td></tr>
95:
96: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a41">libnet_build_icmpv4_redirect</a> (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)</td></tr>
97:
98: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a42">libnet_build_icmpv4_timeexceed</a> (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)</td></tr>
99:
100: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a43">libnet_build_icmpv4_timestamp</a> (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)</td></tr>
101:
102: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a44">libnet_build_igmp</a> (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)</td></tr>
103:
104: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a45">libnet_build_ipv4</a> (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)</td></tr>
105:
106: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a46">libnet_build_ipv4_options</a> (u_int8_t *options, u_int32_t options_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
107:
108: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a47">libnet_autobuild_ipv4</a> (u_int16_t len, u_int8_t prot, u_int32_t dst, libnet_t *l)</td></tr>
109:
110: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a48">libnet_build_ipv6</a> (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)</td></tr>
111:
112: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a49">libnet_build_ipv6_frag</a> (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)</td></tr>
113:
114: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a50">libnet_build_ipv6_routing</a> (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)</td></tr>
115:
116: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a51">libnet_build_ipv6_destopts</a> (u_int8_t nh, u_int8_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
117:
118: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a52">libnet_build_ipv6_hbhopts</a> (u_int8_t nh, u_int8_t len, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
119:
120: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a53">libnet_autobuild_ipv6</a> (u_int16_t len, u_int8_t nh, struct libnet_in6_addr dst, libnet_t *l)</td></tr>
121:
122: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a54">libnet_build_isl</a> (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)</td></tr>
123:
124: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a55">libnet_build_ipsec_esp_hdr</a> (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)</td></tr>
125:
126: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a56">libnet_build_ipsec_esp_ftr</a> (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)</td></tr>
127:
128: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a57">libnet_build_ipsec_ah</a> (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)</td></tr>
129:
130: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a58">libnet_build_dnsv4</a> (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)</td></tr>
131:
132: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a59">libnet_build_rip</a> (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)</td></tr>
133:
134: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a60">libnet_build_rpc_call</a> (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)</td></tr>
135:
136: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a61">libnet_build_stp_conf</a> (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)</td></tr>
137:
138: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a62">libnet_build_stp_tcn</a> (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)</td></tr>
139:
140: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a63">libnet_build_token_ring</a> (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)</td></tr>
141:
142: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a64">libnet_autobuild_token_ring</a> (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)</td></tr>
143:
144: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a65">libnet_build_vrrp</a> (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)</td></tr>
145:
146: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a66">libnet_build_mpls</a> (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)</td></tr>
147:
148: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a67">libnet_build_ntp</a> (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)</td></tr>
149:
150: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a68">libnet_build_ospfv2</a> (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)</td></tr>
151:
152: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a69">libnet_build_ospfv2_hello</a> (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)</td></tr>
153:
154: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a70">libnet_build_ospfv2_dbd</a> (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)</td></tr>
155:
156: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a71">libnet_build_ospfv2_lsr</a> (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)</td></tr>
157:
158: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a72">libnet_build_ospfv2_lsu</a> (u_int num, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
159:
160: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a73">libnet_build_ospfv2_lsa</a> (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)</td></tr>
161:
162: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a74">libnet_build_ospfv2_lsa_rtr</a> (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)</td></tr>
163:
164: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a75">libnet_build_ospfv2_lsa_net</a> (u_int32_t nmask, u_int rtrid, u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
165:
166: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a76">libnet_build_ospfv2_lsa_sum</a> (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)</td></tr>
167:
168: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a77">libnet_build_ospfv2_lsa_as</a> (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)</td></tr>
169:
170: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a78">libnet_build_data</a> (u_int8_t *payload, u_int32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
171:
172: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a79">libnet_build_dhcpv4</a> (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)</td></tr>
173:
174: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a80">libnet_build_bootpv4</a> (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)</td></tr>
175:
176: <tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a81">libnet_getgre_length</a> (u_int16_t fv)</td></tr>
177:
178: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a82">libnet_build_gre</a> (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)</td></tr>
179:
180: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a83">libnet_build_egre</a> (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)</td></tr>
181:
182: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a84">libnet_build_gre_sre</a> (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)</td></tr>
183:
184: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a85">libnet_build_gre_last_sre</a> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
185:
186: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a86">libnet_build_bgp4_header</a> (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)</td></tr>
187:
188: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a87">libnet_build_bgp4_open</a> (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)</td></tr>
189:
190: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a88">libnet_build_bgp4_update</a> (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)</td></tr>
191:
192: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a89">libnet_build_bgp4_notification</a> (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)</td></tr>
193:
194: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a90">libnet_build_sebek</a> (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)</td></tr>
195:
196: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a91">libnet_build_link</a> (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)</td></tr>
197:
198: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ptag_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a92">libnet_autobuild_link</a> (u_int8_t *dst, u_int8_t *oui, u_int16_t type, libnet_t *l)</td></tr>
199:
200: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a93">libnet_write</a> (libnet_t *l)</td></tr>
201:
202: <tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a94">libnet_get_ipaddr4</a> (libnet_t *l)</td></tr>
203:
204: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_in6_addr </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a95">libnet_get_ipaddr6</a> (libnet_t *l)</td></tr>
205:
206: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_ether_addr * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a96">libnet_get_hwaddr</a> (libnet_t *l)</td></tr>
207:
208: <tr><td class="memItemLeft" nowrap align=right valign=top>u_int8_t * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a97">libnet_hex_aton</a> (int8_t *s, int *len)</td></tr>
209:
210: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a98">libnet_adv_cull_packet</a> (libnet_t *l, u_int8_t **packet, u_int32_t *packet_s)</td></tr>
211:
212: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a99">libnet_adv_cull_header</a> (libnet_t *l, libnet_ptag_t ptag, u_int8_t **header, u_int32_t *header_s)</td></tr>
213:
214: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a100">libnet_adv_write_link</a> (libnet_t *l, u_int8_t *packet, u_int32_t packet_s)</td></tr>
215:
216: <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a101">libnet_adv_free_packet</a> (libnet_t *l, u_int8_t *packet)</td></tr>
217:
218: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a102">libnet_cq_add</a> (libnet_t *l, char *label)</td></tr>
219:
220: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a103">libnet_cq_remove</a> (libnet_t *l)</td></tr>
221:
222: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a104">libnet_cq_remove_by_label</a> (char *label)</td></tr>
223:
224: <tr><td class="memItemLeft" nowrap align=right valign=top>int8_t * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a105">libnet_cq_getlabel</a> (libnet_t *l)</td></tr>
225:
226: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a106">libnet_cq_find_by_label</a> (char *label)</td></tr>
227:
228: <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a107">libnet_cq_destroy</a> ()</td></tr>
229:
230: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a108">libnet_cq_head</a> ()</td></tr>
231:
232: <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a109">libnet_cq_last</a> ()</td></tr>
233:
234: <tr><td class="memItemLeft" nowrap align=right valign=top>libnet_t * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a110">libnet_cq_next</a> ()</td></tr>
235:
236: <tr><td class="memItemLeft" nowrap align=right valign=top>u_int32_t </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a111">libnet_cq_size</a> ()</td></tr>
237:
238: <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a112">libnet_diag_dump_context</a> (libnet_t *l)</td></tr>
239:
240: <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a113">libnet_diag_dump_pblock</a> (libnet_t *l)</td></tr>
241:
242: <tr><td class="memItemLeft" nowrap align=right valign=top>char * </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a114">libnet_diag_dump_pblock_type</a> (u_int8_t type)</td></tr>
243:
244: <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="libnet-functions_8h.html#a115">libnet_diag_dump_hex</a> (u_int8_t *packet, u_int32_t len, int swap, FILE *stream)</td></tr>
245:
246: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a116" doxytag="libnet-functions.h::libnet_write_raw_ipv4" ></a>
247: int </td><td class="memItemRight" valign=bottom><b>libnet_write_raw_ipv4</b> (libnet_t *l, u_int8_t *packet, u_int32_t size)</td></tr>
248:
249: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a117" doxytag="libnet-functions.h::libnet_write_raw_ipv6" ></a>
250: int </td><td class="memItemRight" valign=bottom><b>libnet_write_raw_ipv6</b> (libnet_t *l, u_int8_t *packet, u_int32_t size)</td></tr>
251:
252: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a118" doxytag="libnet-functions.h::libnet_write_link" ></a>
253: int </td><td class="memItemRight" valign=bottom><b>libnet_write_link</b> (libnet_t *l, u_int8_t *packet, u_int32_t size)</td></tr>
254:
255: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a119" doxytag="libnet-functions.h::libnet_open_raw4" ></a>
256: int </td><td class="memItemRight" valign=bottom><b>libnet_open_raw4</b> (libnet_t *l)</td></tr>
257:
258: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a120" doxytag="libnet-functions.h::libnet_close_raw4" ></a>
259: int </td><td class="memItemRight" valign=bottom><b>libnet_close_raw4</b> (libnet_t *l)</td></tr>
260:
261: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a121" doxytag="libnet-functions.h::libnet_open_raw6" ></a>
262: int </td><td class="memItemRight" valign=bottom><b>libnet_open_raw6</b> (libnet_t *l)</td></tr>
263:
264: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a122" doxytag="libnet-functions.h::libnet_close_raw6" ></a>
265: int </td><td class="memItemRight" valign=bottom><b>libnet_close_raw6</b> (libnet_t *l)</td></tr>
266:
267: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a123" doxytag="libnet-functions.h::libnet_select_device" ></a>
268: int </td><td class="memItemRight" valign=bottom><b>libnet_select_device</b> (libnet_t *l)</td></tr>
269:
270: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a124" doxytag="libnet-functions.h::libnet_open_link" ></a>
271: int </td><td class="memItemRight" valign=bottom><b>libnet_open_link</b> (libnet_t *l)</td></tr>
272:
273: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a125" doxytag="libnet-functions.h::libnet_close_link" ></a>
274: int </td><td class="memItemRight" valign=bottom><b>libnet_close_link</b> (libnet_t *l)</td></tr>
275:
276: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a126" doxytag="libnet-functions.h::libnet_do_checksum" ></a>
277: int </td><td class="memItemRight" valign=bottom><b>libnet_do_checksum</b> (libnet_t *l, u_int8_t *packet, int protocol, int len)</td></tr>
278:
279: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a127" doxytag="libnet-functions.h::libnet_compute_crc" ></a>
280: u_int32_t </td><td class="memItemRight" valign=bottom><b>libnet_compute_crc</b> (u_int8_t *buf, u_int32_t len)</td></tr>
281:
282: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a128" doxytag="libnet-functions.h::libnet_ip_check" ></a>
283: u_int16_t </td><td class="memItemRight" valign=bottom><b>libnet_ip_check</b> (u_int16_t *addr, int len)</td></tr>
284:
285: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a129" doxytag="libnet-functions.h::libnet_in_cksum" ></a>
286: int </td><td class="memItemRight" valign=bottom><b>libnet_in_cksum</b> (u_int16_t *addr, int len)</td></tr>
287:
288: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a130" doxytag="libnet-functions.h::libnet_pblock_probe" ></a>
289: libnet_pblock_t * </td><td class="memItemRight" valign=bottom><b>libnet_pblock_probe</b> (libnet_t *l, libnet_ptag_t ptag, u_int32_t n, u_int8_t type)</td></tr>
290:
291: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a131" doxytag="libnet-functions.h::libnet_pblock_new" ></a>
292: libnet_pblock_t * </td><td class="memItemRight" valign=bottom><b>libnet_pblock_new</b> (libnet_t *l, u_int32_t size)</td></tr>
293:
294: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a132" doxytag="libnet-functions.h::libnet_pblock_swap" ></a>
295: int </td><td class="memItemRight" valign=bottom><b>libnet_pblock_swap</b> (libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)</td></tr>
296:
297: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a133" doxytag="libnet-functions.h::libnet_pblock_insert_before" ></a>
298: int </td><td class="memItemRight" valign=bottom><b>libnet_pblock_insert_before</b> (libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)</td></tr>
299:
300: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a134" doxytag="libnet-functions.h::libnet_pblock_delete" ></a>
301: void </td><td class="memItemRight" valign=bottom><b>libnet_pblock_delete</b> (libnet_t *l, libnet_pblock_t *p)</td></tr>
302:
303: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a135" doxytag="libnet-functions.h::libnet_pblock_update" ></a>
304: libnet_ptag_t </td><td class="memItemRight" valign=bottom><b>libnet_pblock_update</b> (libnet_t *l, libnet_pblock_t *p, u_int32_t h, u_int8_t type)</td></tr>
305:
306: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a136" doxytag="libnet-functions.h::libnet_pblock_find" ></a>
307: libnet_pblock_t * </td><td class="memItemRight" valign=bottom><b>libnet_pblock_find</b> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
308:
309: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a137" doxytag="libnet-functions.h::libnet_pblock_append" ></a>
310: int </td><td class="memItemRight" valign=bottom><b>libnet_pblock_append</b> (libnet_t *l, libnet_pblock_t *p, u_int8_t *buf, u_int32_t len)</td></tr>
311:
312: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a138" doxytag="libnet-functions.h::libnet_pblock_setflags" ></a>
313: void </td><td class="memItemRight" valign=bottom><b>libnet_pblock_setflags</b> (libnet_pblock_t *p, u_int8_t flags)</td></tr>
314:
315: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a139" doxytag="libnet-functions.h::libnet_pblock_p2p" ></a>
316: int </td><td class="memItemRight" valign=bottom><b>libnet_pblock_p2p</b> (u_int8_t type)</td></tr>
317:
318: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a140" doxytag="libnet-functions.h::libnet_pblock_coalesce" ></a>
319: int </td><td class="memItemRight" valign=bottom><b>libnet_pblock_coalesce</b> (libnet_t *l, u_int8_t **packet, u_int32_t *size)</td></tr>
320:
321: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a141" doxytag="libnet-functions.h::libnet_check_iface" ></a>
322: int </td><td class="memItemRight" valign=bottom><b>libnet_check_iface</b> (libnet_t *l)</td></tr>
323:
324: <tr><td colspan=2><br><h2>Variables</h2></td></tr>
325: <tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a0" doxytag="libnet-functions.h::in6addr_error" ></a>
326: const struct libnet_in6_addr </td><td class="memItemRight" valign=bottom><b>in6addr_error</b></td></tr>
327:
328: </table>
329: <hr><a name="_details"></a><h2>Detailed Description</h2>
330: libnet exported function prototypes
331: <p>
332: <hr><h2>Function Documentation</h2>
333: <a class="anchor" name="a14" doxytag="libnet-functions.h::libnet_addr2name4" ></a><p>
334: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
335: <tr>
336: <td class="mdRow">
337: <table cellpadding="0" cellspacing="0" border="0">
338: <tr>
339: <td class="md" nowrap valign="top"> char* libnet_addr2name4 </td>
340: <td class="md" valign="top">( </td>
341: <td class="md" nowrap valign="top">u_int32_t </td>
342: <td class="mdname" nowrap> <em>in</em>, </td>
343: </tr>
344: <tr>
345: <td></td>
346: <td></td>
347: <td class="md" nowrap>u_int8_t </td>
348: <td class="mdname" nowrap> <em>use_name</em></td>
349: </tr>
350: <tr>
351: <td></td>
352: <td class="md">) </td>
353: <td class="md" colspan="2"></td>
354: </tr>
355:
356: </table>
357: </td>
358: </tr>
359: </table>
360: <table cellspacing=5 cellpadding=0 border=0>
361: <tr>
362: <td>
363:
364: </td>
365: <td>
366:
367: <p>
368: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
369: <table border="0" cellspacing="2" cellpadding="0">
370: <tr><td valign=top><em>in</em> </td><td>network byte ordered IPv4 address </td></tr>
371: <tr><td valign=top><em>use_name</em> </td><td>LIBNET_RESOLVE or LIBNET_DONT_RESOLVE </td></tr>
372: </table>
373: </dl>
374: <dl compact><dt><b>Returns:</b></dt><dd>a pointer to presentation format string </dd></dl>
375: </td>
376: </tr>
377: </table>
378: <a class="anchor" name="a17" doxytag="libnet-functions.h::libnet_addr2name6_r" ></a><p>
379: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
380: <tr>
381: <td class="mdRow">
382: <table cellpadding="0" cellspacing="0" border="0">
383: <tr>
384: <td class="md" nowrap valign="top"> void libnet_addr2name6_r </td>
385: <td class="md" valign="top">( </td>
386: <td class="md" nowrap valign="top">struct libnet_in6_addr </td>
387: <td class="mdname" nowrap> <em>addr</em>, </td>
388: </tr>
389: <tr>
390: <td></td>
391: <td></td>
392: <td class="md" nowrap>u_int8_t </td>
393: <td class="mdname" nowrap> <em>use_name</em>, </td>
394: </tr>
395: <tr>
396: <td></td>
397: <td></td>
398: <td class="md" nowrap>char * </td>
399: <td class="mdname" nowrap> <em>host_name</em>, </td>
400: </tr>
401: <tr>
402: <td></td>
403: <td></td>
404: <td class="md" nowrap>int </td>
405: <td class="mdname" nowrap> <em>host_name_len</em></td>
406: </tr>
407: <tr>
408: <td></td>
409: <td class="md">) </td>
410: <td class="md" colspan="2"></td>
411: </tr>
412:
413: </table>
414: </td>
415: </tr>
416: </table>
417: <table cellspacing=5 cellpadding=0 border=0>
418: <tr>
419: <td>
420:
421: </td>
422: <td>
423:
424: <p>
425: Should document this baby right here. </td>
426: </tr>
427: </table>
428: <a class="anchor" name="a99" doxytag="libnet-functions.h::libnet_adv_cull_header" ></a><p>
429: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
430: <tr>
431: <td class="mdRow">
432: <table cellpadding="0" cellspacing="0" border="0">
433: <tr>
434: <td class="md" nowrap valign="top"> int libnet_adv_cull_header </td>
435: <td class="md" valign="top">( </td>
436: <td class="md" nowrap valign="top">libnet_t * </td>
437: <td class="mdname" nowrap> <em>l</em>, </td>
438: </tr>
439: <tr>
440: <td></td>
441: <td></td>
442: <td class="md" nowrap>libnet_ptag_t </td>
443: <td class="mdname" nowrap> <em>ptag</em>, </td>
444: </tr>
445: <tr>
446: <td></td>
447: <td></td>
448: <td class="md" nowrap>u_int8_t ** </td>
449: <td class="mdname" nowrap> <em>header</em>, </td>
450: </tr>
451: <tr>
452: <td></td>
453: <td></td>
454: <td class="md" nowrap>u_int32_t * </td>
455: <td class="mdname" nowrap> <em>header_s</em></td>
456: </tr>
457: <tr>
458: <td></td>
459: <td class="md">) </td>
460: <td class="md" colspan="2"></td>
461: </tr>
462:
463: </table>
464: </td>
465: </tr>
466: </table>
467: <table cellspacing=5 cellpadding=0 border=0>
468: <tr>
469: <td>
470:
471: </td>
472: <td>
473:
474: <p>
475: [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 <a class="el" href="libnet-functions_8h.html#a9">libnet_geterror()</a> can tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
476: <table border="0" cellspacing="2" cellpadding="0">
477: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
478: <tr><td valign=top><em>ptag</em> </td><td>the ptag referencing the header to pull </td></tr>
479: <tr><td valign=top><em>header</em> </td><td>will contain the header </td></tr>
480: <tr><td valign=top><em>header_s</em> </td><td>will contain the header size </td></tr>
481: </table>
482: </dl>
483: <dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
484: </td>
485: </tr>
486: </table>
487: <a class="anchor" name="a98" doxytag="libnet-functions.h::libnet_adv_cull_packet" ></a><p>
488: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
489: <tr>
490: <td class="mdRow">
491: <table cellpadding="0" cellspacing="0" border="0">
492: <tr>
493: <td class="md" nowrap valign="top"> int libnet_adv_cull_packet </td>
494: <td class="md" valign="top">( </td>
495: <td class="md" nowrap valign="top">libnet_t * </td>
496: <td class="mdname" nowrap> <em>l</em>, </td>
497: </tr>
498: <tr>
499: <td></td>
500: <td></td>
501: <td class="md" nowrap>u_int8_t ** </td>
502: <td class="mdname" nowrap> <em>packet</em>, </td>
503: </tr>
504: <tr>
505: <td></td>
506: <td></td>
507: <td class="md" nowrap>u_int32_t * </td>
508: <td class="mdname" nowrap> <em>packet_s</em></td>
509: </tr>
510: <tr>
511: <td></td>
512: <td class="md">) </td>
513: <td class="md" colspan="2"></td>
514: </tr>
515:
516: </table>
517: </td>
518: </tr>
519: </table>
520: <table cellspacing=5 cellpadding=0 border=0>
521: <tr>
522: <td>
523:
524: </td>
525: <td>
526:
527: <p>
528: [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 <a class="el" href="libnet-functions_8h.html#a101">libnet_adv_free_packet()</a> should be made to free the memory packet occupies. If the function fails <a class="el" href="libnet-functions_8h.html#a9">libnet_geterror()</a> can tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
529: <table border="0" cellspacing="2" cellpadding="0">
530: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
531: <tr><td valign=top><em>packet</em> </td><td>will contain the wire-ready packet </td></tr>
532: <tr><td valign=top><em>packet_s</em> </td><td>will contain the packet size </td></tr>
533: </table>
534: </dl>
535: <dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
536: </td>
537: </tr>
538: </table>
539: <a class="anchor" name="a101" doxytag="libnet-functions.h::libnet_adv_free_packet" ></a><p>
540: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
541: <tr>
542: <td class="mdRow">
543: <table cellpadding="0" cellspacing="0" border="0">
544: <tr>
545: <td class="md" nowrap valign="top"> void libnet_adv_free_packet </td>
546: <td class="md" valign="top">( </td>
547: <td class="md" nowrap valign="top">libnet_t * </td>
548: <td class="mdname" nowrap> <em>l</em>, </td>
549: </tr>
550: <tr>
551: <td></td>
552: <td></td>
553: <td class="md" nowrap>u_int8_t * </td>
554: <td class="mdname" nowrap> <em>packet</em></td>
555: </tr>
556: <tr>
557: <td></td>
558: <td class="md">) </td>
559: <td class="md" colspan="2"></td>
560: </tr>
561:
562: </table>
563: </td>
564: </tr>
565: </table>
566: <table cellspacing=5 cellpadding=0 border=0>
567: <tr>
568: <td>
569:
570: </td>
571: <td>
572:
573: <p>
574: [Advanced Interface] Frees the memory allocated when <a class="el" href="libnet-functions_8h.html#a98">libnet_adv_cull_packet()</a> is called. <dl compact><dt><b>Parameters:</b></dt><dd>
575: <table border="0" cellspacing="2" cellpadding="0">
576: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
577: <tr><td valign=top><em>packet</em> </td><td>a pointer to the packet to free </td></tr>
578: </table>
579: </dl>
580: </td>
581: </tr>
582: </table>
583: <a class="anchor" name="a100" doxytag="libnet-functions.h::libnet_adv_write_link" ></a><p>
584: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
585: <tr>
586: <td class="mdRow">
587: <table cellpadding="0" cellspacing="0" border="0">
588: <tr>
589: <td class="md" nowrap valign="top"> int libnet_adv_write_link </td>
590: <td class="md" valign="top">( </td>
591: <td class="md" nowrap valign="top">libnet_t * </td>
592: <td class="mdname" nowrap> <em>l</em>, </td>
593: </tr>
594: <tr>
595: <td></td>
596: <td></td>
597: <td class="md" nowrap>u_int8_t * </td>
598: <td class="mdname" nowrap> <em>packet</em>, </td>
599: </tr>
600: <tr>
601: <td></td>
602: <td></td>
603: <td class="md" nowrap>u_int32_t </td>
604: <td class="mdname" nowrap> <em>packet_s</em></td>
605: </tr>
606: <tr>
607: <td></td>
608: <td class="md">) </td>
609: <td class="md" colspan="2"></td>
610: </tr>
611:
612: </table>
613: </td>
614: </tr>
615: </table>
616: <table cellspacing=5 cellpadding=0 border=0>
617: <tr>
618: <td>
619:
620: </td>
621: <td>
622:
623: <p>
624: [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 <a class="el" href="libnet-functions_8h.html#a98">libnet_adv_cull_packet()</a>. This function is part of the advanced interface and is only available when libnet is initialized in advanced mode. If the function fails <a class="el" href="libnet-functions_8h.html#a9">libnet_geterror()</a> can tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
625: <table border="0" cellspacing="2" cellpadding="0">
626: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
627: <tr><td valign=top><em>packet</em> </td><td>a pointer to the packet to inject </td></tr>
628: <tr><td valign=top><em>packet_s</em> </td><td>the size of the packet </td></tr>
629: </table>
630: </dl>
631: <dl compact><dt><b>Returns:</b></dt><dd>the number of bytes written, or -1 on failure </dd></dl>
632: </td>
633: </tr>
634: </table>
635: <a class="anchor" name="a33" doxytag="libnet-functions.h::libnet_autobuild_arp" ></a><p>
636: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
637: <tr>
638: <td class="mdRow">
639: <table cellpadding="0" cellspacing="0" border="0">
640: <tr>
641: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_arp </td>
642: <td class="md" valign="top">( </td>
643: <td class="md" nowrap valign="top">u_int16_t </td>
644: <td class="mdname" nowrap> <em>op</em>, </td>
645: </tr>
646: <tr>
647: <td></td>
648: <td></td>
649: <td class="md" nowrap>u_int8_t * </td>
650: <td class="mdname" nowrap> <em>sha</em>, </td>
651: </tr>
652: <tr>
653: <td></td>
654: <td></td>
655: <td class="md" nowrap>u_int8_t * </td>
656: <td class="mdname" nowrap> <em>spa</em>, </td>
657: </tr>
658: <tr>
659: <td></td>
660: <td></td>
661: <td class="md" nowrap>u_int8_t * </td>
662: <td class="mdname" nowrap> <em>tha</em>, </td>
663: </tr>
664: <tr>
665: <td></td>
666: <td></td>
667: <td class="md" nowrap>u_int8_t * </td>
668: <td class="mdname" nowrap> <em>tpa</em>, </td>
669: </tr>
670: <tr>
671: <td></td>
672: <td></td>
673: <td class="md" nowrap>libnet_t * </td>
674: <td class="mdname" nowrap> <em>l</em></td>
675: </tr>
676: <tr>
677: <td></td>
678: <td class="md">) </td>
679: <td class="md" colspan="2"></td>
680: </tr>
681:
682: </table>
683: </td>
684: </tr>
685: </table>
686: <table cellspacing=5 cellpadding=0 border=0>
687: <tr>
688: <td>
689:
690: </td>
691: <td>
692:
693: <p>
694: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
695: <table border="0" cellspacing="2" cellpadding="0">
696: <tr><td valign=top><em>op</em> </td><td>ARP operation type </td></tr>
697: <tr><td valign=top><em>sha</em> </td><td>sender's hardware address </td></tr>
698: <tr><td valign=top><em>spa</em> </td><td>sender's protocol address </td></tr>
699: <tr><td valign=top><em>tha</em> </td><td>target hardware address </td></tr>
700: <tr><td valign=top><em>tpa</em> </td><td>targer protocol address </td></tr>
701: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
702: </table>
703: </dl>
704: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
705: </td>
706: </tr>
707: </table>
708: <a class="anchor" name="a29" doxytag="libnet-functions.h::libnet_autobuild_ethernet" ></a><p>
709: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
710: <tr>
711: <td class="mdRow">
712: <table cellpadding="0" cellspacing="0" border="0">
713: <tr>
714: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_ethernet </td>
715: <td class="md" valign="top">( </td>
716: <td class="md" nowrap valign="top">u_int8_t * </td>
717: <td class="mdname" nowrap> <em>dst</em>, </td>
718: </tr>
719: <tr>
720: <td></td>
721: <td></td>
722: <td class="md" nowrap>u_int16_t </td>
723: <td class="mdname" nowrap> <em>type</em>, </td>
724: </tr>
725: <tr>
726: <td></td>
727: <td></td>
728: <td class="md" nowrap>libnet_t * </td>
729: <td class="mdname" nowrap> <em>l</em></td>
730: </tr>
731: <tr>
732: <td></td>
733: <td class="md">) </td>
734: <td class="md" colspan="2"></td>
735: </tr>
736:
737: </table>
738: </td>
739: </tr>
740: </table>
741: <table cellspacing=5 cellpadding=0 border=0>
742: <tr>
743: <td>
744:
745: </td>
746: <td>
747:
748: <p>
749: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
750: <table border="0" cellspacing="2" cellpadding="0">
751: <tr><td valign=top><em>dst</em> </td><td>destination ethernet address </td></tr>
752: <tr><td valign=top><em>type</em> </td><td>upper layer protocol type </td></tr>
753: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
754: </table>
755: </dl>
756: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
757: </td>
758: </tr>
759: </table>
760: <a class="anchor" name="a31" doxytag="libnet-functions.h::libnet_autobuild_fddi" ></a><p>
761: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
762: <tr>
763: <td class="mdRow">
764: <table cellpadding="0" cellspacing="0" border="0">
765: <tr>
766: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_fddi </td>
767: <td class="md" valign="top">( </td>
768: <td class="md" nowrap valign="top">u_int8_t </td>
769: <td class="mdname" nowrap> <em>fc</em>, </td>
770: </tr>
771: <tr>
772: <td></td>
773: <td></td>
774: <td class="md" nowrap>u_int8_t * </td>
775: <td class="mdname" nowrap> <em>dst</em>, </td>
776: </tr>
777: <tr>
778: <td></td>
779: <td></td>
780: <td class="md" nowrap>u_int8_t </td>
781: <td class="mdname" nowrap> <em>dsap</em>, </td>
782: </tr>
783: <tr>
784: <td></td>
785: <td></td>
786: <td class="md" nowrap>u_int8_t </td>
787: <td class="mdname" nowrap> <em>ssap</em>, </td>
788: </tr>
789: <tr>
790: <td></td>
791: <td></td>
792: <td class="md" nowrap>u_int8_t </td>
793: <td class="mdname" nowrap> <em>cf</em>, </td>
794: </tr>
795: <tr>
796: <td></td>
797: <td></td>
798: <td class="md" nowrap>u_int8_t * </td>
799: <td class="mdname" nowrap> <em>org</em>, </td>
800: </tr>
801: <tr>
802: <td></td>
803: <td></td>
804: <td class="md" nowrap>u_int16_t </td>
805: <td class="mdname" nowrap> <em>type</em>, </td>
806: </tr>
807: <tr>
808: <td></td>
809: <td></td>
810: <td class="md" nowrap>libnet_t * </td>
811: <td class="mdname" nowrap> <em>l</em></td>
812: </tr>
813: <tr>
814: <td></td>
815: <td class="md">) </td>
816: <td class="md" colspan="2"></td>
817: </tr>
818:
819: </table>
820: </td>
821: </tr>
822: </table>
823: <table cellspacing=5 cellpadding=0 border=0>
824: <tr>
825: <td>
826:
827: </td>
828: <td>
829:
830: <p>
831: Autobuilds a Fiber Distributed Data Interface (FDDI) header. <dl compact><dt><b>Parameters:</b></dt><dd>
832: <table border="0" cellspacing="2" cellpadding="0">
833: <tr><td valign=top><em>fc</em> </td><td>class format and priority dst destination fddi address </td></tr>
834: <tr><td valign=top><em>dsap</em> </td><td>destination service access point </td></tr>
835: <tr><td valign=top><em>ssap</em> </td><td>source service access point </td></tr>
836: <tr><td valign=top><em>cf</em> </td><td>cf </td></tr>
837: <tr><td valign=top><em>org</em> </td><td>IEEE organizational code </td></tr>
838: <tr><td valign=top><em>type</em> </td><td>upper layer protocol </td></tr>
839: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
840: </table>
841: </dl>
842: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
843: </td>
844: </tr>
845: </table>
846: <a class="anchor" name="a47" doxytag="libnet-functions.h::libnet_autobuild_ipv4" ></a><p>
847: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
848: <tr>
849: <td class="mdRow">
850: <table cellpadding="0" cellspacing="0" border="0">
851: <tr>
852: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_ipv4 </td>
853: <td class="md" valign="top">( </td>
854: <td class="md" nowrap valign="top">u_int16_t </td>
855: <td class="mdname" nowrap> <em>len</em>, </td>
856: </tr>
857: <tr>
858: <td></td>
859: <td></td>
860: <td class="md" nowrap>u_int8_t </td>
861: <td class="mdname" nowrap> <em>prot</em>, </td>
862: </tr>
863: <tr>
864: <td></td>
865: <td></td>
866: <td class="md" nowrap>u_int32_t </td>
867: <td class="mdname" nowrap> <em>dst</em>, </td>
868: </tr>
869: <tr>
870: <td></td>
871: <td></td>
872: <td class="md" nowrap>libnet_t * </td>
873: <td class="mdname" nowrap> <em>l</em></td>
874: </tr>
875: <tr>
876: <td></td>
877: <td class="md">) </td>
878: <td class="md" colspan="2"></td>
879: </tr>
880:
881: </table>
882: </td>
883: </tr>
884: </table>
885: <table cellspacing=5 cellpadding=0 border=0>
886: <tr>
887: <td>
888:
889: </td>
890: <td>
891:
892: <p>
893: 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 <a class="el" href="libnet-functions_8h.html#a45">libnet_build_ipv4()</a>. 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. <dl compact><dt><b>Parameters:</b></dt><dd>
894: <table border="0" cellspacing="2" cellpadding="0">
895: <tr><td valign=top><em>len</em> </td><td>total length of the IP packet including all subsequent data </td></tr>
896: <tr><td valign=top><em>prot</em> </td><td>upper layer protocol </td></tr>
897: <tr><td valign=top><em>dst</em> </td><td>destination IPv4 address (little endian) </td></tr>
898: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
899: </table>
900: </dl>
901: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
902: </td>
903: </tr>
904: </table>
905: <a class="anchor" name="a53" doxytag="libnet-functions.h::libnet_autobuild_ipv6" ></a><p>
906: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
907: <tr>
908: <td class="mdRow">
909: <table cellpadding="0" cellspacing="0" border="0">
910: <tr>
911: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_ipv6 </td>
912: <td class="md" valign="top">( </td>
913: <td class="md" nowrap valign="top">u_int16_t </td>
914: <td class="mdname" nowrap> <em>len</em>, </td>
915: </tr>
916: <tr>
917: <td></td>
918: <td></td>
919: <td class="md" nowrap>u_int8_t </td>
920: <td class="mdname" nowrap> <em>nh</em>, </td>
921: </tr>
922: <tr>
923: <td></td>
924: <td></td>
925: <td class="md" nowrap>struct libnet_in6_addr </td>
926: <td class="mdname" nowrap> <em>dst</em>, </td>
927: </tr>
928: <tr>
929: <td></td>
930: <td></td>
931: <td class="md" nowrap>libnet_t * </td>
932: <td class="mdname" nowrap> <em>l</em></td>
933: </tr>
934: <tr>
935: <td></td>
936: <td class="md">) </td>
937: <td class="md" colspan="2"></td>
938: </tr>
939:
940: </table>
941: </td>
942: </tr>
943: </table>
944: <table cellspacing=5 cellpadding=0 border=0>
945: <tr>
946: <td>
947:
948: </td>
949: <td>
950:
951: <p>
952: This function is not yet implement and is a NONOP. <dl compact><dt><b>Parameters:</b></dt><dd>
953: <table border="0" cellspacing="2" cellpadding="0">
954: <tr><td valign=top><em>len</em> </td><td>length </td></tr>
955: <tr><td valign=top><em>nh</em> </td><td>next header </td></tr>
956: <tr><td valign=top><em>dst</em> </td><td>destination IPv6 address </td></tr>
957: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
958: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
959: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
960: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
961: </table>
962: </dl>
963: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
964: </td>
965: </tr>
966: </table>
967: <a class="anchor" name="a92" doxytag="libnet-functions.h::libnet_autobuild_link" ></a><p>
968: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
969: <tr>
970: <td class="mdRow">
971: <table cellpadding="0" cellspacing="0" border="0">
972: <tr>
973: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_link </td>
974: <td class="md" valign="top">( </td>
975: <td class="md" nowrap valign="top">u_int8_t * </td>
976: <td class="mdname" nowrap> <em>dst</em>, </td>
977: </tr>
978: <tr>
979: <td></td>
980: <td></td>
981: <td class="md" nowrap>u_int8_t * </td>
982: <td class="mdname" nowrap> <em>oui</em>, </td>
983: </tr>
984: <tr>
985: <td></td>
986: <td></td>
987: <td class="md" nowrap>u_int16_t </td>
988: <td class="mdname" nowrap> <em>type</em>, </td>
989: </tr>
990: <tr>
991: <td></td>
992: <td></td>
993: <td class="md" nowrap>libnet_t * </td>
994: <td class="mdname" nowrap> <em>l</em></td>
995: </tr>
996: <tr>
997: <td></td>
998: <td class="md">) </td>
999: <td class="md" colspan="2"></td>
1000: </tr>
1001:
1002: </table>
1003: </td>
1004: </tr>
1005: </table>
1006: <table cellspacing=5 cellpadding=0 border=0>
1007: <tr>
1008: <td>
1009:
1010: </td>
1011: <td>
1012:
1013: <p>
1014: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
1015: <table border="0" cellspacing="2" cellpadding="0">
1016: <tr><td valign=top><em>dst</em> </td><td>the destination MAC address </td></tr>
1017: <tr><td valign=top><em>oui</em> </td><td>Organizationally Unique Identifier (unused for Ethernet) </td></tr>
1018: <tr><td valign=top><em>type</em> </td><td>the upper layer protocol type </td></tr>
1019: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1020: </table>
1021: </dl>
1022: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1023: </td>
1024: </tr>
1025: </table>
1026: <a class="anchor" name="a64" doxytag="libnet-functions.h::libnet_autobuild_token_ring" ></a><p>
1027: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1028: <tr>
1029: <td class="mdRow">
1030: <table cellpadding="0" cellspacing="0" border="0">
1031: <tr>
1032: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_autobuild_token_ring </td>
1033: <td class="md" valign="top">( </td>
1034: <td class="md" nowrap valign="top">u_int8_t </td>
1035: <td class="mdname" nowrap> <em>ac</em>, </td>
1036: </tr>
1037: <tr>
1038: <td></td>
1039: <td></td>
1040: <td class="md" nowrap>u_int8_t </td>
1041: <td class="mdname" nowrap> <em>fc</em>, </td>
1042: </tr>
1043: <tr>
1044: <td></td>
1045: <td></td>
1046: <td class="md" nowrap>u_int8_t * </td>
1047: <td class="mdname" nowrap> <em>dst</em>, </td>
1048: </tr>
1049: <tr>
1050: <td></td>
1051: <td></td>
1052: <td class="md" nowrap>u_int8_t </td>
1053: <td class="mdname" nowrap> <em>dsap</em>, </td>
1054: </tr>
1055: <tr>
1056: <td></td>
1057: <td></td>
1058: <td class="md" nowrap>u_int8_t </td>
1059: <td class="mdname" nowrap> <em>ssap</em>, </td>
1060: </tr>
1061: <tr>
1062: <td></td>
1063: <td></td>
1064: <td class="md" nowrap>u_int8_t </td>
1065: <td class="mdname" nowrap> <em>cf</em>, </td>
1066: </tr>
1067: <tr>
1068: <td></td>
1069: <td></td>
1070: <td class="md" nowrap>u_int8_t * </td>
1071: <td class="mdname" nowrap> <em>org</em>, </td>
1072: </tr>
1073: <tr>
1074: <td></td>
1075: <td></td>
1076: <td class="md" nowrap>u_int16_t </td>
1077: <td class="mdname" nowrap> <em>type</em>, </td>
1078: </tr>
1079: <tr>
1080: <td></td>
1081: <td></td>
1082: <td class="md" nowrap>libnet_t * </td>
1083: <td class="mdname" nowrap> <em>l</em></td>
1084: </tr>
1085: <tr>
1086: <td></td>
1087: <td class="md">) </td>
1088: <td class="md" colspan="2"></td>
1089: </tr>
1090:
1091: </table>
1092: </td>
1093: </tr>
1094: </table>
1095: <table cellspacing=5 cellpadding=0 border=0>
1096: <tr>
1097: <td>
1098:
1099: </td>
1100: <td>
1101:
1102: <p>
1103: Auto-builds a token ring header. <dl compact><dt><b>Parameters:</b></dt><dd>
1104: <table border="0" cellspacing="2" cellpadding="0">
1105: <tr><td valign=top><em>ac</em> </td><td>access control </td></tr>
1106: <tr><td valign=top><em>fc</em> </td><td>frame control </td></tr>
1107: <tr><td valign=top><em>dst</em> </td><td>destination address </td></tr>
1108: <tr><td valign=top><em>dsap</em> </td><td>destination service access point </td></tr>
1109: <tr><td valign=top><em>ssap</em> </td><td>source service access point </td></tr>
1110: <tr><td valign=top><em>cf</em> </td><td>control field </td></tr>
1111: <tr><td valign=top><em>oui</em> </td><td>Organizationally Unique Identifier </td></tr>
1112: <tr><td valign=top><em>type</em> </td><td>upper layer protocol type </td></tr>
1113: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1114: </table>
1115: </dl>
1116: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1117: </td>
1118: </tr>
1119: </table>
1120: <a class="anchor" name="a23" doxytag="libnet-functions.h::libnet_build_802_1q" ></a><p>
1121: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1122: <tr>
1123: <td class="mdRow">
1124: <table cellpadding="0" cellspacing="0" border="0">
1125: <tr>
1126: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_802_1q </td>
1127: <td class="md" valign="top">( </td>
1128: <td class="md" nowrap valign="top">u_int8_t * </td>
1129: <td class="mdname" nowrap> <em>dst</em>, </td>
1130: </tr>
1131: <tr>
1132: <td></td>
1133: <td></td>
1134: <td class="md" nowrap>u_int8_t * </td>
1135: <td class="mdname" nowrap> <em>src</em>, </td>
1136: </tr>
1137: <tr>
1138: <td></td>
1139: <td></td>
1140: <td class="md" nowrap>u_int16_t </td>
1141: <td class="mdname" nowrap> <em>tpi</em>, </td>
1142: </tr>
1143: <tr>
1144: <td></td>
1145: <td></td>
1146: <td class="md" nowrap>u_int8_t </td>
1147: <td class="mdname" nowrap> <em>priority</em>, </td>
1148: </tr>
1149: <tr>
1150: <td></td>
1151: <td></td>
1152: <td class="md" nowrap>u_int8_t </td>
1153: <td class="mdname" nowrap> <em>cfi</em>, </td>
1154: </tr>
1155: <tr>
1156: <td></td>
1157: <td></td>
1158: <td class="md" nowrap>u_int16_t </td>
1159: <td class="mdname" nowrap> <em>vlan_id</em>, </td>
1160: </tr>
1161: <tr>
1162: <td></td>
1163: <td></td>
1164: <td class="md" nowrap>u_int16_t </td>
1165: <td class="mdname" nowrap> <em>len_proto</em>, </td>
1166: </tr>
1167: <tr>
1168: <td></td>
1169: <td></td>
1170: <td class="md" nowrap>u_int8_t * </td>
1171: <td class="mdname" nowrap> <em>payload</em>, </td>
1172: </tr>
1173: <tr>
1174: <td></td>
1175: <td></td>
1176: <td class="md" nowrap>u_int32_t </td>
1177: <td class="mdname" nowrap> <em>payload_s</em>, </td>
1178: </tr>
1179: <tr>
1180: <td></td>
1181: <td></td>
1182: <td class="md" nowrap>libnet_t * </td>
1183: <td class="mdname" nowrap> <em>l</em>, </td>
1184: </tr>
1185: <tr>
1186: <td></td>
1187: <td></td>
1188: <td class="md" nowrap>libnet_ptag_t </td>
1189: <td class="mdname" nowrap> <em>ptag</em></td>
1190: </tr>
1191: <tr>
1192: <td></td>
1193: <td class="md">) </td>
1194: <td class="md" colspan="2"></td>
1195: </tr>
1196:
1197: </table>
1198: </td>
1199: </tr>
1200: </table>
1201: <table cellspacing=5 cellpadding=0 border=0>
1202: <tr>
1203: <td>
1204:
1205: </td>
1206: <td>
1207:
1208: <p>
1209: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
1210: <table border="0" cellspacing="2" cellpadding="0">
1211: <tr><td valign=top><em>dst</em> </td><td>pointer to a six byte source ethernet address </td></tr>
1212: <tr><td valign=top><em>src</em> </td><td>pointer to a six byte destination ethernet address </td></tr>
1213: <tr><td valign=top><em>tpi</em> </td><td>tag protocol identifier </td></tr>
1214: <tr><td valign=top><em>priority</em> </td><td>priority </td></tr>
1215: <tr><td valign=top><em>cfi</em> </td><td>canonical format indicator </td></tr>
1216: <tr><td valign=top><em>vlan_id</em> </td><td>vlan identifier </td></tr>
1217: <tr><td valign=top><em>len_proto</em> </td><td>length (802.3) protocol (Ethernet II) </td></tr>
1218: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
1219: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
1220: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1221: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
1222: </table>
1223: </dl>
1224: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1225: </td>
1226: </tr>
1227: </table>
1228: <a class="anchor" name="a24" doxytag="libnet-functions.h::libnet_build_802_1x" ></a><p>
1229: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1230: <tr>
1231: <td class="mdRow">
1232: <table cellpadding="0" cellspacing="0" border="0">
1233: <tr>
1234: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_802_1x </td>
1235: <td class="md" valign="top">( </td>
1236: <td class="md" nowrap valign="top">u_int8_t </td>
1237: <td class="mdname" nowrap> <em>eap_ver</em>, </td>
1238: </tr>
1239: <tr>
1240: <td></td>
1241: <td></td>
1242: <td class="md" nowrap>u_int8_t </td>
1243: <td class="mdname" nowrap> <em>eap_type</em>, </td>
1244: </tr>
1245: <tr>
1246: <td></td>
1247: <td></td>
1248: <td class="md" nowrap>u_int16_t </td>
1249: <td class="mdname" nowrap> <em>length</em>, </td>
1250: </tr>
1251: <tr>
1252: <td></td>
1253: <td></td>
1254: <td class="md" nowrap>u_int8_t * </td>
1255: <td class="mdname" nowrap> <em>payload</em>, </td>
1256: </tr>
1257: <tr>
1258: <td></td>
1259: <td></td>
1260: <td class="md" nowrap>u_int32_t </td>
1261: <td class="mdname" nowrap> <em>payload_s</em>, </td>
1262: </tr>
1263: <tr>
1264: <td></td>
1265: <td></td>
1266: <td class="md" nowrap>libnet_t * </td>
1267: <td class="mdname" nowrap> <em>l</em>, </td>
1268: </tr>
1269: <tr>
1270: <td></td>
1271: <td></td>
1272: <td class="md" nowrap>libnet_ptag_t </td>
1273: <td class="mdname" nowrap> <em>ptag</em></td>
1274: </tr>
1275: <tr>
1276: <td></td>
1277: <td class="md">) </td>
1278: <td class="md" colspan="2"></td>
1279: </tr>
1280:
1281: </table>
1282: </td>
1283: </tr>
1284: </table>
1285: <table cellspacing=5 cellpadding=0 border=0>
1286: <tr>
1287: <td>
1288:
1289: </td>
1290: <td>
1291:
1292: <p>
1293: Builds an IEEE 802.1x extended authentication protocol header. <dl compact><dt><b>Parameters:</b></dt><dd>
1294: <table border="0" cellspacing="2" cellpadding="0">
1295: <tr><td valign=top><em>eap_ver</em> </td><td>the EAP version </td></tr>
1296: <tr><td valign=top><em>eap_type</em> </td><td>the EAP type </td></tr>
1297: <tr><td valign=top><em>length</em> </td><td>frame length </td></tr>
1298: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
1299: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
1300: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1301: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
1302: </table>
1303: </dl>
1304: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1305: </td>
1306: </tr>
1307: </table>
1308: <a class="anchor" name="a25" doxytag="libnet-functions.h::libnet_build_802_2" ></a><p>
1309: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1310: <tr>
1311: <td class="mdRow">
1312: <table cellpadding="0" cellspacing="0" border="0">
1313: <tr>
1314: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_802_2 </td>
1315: <td class="md" valign="top">( </td>
1316: <td class="md" nowrap valign="top">u_int8_t </td>
1317: <td class="mdname" nowrap> <em>dsap</em>, </td>
1318: </tr>
1319: <tr>
1320: <td></td>
1321: <td></td>
1322: <td class="md" nowrap>u_int8_t </td>
1323: <td class="mdname" nowrap> <em>ssap</em>, </td>
1324: </tr>
1325: <tr>
1326: <td></td>
1327: <td></td>
1328: <td class="md" nowrap>u_int8_t </td>
1329: <td class="mdname" nowrap> <em>control</em>, </td>
1330: </tr>
1331: <tr>
1332: <td></td>
1333: <td></td>
1334: <td class="md" nowrap>u_int8_t * </td>
1335: <td class="mdname" nowrap> <em>payload</em>, </td>
1336: </tr>
1337: <tr>
1338: <td></td>
1339: <td></td>
1340: <td class="md" nowrap>u_int32_t </td>
1341: <td class="mdname" nowrap> <em>payload_s</em>, </td>
1342: </tr>
1343: <tr>
1344: <td></td>
1345: <td></td>
1346: <td class="md" nowrap>libnet_t * </td>
1347: <td class="mdname" nowrap> <em>l</em>, </td>
1348: </tr>
1349: <tr>
1350: <td></td>
1351: <td></td>
1352: <td class="md" nowrap>libnet_ptag_t </td>
1353: <td class="mdname" nowrap> <em>ptag</em></td>
1354: </tr>
1355: <tr>
1356: <td></td>
1357: <td class="md">) </td>
1358: <td class="md" colspan="2"></td>
1359: </tr>
1360:
1361: </table>
1362: </td>
1363: </tr>
1364: </table>
1365: <table cellspacing=5 cellpadding=0 border=0>
1366: <tr>
1367: <td>
1368:
1369: </td>
1370: <td>
1371:
1372: <p>
1373: Builds an IEEE 802.2 LLC header. <dl compact><dt><b>Parameters:</b></dt><dd>
1374: <table border="0" cellspacing="2" cellpadding="0">
1375: <tr><td valign=top><em>dsap</em> </td><td>destination service access point </td></tr>
1376: <tr><td valign=top><em>ssap</em> </td><td>source service access point </td></tr>
1377: <tr><td valign=top><em>control</em> </td><td>control field </td></tr>
1378: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
1379: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
1380: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1381: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
1382: </table>
1383: </dl>
1384: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1385: </td>
1386: </tr>
1387: </table>
1388: <a class="anchor" name="a26" doxytag="libnet-functions.h::libnet_build_802_2snap" ></a><p>
1389: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1390: <tr>
1391: <td class="mdRow">
1392: <table cellpadding="0" cellspacing="0" border="0">
1393: <tr>
1394: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_802_2snap </td>
1395: <td class="md" valign="top">( </td>
1396: <td class="md" nowrap valign="top">u_int8_t </td>
1397: <td class="mdname" nowrap> <em>dsap</em>, </td>
1398: </tr>
1399: <tr>
1400: <td></td>
1401: <td></td>
1402: <td class="md" nowrap>u_int8_t </td>
1403: <td class="mdname" nowrap> <em>ssap</em>, </td>
1404: </tr>
1405: <tr>
1406: <td></td>
1407: <td></td>
1408: <td class="md" nowrap>u_int8_t </td>
1409: <td class="mdname" nowrap> <em>control</em>, </td>
1410: </tr>
1411: <tr>
1412: <td></td>
1413: <td></td>
1414: <td class="md" nowrap>u_int8_t * </td>
1415: <td class="mdname" nowrap> <em>oui</em>, </td>
1416: </tr>
1417: <tr>
1418: <td></td>
1419: <td></td>
1420: <td class="md" nowrap>u_int16_t </td>
1421: <td class="mdname" nowrap> <em>type</em>, </td>
1422: </tr>
1423: <tr>
1424: <td></td>
1425: <td></td>
1426: <td class="md" nowrap>u_int8_t * </td>
1427: <td class="mdname" nowrap> <em>payload</em>, </td>
1428: </tr>
1429: <tr>
1430: <td></td>
1431: <td></td>
1432: <td class="md" nowrap>u_int32_t </td>
1433: <td class="mdname" nowrap> <em>payload_s</em>, </td>
1434: </tr>
1435: <tr>
1436: <td></td>
1437: <td></td>
1438: <td class="md" nowrap>libnet_t * </td>
1439: <td class="mdname" nowrap> <em>l</em>, </td>
1440: </tr>
1441: <tr>
1442: <td></td>
1443: <td></td>
1444: <td class="md" nowrap>libnet_ptag_t </td>
1445: <td class="mdname" nowrap> <em>ptag</em></td>
1446: </tr>
1447: <tr>
1448: <td></td>
1449: <td class="md">) </td>
1450: <td class="md" colspan="2"></td>
1451: </tr>
1452:
1453: </table>
1454: </td>
1455: </tr>
1456: </table>
1457: <table cellspacing=5 cellpadding=0 border=0>
1458: <tr>
1459: <td>
1460:
1461: </td>
1462: <td>
1463:
1464: <p>
1465: Builds an IEEE 802.2 LLC SNAP header. <dl compact><dt><b>Parameters:</b></dt><dd>
1466: <table border="0" cellspacing="2" cellpadding="0">
1467: <tr><td valign=top><em>dsap</em> </td><td>destination service access point </td></tr>
1468: <tr><td valign=top><em>ssap</em> </td><td>source service access point </td></tr>
1469: <tr><td valign=top><em>control</em> </td><td>control field </td></tr>
1470: <tr><td valign=top><em>oui</em> </td><td>Organizationally Unique Identifier </td></tr>
1471: <tr><td valign=top><em>type</em> </td><td>upper layer protocol </td></tr>
1472: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
1473: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
1474: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1475: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
1476: </table>
1477: </dl>
1478: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1479: </td>
1480: </tr>
1481: </table>
1482: <a class="anchor" name="a27" doxytag="libnet-functions.h::libnet_build_802_3" ></a><p>
1483: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1484: <tr>
1485: <td class="mdRow">
1486: <table cellpadding="0" cellspacing="0" border="0">
1487: <tr>
1488: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_802_3 </td>
1489: <td class="md" valign="top">( </td>
1490: <td class="md" nowrap valign="top">u_int8_t * </td>
1491: <td class="mdname" nowrap> <em>dst</em>, </td>
1492: </tr>
1493: <tr>
1494: <td></td>
1495: <td></td>
1496: <td class="md" nowrap>u_int8_t * </td>
1497: <td class="mdname" nowrap> <em>src</em>, </td>
1498: </tr>
1499: <tr>
1500: <td></td>
1501: <td></td>
1502: <td class="md" nowrap>u_int16_t </td>
1503: <td class="mdname" nowrap> <em>len</em>, </td>
1504: </tr>
1505: <tr>
1506: <td></td>
1507: <td></td>
1508: <td class="md" nowrap>u_int8_t * </td>
1509: <td class="mdname" nowrap> <em>payload</em>, </td>
1510: </tr>
1511: <tr>
1512: <td></td>
1513: <td></td>
1514: <td class="md" nowrap>u_int32_t </td>
1515: <td class="mdname" nowrap> <em>payload_s</em>, </td>
1516: </tr>
1517: <tr>
1518: <td></td>
1519: <td></td>
1520: <td class="md" nowrap>libnet_t * </td>
1521: <td class="mdname" nowrap> <em>l</em>, </td>
1522: </tr>
1523: <tr>
1524: <td></td>
1525: <td></td>
1526: <td class="md" nowrap>libnet_ptag_t </td>
1527: <td class="mdname" nowrap> <em>ptag</em></td>
1528: </tr>
1529: <tr>
1530: <td></td>
1531: <td class="md">) </td>
1532: <td class="md" colspan="2"></td>
1533: </tr>
1534:
1535: </table>
1536: </td>
1537: </tr>
1538: </table>
1539: <table cellspacing=5 cellpadding=0 border=0>
1540: <tr>
1541: <td>
1542:
1543: </td>
1544: <td>
1545:
1546: <p>
1547: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
1548: <table border="0" cellspacing="2" cellpadding="0">
1549: <tr><td valign=top><em>dst</em> </td><td>destination ethernet address </td></tr>
1550: <tr><td valign=top><em>src</em> </td><td>source ethernet address </td></tr>
1551: <tr><td valign=top><em>len</em> </td><td>frame length sans header </td></tr>
1552: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
1553: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
1554: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1555: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
1556: </table>
1557: </dl>
1558: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1559: </td>
1560: </tr>
1561: </table>
1562: <a class="anchor" name="a32" doxytag="libnet-functions.h::libnet_build_arp" ></a><p>
1563: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1564: <tr>
1565: <td class="mdRow">
1566: <table cellpadding="0" cellspacing="0" border="0">
1567: <tr>
1568: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_arp </td>
1569: <td class="md" valign="top">( </td>
1570: <td class="md" nowrap valign="top">u_int16_t </td>
1571: <td class="mdname" nowrap> <em>hrd</em>, </td>
1572: </tr>
1573: <tr>
1574: <td></td>
1575: <td></td>
1576: <td class="md" nowrap>u_int16_t </td>
1577: <td class="mdname" nowrap> <em>pro</em>, </td>
1578: </tr>
1579: <tr>
1580: <td></td>
1581: <td></td>
1582: <td class="md" nowrap>u_int8_t </td>
1583: <td class="mdname" nowrap> <em>hln</em>, </td>
1584: </tr>
1585: <tr>
1586: <td></td>
1587: <td></td>
1588: <td class="md" nowrap>u_int8_t </td>
1589: <td class="mdname" nowrap> <em>pln</em>, </td>
1590: </tr>
1591: <tr>
1592: <td></td>
1593: <td></td>
1594: <td class="md" nowrap>u_int16_t </td>
1595: <td class="mdname" nowrap> <em>op</em>, </td>
1596: </tr>
1597: <tr>
1598: <td></td>
1599: <td></td>
1600: <td class="md" nowrap>u_int8_t * </td>
1601: <td class="mdname" nowrap> <em>sha</em>, </td>
1602: </tr>
1603: <tr>
1604: <td></td>
1605: <td></td>
1606: <td class="md" nowrap>u_int8_t * </td>
1607: <td class="mdname" nowrap> <em>spa</em>, </td>
1608: </tr>
1609: <tr>
1610: <td></td>
1611: <td></td>
1612: <td class="md" nowrap>u_int8_t * </td>
1613: <td class="mdname" nowrap> <em>tha</em>, </td>
1614: </tr>
1615: <tr>
1616: <td></td>
1617: <td></td>
1618: <td class="md" nowrap>u_int8_t * </td>
1619: <td class="mdname" nowrap> <em>tpa</em>, </td>
1620: </tr>
1621: <tr>
1622: <td></td>
1623: <td></td>
1624: <td class="md" nowrap>u_int8_t * </td>
1625: <td class="mdname" nowrap> <em>payload</em>, </td>
1626: </tr>
1627: <tr>
1628: <td></td>
1629: <td></td>
1630: <td class="md" nowrap>u_int32_t </td>
1631: <td class="mdname" nowrap> <em>payload_s</em>, </td>
1632: </tr>
1633: <tr>
1634: <td></td>
1635: <td></td>
1636: <td class="md" nowrap>libnet_t * </td>
1637: <td class="mdname" nowrap> <em>l</em>, </td>
1638: </tr>
1639: <tr>
1640: <td></td>
1641: <td></td>
1642: <td class="md" nowrap>libnet_ptag_t </td>
1643: <td class="mdname" nowrap> <em>ptag</em></td>
1644: </tr>
1645: <tr>
1646: <td></td>
1647: <td class="md">) </td>
1648: <td class="md" colspan="2"></td>
1649: </tr>
1650:
1651: </table>
1652: </td>
1653: </tr>
1654: </table>
1655: <table cellspacing=5 cellpadding=0 border=0>
1656: <tr>
1657: <td>
1658:
1659: </td>
1660: <td>
1661:
1662: <p>
1663: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
1664: <table border="0" cellspacing="2" cellpadding="0">
1665: <tr><td valign=top><em>hrd</em> </td><td>hardware address format </td></tr>
1666: <tr><td valign=top><em>pro</em> </td><td>protocol address format </td></tr>
1667: <tr><td valign=top><em>hln</em> </td><td>hardware address length </td></tr>
1668: <tr><td valign=top><em>pln</em> </td><td>protocol address length </td></tr>
1669: <tr><td valign=top><em>op</em> </td><td>ARP operation type </td></tr>
1670: <tr><td valign=top><em>sha</em> </td><td>sender's hardware address </td></tr>
1671: <tr><td valign=top><em>spa</em> </td><td>sender's protocol address </td></tr>
1672: <tr><td valign=top><em>tha</em> </td><td>target hardware address </td></tr>
1673: <tr><td valign=top><em>tpa</em> </td><td>targer protocol address </td></tr>
1674: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
1675: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
1676: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1677: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
1678: </table>
1679: </dl>
1680: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1681: </td>
1682: </tr>
1683: </table>
1684: <a class="anchor" name="a86" doxytag="libnet-functions.h::libnet_build_bgp4_header" ></a><p>
1685: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1686: <tr>
1687: <td class="mdRow">
1688: <table cellpadding="0" cellspacing="0" border="0">
1689: <tr>
1690: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_bgp4_header </td>
1691: <td class="md" valign="top">( </td>
1692: <td class="md" nowrap valign="top">u_int8_t </td>
1693: <td class="mdname" nowrap> <em>marker</em>[LIBNET_BGP4_MARKER_SIZE], </td>
1694: </tr>
1695: <tr>
1696: <td></td>
1697: <td></td>
1698: <td class="md" nowrap>u_int16_t </td>
1699: <td class="mdname" nowrap> <em>len</em>, </td>
1700: </tr>
1701: <tr>
1702: <td></td>
1703: <td></td>
1704: <td class="md" nowrap>u_int8_t </td>
1705: <td class="mdname" nowrap> <em>type</em>, </td>
1706: </tr>
1707: <tr>
1708: <td></td>
1709: <td></td>
1710: <td class="md" nowrap>u_int8_t * </td>
1711: <td class="mdname" nowrap> <em>payload</em>, </td>
1712: </tr>
1713: <tr>
1714: <td></td>
1715: <td></td>
1716: <td class="md" nowrap>u_int32_t </td>
1717: <td class="mdname" nowrap> <em>payload_s</em>, </td>
1718: </tr>
1719: <tr>
1720: <td></td>
1721: <td></td>
1722: <td class="md" nowrap>libnet_t * </td>
1723: <td class="mdname" nowrap> <em>l</em>, </td>
1724: </tr>
1725: <tr>
1726: <td></td>
1727: <td></td>
1728: <td class="md" nowrap>libnet_ptag_t </td>
1729: <td class="mdname" nowrap> <em>ptag</em></td>
1730: </tr>
1731: <tr>
1732: <td></td>
1733: <td class="md">) </td>
1734: <td class="md" colspan="2"></td>
1735: </tr>
1736:
1737: </table>
1738: </td>
1739: </tr>
1740: </table>
1741: <table cellspacing=5 cellpadding=0 border=0>
1742: <tr>
1743: <td>
1744:
1745: </td>
1746: <td>
1747:
1748: <p>
1749: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
1750: <table border="0" cellspacing="2" cellpadding="0">
1751: <tr><td valign=top><em>marker</em> </td><td>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) </td></tr>
1752: <tr><td valign=top><em>len</em> </td><td>total length of the BGP message, including the header </td></tr>
1753: <tr><td valign=top><em>type</em> </td><td>type code of the message (OPEN, UPDATE, NOTIFICATION or KEEPALIVE) </td></tr>
1754: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
1755: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
1756: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1757: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
1758: </table>
1759: </dl>
1760: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1761: </td>
1762: </tr>
1763: </table>
1764: <a class="anchor" name="a89" doxytag="libnet-functions.h::libnet_build_bgp4_notification" ></a><p>
1765: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1766: <tr>
1767: <td class="mdRow">
1768: <table cellpadding="0" cellspacing="0" border="0">
1769: <tr>
1770: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_bgp4_notification </td>
1771: <td class="md" valign="top">( </td>
1772: <td class="md" nowrap valign="top">u_int8_t </td>
1773: <td class="mdname" nowrap> <em>err_code</em>, </td>
1774: </tr>
1775: <tr>
1776: <td></td>
1777: <td></td>
1778: <td class="md" nowrap>u_int8_t </td>
1779: <td class="mdname" nowrap> <em>err_subcode</em>, </td>
1780: </tr>
1781: <tr>
1782: <td></td>
1783: <td></td>
1784: <td class="md" nowrap>u_int8_t * </td>
1785: <td class="mdname" nowrap> <em>payload</em>, </td>
1786: </tr>
1787: <tr>
1788: <td></td>
1789: <td></td>
1790: <td class="md" nowrap>u_int32_t </td>
1791: <td class="mdname" nowrap> <em>payload_s</em>, </td>
1792: </tr>
1793: <tr>
1794: <td></td>
1795: <td></td>
1796: <td class="md" nowrap>libnet_t * </td>
1797: <td class="mdname" nowrap> <em>l</em>, </td>
1798: </tr>
1799: <tr>
1800: <td></td>
1801: <td></td>
1802: <td class="md" nowrap>libnet_ptag_t </td>
1803: <td class="mdname" nowrap> <em>ptag</em></td>
1804: </tr>
1805: <tr>
1806: <td></td>
1807: <td class="md">) </td>
1808: <td class="md" colspan="2"></td>
1809: </tr>
1810:
1811: </table>
1812: </td>
1813: </tr>
1814: </table>
1815: <table cellspacing=5 cellpadding=0 border=0>
1816: <tr>
1817: <td>
1818:
1819: </td>
1820: <td>
1821:
1822: <p>
1823: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
1824: <table border="0" cellspacing="2" cellpadding="0">
1825: <tr><td valign=top><em>err_code</em> </td><td>type of notification </td></tr>
1826: <tr><td valign=top><em>err_subcode</em> </td><td>more specific information about the reported error. </td></tr>
1827: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
1828: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
1829: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1830: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
1831: </table>
1832: </dl>
1833: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1834: </td>
1835: </tr>
1836: </table>
1837: <a class="anchor" name="a87" doxytag="libnet-functions.h::libnet_build_bgp4_open" ></a><p>
1838: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1839: <tr>
1840: <td class="mdRow">
1841: <table cellpadding="0" cellspacing="0" border="0">
1842: <tr>
1843: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_bgp4_open </td>
1844: <td class="md" valign="top">( </td>
1845: <td class="md" nowrap valign="top">u_int8_t </td>
1846: <td class="mdname" nowrap> <em>version</em>, </td>
1847: </tr>
1848: <tr>
1849: <td></td>
1850: <td></td>
1851: <td class="md" nowrap>u_int16_t </td>
1852: <td class="mdname" nowrap> <em>src_as</em>, </td>
1853: </tr>
1854: <tr>
1855: <td></td>
1856: <td></td>
1857: <td class="md" nowrap>u_int16_t </td>
1858: <td class="mdname" nowrap> <em>hold_time</em>, </td>
1859: </tr>
1860: <tr>
1861: <td></td>
1862: <td></td>
1863: <td class="md" nowrap>u_int32_t </td>
1864: <td class="mdname" nowrap> <em>bgp_id</em>, </td>
1865: </tr>
1866: <tr>
1867: <td></td>
1868: <td></td>
1869: <td class="md" nowrap>u_int8_t </td>
1870: <td class="mdname" nowrap> <em>opt_len</em>, </td>
1871: </tr>
1872: <tr>
1873: <td></td>
1874: <td></td>
1875: <td class="md" nowrap>u_int8_t * </td>
1876: <td class="mdname" nowrap> <em>payload</em>, </td>
1877: </tr>
1878: <tr>
1879: <td></td>
1880: <td></td>
1881: <td class="md" nowrap>u_int32_t </td>
1882: <td class="mdname" nowrap> <em>payload_s</em>, </td>
1883: </tr>
1884: <tr>
1885: <td></td>
1886: <td></td>
1887: <td class="md" nowrap>libnet_t * </td>
1888: <td class="mdname" nowrap> <em>l</em>, </td>
1889: </tr>
1890: <tr>
1891: <td></td>
1892: <td></td>
1893: <td class="md" nowrap>libnet_ptag_t </td>
1894: <td class="mdname" nowrap> <em>ptag</em></td>
1895: </tr>
1896: <tr>
1897: <td></td>
1898: <td class="md">) </td>
1899: <td class="md" colspan="2"></td>
1900: </tr>
1901:
1902: </table>
1903: </td>
1904: </tr>
1905: </table>
1906: <table cellspacing=5 cellpadding=0 border=0>
1907: <tr>
1908: <td>
1909:
1910: </td>
1911: <td>
1912:
1913: <p>
1914: 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). <dl compact><dt><b>Parameters:</b></dt><dd>
1915: <table border="0" cellspacing="2" cellpadding="0">
1916: <tr><td valign=top><em>version</em> </td><td>protocol version (should be set to 4) </td></tr>
1917: <tr><td valign=top><em>src_as</em> </td><td>Autonomous System of the sender </td></tr>
1918: <tr><td valign=top><em>hold_time</em> </td><td>used to compute the maximum allowed time between the receipt of KEEPALIVE, and/or UPDATE messages by the sender </td></tr>
1919: <tr><td valign=top><em>bgp_id</em> </td><td>BGP identifier of the sender </td></tr>
1920: <tr><td valign=top><em>opt_len</em> </td><td>total length of the optional parameters field in bytes </td></tr>
1921: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
1922: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
1923: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
1924: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
1925: </table>
1926: </dl>
1927: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
1928: </td>
1929: </tr>
1930: </table>
1931: <a class="anchor" name="a88" doxytag="libnet-functions.h::libnet_build_bgp4_update" ></a><p>
1932: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1933: <tr>
1934: <td class="mdRow">
1935: <table cellpadding="0" cellspacing="0" border="0">
1936: <tr>
1937: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_bgp4_update </td>
1938: <td class="md" valign="top">( </td>
1939: <td class="md" nowrap valign="top">u_int16_t </td>
1940: <td class="mdname" nowrap> <em>unfeasible_rt_len</em>, </td>
1941: </tr>
1942: <tr>
1943: <td></td>
1944: <td></td>
1945: <td class="md" nowrap>u_int8_t * </td>
1946: <td class="mdname" nowrap> <em>withdrawn_rt</em>, </td>
1947: </tr>
1948: <tr>
1949: <td></td>
1950: <td></td>
1951: <td class="md" nowrap>u_int16_t </td>
1952: <td class="mdname" nowrap> <em>total_path_attr_len</em>, </td>
1953: </tr>
1954: <tr>
1955: <td></td>
1956: <td></td>
1957: <td class="md" nowrap>u_int8_t * </td>
1958: <td class="mdname" nowrap> <em>path_attributes</em>, </td>
1959: </tr>
1960: <tr>
1961: <td></td>
1962: <td></td>
1963: <td class="md" nowrap>u_int16_t </td>
1964: <td class="mdname" nowrap> <em>info_len</em>, </td>
1965: </tr>
1966: <tr>
1967: <td></td>
1968: <td></td>
1969: <td class="md" nowrap>u_int8_t * </td>
1970: <td class="mdname" nowrap> <em>reachability_info</em>, </td>
1971: </tr>
1972: <tr>
1973: <td></td>
1974: <td></td>
1975: <td class="md" nowrap>u_int8_t * </td>
1976: <td class="mdname" nowrap> <em>payload</em>, </td>
1977: </tr>
1978: <tr>
1979: <td></td>
1980: <td></td>
1981: <td class="md" nowrap>u_int32_t </td>
1982: <td class="mdname" nowrap> <em>payload_s</em>, </td>
1983: </tr>
1984: <tr>
1985: <td></td>
1986: <td></td>
1987: <td class="md" nowrap>libnet_t * </td>
1988: <td class="mdname" nowrap> <em>l</em>, </td>
1989: </tr>
1990: <tr>
1991: <td></td>
1992: <td></td>
1993: <td class="md" nowrap>libnet_ptag_t </td>
1994: <td class="mdname" nowrap> <em>ptag</em></td>
1995: </tr>
1996: <tr>
1997: <td></td>
1998: <td class="md">) </td>
1999: <td class="md" colspan="2"></td>
2000: </tr>
2001:
2002: </table>
2003: </td>
2004: </tr>
2005: </table>
2006: <table cellspacing=5 cellpadding=0 border=0>
2007: <tr>
2008: <td>
2009:
2010: </td>
2011: <td>
2012:
2013: <p>
2014: Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) update header. Update messages are used to transfer routing information between BGP peers. <dl compact><dt><b>Parameters:</b></dt><dd>
2015: <table border="0" cellspacing="2" cellpadding="0">
2016: <tr><td valign=top><em>unfeasible_rt_len</em> </td><td>indicates the length of the (next) "withdrawn routes" field in bytes </td></tr>
2017: <tr><td valign=top><em>withdrawn_rt</em> </td><td>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)> </td></tr>
2018: <tr><td valign=top><em>total_path_attr_len</em> </td><td>indicates the length of the (next) "path attributes" field in bytes </td></tr>
2019: <tr><td valign=top><em>path_attributes</em> </td><td>each attribute is a 3-tuple <type (2 bytes), length, value> </td></tr>
2020: <tr><td valign=top><em>info_len</em> </td><td>indicates the length of the (next) "network layer reachability information" field in bytes (needed for internal memory size calculation) </td></tr>
2021: <tr><td valign=top><em>reachability_info</em> </td><td>2-tuples <length (1 byte), prefix (variable)>. </td></tr>
2022: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
2023: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
2024: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
2025: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
2026: </table>
2027: </dl>
2028: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
2029: </td>
2030: </tr>
2031: </table>
2032: <a class="anchor" name="a80" doxytag="libnet-functions.h::libnet_build_bootpv4" ></a><p>
2033: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2034: <tr>
2035: <td class="mdRow">
2036: <table cellpadding="0" cellspacing="0" border="0">
2037: <tr>
2038: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_bootpv4 </td>
2039: <td class="md" valign="top">( </td>
2040: <td class="md" nowrap valign="top">u_int8_t </td>
2041: <td class="mdname" nowrap> <em>opcode</em>, </td>
2042: </tr>
2043: <tr>
2044: <td></td>
2045: <td></td>
2046: <td class="md" nowrap>u_int8_t </td>
2047: <td class="mdname" nowrap> <em>htype</em>, </td>
2048: </tr>
2049: <tr>
2050: <td></td>
2051: <td></td>
2052: <td class="md" nowrap>u_int8_t </td>
2053: <td class="mdname" nowrap> <em>hlen</em>, </td>
2054: </tr>
2055: <tr>
2056: <td></td>
2057: <td></td>
2058: <td class="md" nowrap>u_int8_t </td>
2059: <td class="mdname" nowrap> <em>hopcount</em>, </td>
2060: </tr>
2061: <tr>
2062: <td></td>
2063: <td></td>
2064: <td class="md" nowrap>u_int32_t </td>
2065: <td class="mdname" nowrap> <em>xid</em>, </td>
2066: </tr>
2067: <tr>
2068: <td></td>
2069: <td></td>
2070: <td class="md" nowrap>u_int16_t </td>
2071: <td class="mdname" nowrap> <em>secs</em>, </td>
2072: </tr>
2073: <tr>
2074: <td></td>
2075: <td></td>
2076: <td class="md" nowrap>u_int16_t </td>
2077: <td class="mdname" nowrap> <em>flags</em>, </td>
2078: </tr>
2079: <tr>
2080: <td></td>
2081: <td></td>
2082: <td class="md" nowrap>u_int32_t </td>
2083: <td class="mdname" nowrap> <em>cip</em>, </td>
2084: </tr>
2085: <tr>
2086: <td></td>
2087: <td></td>
2088: <td class="md" nowrap>u_int32_t </td>
2089: <td class="mdname" nowrap> <em>yip</em>, </td>
2090: </tr>
2091: <tr>
2092: <td></td>
2093: <td></td>
2094: <td class="md" nowrap>u_int32_t </td>
2095: <td class="mdname" nowrap> <em>sip</em>, </td>
2096: </tr>
2097: <tr>
2098: <td></td>
2099: <td></td>
2100: <td class="md" nowrap>u_int32_t </td>
2101: <td class="mdname" nowrap> <em>gip</em>, </td>
2102: </tr>
2103: <tr>
2104: <td></td>
2105: <td></td>
2106: <td class="md" nowrap>u_int8_t * </td>
2107: <td class="mdname" nowrap> <em>chaddr</em>, </td>
2108: </tr>
2109: <tr>
2110: <td></td>
2111: <td></td>
2112: <td class="md" nowrap>u_int8_t * </td>
2113: <td class="mdname" nowrap> <em>sname</em>, </td>
2114: </tr>
2115: <tr>
2116: <td></td>
2117: <td></td>
2118: <td class="md" nowrap>u_int8_t * </td>
2119: <td class="mdname" nowrap> <em>file</em>, </td>
2120: </tr>
2121: <tr>
2122: <td></td>
2123: <td></td>
2124: <td class="md" nowrap>u_int8_t * </td>
2125: <td class="mdname" nowrap> <em>payload</em>, </td>
2126: </tr>
2127: <tr>
2128: <td></td>
2129: <td></td>
2130: <td class="md" nowrap>u_int32_t </td>
2131: <td class="mdname" nowrap> <em>payload_s</em>, </td>
2132: </tr>
2133: <tr>
2134: <td></td>
2135: <td></td>
2136: <td class="md" nowrap>libnet_t * </td>
2137: <td class="mdname" nowrap> <em>l</em>, </td>
2138: </tr>
2139: <tr>
2140: <td></td>
2141: <td></td>
2142: <td class="md" nowrap>libnet_ptag_t </td>
2143: <td class="mdname" nowrap> <em>ptag</em></td>
2144: </tr>
2145: <tr>
2146: <td></td>
2147: <td class="md">) </td>
2148: <td class="md" colspan="2"></td>
2149: </tr>
2150:
2151: </table>
2152: </td>
2153: </tr>
2154: </table>
2155: <table cellspacing=5 cellpadding=0 border=0>
2156: <tr>
2157: <td>
2158:
2159: </td>
2160: <td>
2161:
2162: <p>
2163: <dl compact><dt><b>Parameters:</b></dt><dd>
2164: <table border="0" cellspacing="2" cellpadding="0">
2165: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
2166: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
2167: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
2168: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
2169: </table>
2170: </dl>
2171: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
2172: </td>
2173: </tr>
2174: </table>
2175: <a class="anchor" name="a37" doxytag="libnet-functions.h::libnet_build_cdp" ></a><p>
2176: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2177: <tr>
2178: <td class="mdRow">
2179: <table cellpadding="0" cellspacing="0" border="0">
2180: <tr>
2181: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_cdp </td>
2182: <td class="md" valign="top">( </td>
2183: <td class="md" nowrap valign="top">u_int8_t </td>
2184: <td class="mdname" nowrap> <em>version</em>, </td>
2185: </tr>
2186: <tr>
2187: <td></td>
2188: <td></td>
2189: <td class="md" nowrap>u_int8_t </td>
2190: <td class="mdname" nowrap> <em>ttl</em>, </td>
2191: </tr>
2192: <tr>
2193: <td></td>
2194: <td></td>
2195: <td class="md" nowrap>u_int16_t </td>
2196: <td class="mdname" nowrap> <em>sum</em>, </td>
2197: </tr>
2198: <tr>
2199: <td></td>
2200: <td></td>
2201: <td class="md" nowrap>u_int16_t </td>
2202: <td class="mdname" nowrap> <em>type</em>, </td>
2203: </tr>
2204: <tr>
2205: <td></td>
2206: <td></td>
2207: <td class="md" nowrap>u_int16_t </td>
2208: <td class="mdname" nowrap> <em>len</em>, </td>
2209: </tr>
2210: <tr>
2211: <td></td>
2212: <td></td>
2213: <td class="md" nowrap>u_int8_t * </td>
2214: <td class="mdname" nowrap> <em>value</em>, </td>
2215: </tr>
2216: <tr>
2217: <td></td>
2218: <td></td>
2219: <td class="md" nowrap>u_int8_t * </td>
2220: <td class="mdname" nowrap> <em>payload</em>, </td>
2221: </tr>
2222: <tr>
2223: <td></td>
2224: <td></td>
2225: <td class="md" nowrap>u_int32_t </td>
2226: <td class="mdname" nowrap> <em>payload_s</em>, </td>
2227: </tr>
2228: <tr>
2229: <td></td>
2230: <td></td>
2231: <td class="md" nowrap>libnet_t * </td>
2232: <td class="mdname" nowrap> <em>l</em>, </td>
2233: </tr>
2234: <tr>
2235: <td></td>
2236: <td></td>
2237: <td class="md" nowrap>libnet_ptag_t </td>
2238: <td class="mdname" nowrap> <em>ptag</em></td>
2239: </tr>
2240: <tr>
2241: <td></td>
2242: <td class="md">) </td>
2243: <td class="md" colspan="2"></td>
2244: </tr>
2245:
2246: </table>
2247: </td>
2248: </tr>
2249: </table>
2250: <table cellspacing=5 cellpadding=0 border=0>
2251: <tr>
2252: <td>
2253:
2254: </td>
2255: <td>
2256:
2257: <p>
2258: 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 <a class="el" href="libnet-functions_8h.html#a78">libnet_build_data()</a> to construct them. <dl compact><dt><b>Parameters:</b></dt><dd>
2259: <table border="0" cellspacing="2" cellpadding="0">
2260: <tr><td valign=top><em>version</em> </td><td>CDP version </td></tr>
2261: <tr><td valign=top><em>ttl</em> </td><td>time to live (time information should be cached by recipient) </td></tr>
2262: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
2263: <tr><td valign=top><em>type</em> </td><td>type of data contained in value </td></tr>
2264: <tr><td valign=top><em>len</em> </td><td>length of value arugment </td></tr>
2265: <tr><td valign=top><em>value</em> </td><td>the CDP information string </td></tr>
2266: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
2267: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
2268: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
2269: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
2270: </table>
2271: </dl>
2272: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
2273: </td>
2274: </tr>
2275: </table>
2276: <a class="anchor" name="a78" doxytag="libnet-functions.h::libnet_build_data" ></a><p>
2277: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2278: <tr>
2279: <td class="mdRow">
2280: <table cellpadding="0" cellspacing="0" border="0">
2281: <tr>
2282: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_data </td>
2283: <td class="md" valign="top">( </td>
2284: <td class="md" nowrap valign="top">u_int8_t * </td>
2285: <td class="mdname" nowrap> <em>payload</em>, </td>
2286: </tr>
2287: <tr>
2288: <td></td>
2289: <td></td>
2290: <td class="md" nowrap>u_int32_t </td>
2291: <td class="mdname" nowrap> <em>payload_s</em>, </td>
2292: </tr>
2293: <tr>
2294: <td></td>
2295: <td></td>
2296: <td class="md" nowrap>libnet_t * </td>
2297: <td class="mdname" nowrap> <em>l</em>, </td>
2298: </tr>
2299: <tr>
2300: <td></td>
2301: <td></td>
2302: <td class="md" nowrap>libnet_ptag_t </td>
2303: <td class="mdname" nowrap> <em>ptag</em></td>
2304: </tr>
2305: <tr>
2306: <td></td>
2307: <td class="md">) </td>
2308: <td class="md" colspan="2"></td>
2309: </tr>
2310:
2311: </table>
2312: </td>
2313: </tr>
2314: </table>
2315: <table cellspacing=5 cellpadding=0 border=0>
2316: <tr>
2317: <td>
2318:
2319: </td>
2320: <td>
2321:
2322: <p>
2323: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
2324: <table border="0" cellspacing="2" cellpadding="0">
2325: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
2326: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
2327: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
2328: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
2329: </table>
2330: </dl>
2331: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
2332: </td>
2333: </tr>
2334: </table>
2335: <a class="anchor" name="a79" doxytag="libnet-functions.h::libnet_build_dhcpv4" ></a><p>
2336: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2337: <tr>
2338: <td class="mdRow">
2339: <table cellpadding="0" cellspacing="0" border="0">
2340: <tr>
2341: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_dhcpv4 </td>
2342: <td class="md" valign="top">( </td>
2343: <td class="md" nowrap valign="top">u_int8_t </td>
2344: <td class="mdname" nowrap> <em>opcode</em>, </td>
2345: </tr>
2346: <tr>
2347: <td></td>
2348: <td></td>
2349: <td class="md" nowrap>u_int8_t </td>
2350: <td class="mdname" nowrap> <em>htype</em>, </td>
2351: </tr>
2352: <tr>
2353: <td></td>
2354: <td></td>
2355: <td class="md" nowrap>u_int8_t </td>
2356: <td class="mdname" nowrap> <em>hlen</em>, </td>
2357: </tr>
2358: <tr>
2359: <td></td>
2360: <td></td>
2361: <td class="md" nowrap>u_int8_t </td>
2362: <td class="mdname" nowrap> <em>hopcount</em>, </td>
2363: </tr>
2364: <tr>
2365: <td></td>
2366: <td></td>
2367: <td class="md" nowrap>u_int32_t </td>
2368: <td class="mdname" nowrap> <em>xid</em>, </td>
2369: </tr>
2370: <tr>
2371: <td></td>
2372: <td></td>
2373: <td class="md" nowrap>u_int16_t </td>
2374: <td class="mdname" nowrap> <em>secs</em>, </td>
2375: </tr>
2376: <tr>
2377: <td></td>
2378: <td></td>
2379: <td class="md" nowrap>u_int16_t </td>
2380: <td class="mdname" nowrap> <em>flags</em>, </td>
2381: </tr>
2382: <tr>
2383: <td></td>
2384: <td></td>
2385: <td class="md" nowrap>u_int32_t </td>
2386: <td class="mdname" nowrap> <em>cip</em>, </td>
2387: </tr>
2388: <tr>
2389: <td></td>
2390: <td></td>
2391: <td class="md" nowrap>u_int32_t </td>
2392: <td class="mdname" nowrap> <em>yip</em>, </td>
2393: </tr>
2394: <tr>
2395: <td></td>
2396: <td></td>
2397: <td class="md" nowrap>u_int32_t </td>
2398: <td class="mdname" nowrap> <em>sip</em>, </td>
2399: </tr>
2400: <tr>
2401: <td></td>
2402: <td></td>
2403: <td class="md" nowrap>u_int32_t </td>
2404: <td class="mdname" nowrap> <em>gip</em>, </td>
2405: </tr>
2406: <tr>
2407: <td></td>
2408: <td></td>
2409: <td class="md" nowrap>u_int8_t * </td>
2410: <td class="mdname" nowrap> <em>chaddr</em>, </td>
2411: </tr>
2412: <tr>
2413: <td></td>
2414: <td></td>
2415: <td class="md" nowrap>u_int8_t * </td>
2416: <td class="mdname" nowrap> <em>sname</em>, </td>
2417: </tr>
2418: <tr>
2419: <td></td>
2420: <td></td>
2421: <td class="md" nowrap>u_int8_t * </td>
2422: <td class="mdname" nowrap> <em>file</em>, </td>
2423: </tr>
2424: <tr>
2425: <td></td>
2426: <td></td>
2427: <td class="md" nowrap>u_int8_t * </td>
2428: <td class="mdname" nowrap> <em>payload</em>, </td>
2429: </tr>
2430: <tr>
2431: <td></td>
2432: <td></td>
2433: <td class="md" nowrap>u_int32_t </td>
2434: <td class="mdname" nowrap> <em>payload_s</em>, </td>
2435: </tr>
2436: <tr>
2437: <td></td>
2438: <td></td>
2439: <td class="md" nowrap>libnet_t * </td>
2440: <td class="mdname" nowrap> <em>l</em>, </td>
2441: </tr>
2442: <tr>
2443: <td></td>
2444: <td></td>
2445: <td class="md" nowrap>libnet_ptag_t </td>
2446: <td class="mdname" nowrap> <em>ptag</em></td>
2447: </tr>
2448: <tr>
2449: <td></td>
2450: <td class="md">) </td>
2451: <td class="md" colspan="2"></td>
2452: </tr>
2453:
2454: </table>
2455: </td>
2456: </tr>
2457: </table>
2458: <table cellspacing=5 cellpadding=0 border=0>
2459: <tr>
2460: <td>
2461:
2462: </td>
2463: <td>
2464:
2465: <p>
2466: <dl compact><dt><b>Parameters:</b></dt><dd>
2467: <table border="0" cellspacing="2" cellpadding="0">
2468: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
2469: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
2470: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
2471: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
2472: </table>
2473: </dl>
2474: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
2475: </td>
2476: </tr>
2477: </table>
2478: <a class="anchor" name="a58" doxytag="libnet-functions.h::libnet_build_dnsv4" ></a><p>
2479: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2480: <tr>
2481: <td class="mdRow">
2482: <table cellpadding="0" cellspacing="0" border="0">
2483: <tr>
2484: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_dnsv4 </td>
2485: <td class="md" valign="top">( </td>
2486: <td class="md" nowrap valign="top">u_int16_t </td>
2487: <td class="mdname" nowrap> <em>h_len</em>, </td>
2488: </tr>
2489: <tr>
2490: <td></td>
2491: <td></td>
2492: <td class="md" nowrap>u_int16_t </td>
2493: <td class="mdname" nowrap> <em>id</em>, </td>
2494: </tr>
2495: <tr>
2496: <td></td>
2497: <td></td>
2498: <td class="md" nowrap>u_int16_t </td>
2499: <td class="mdname" nowrap> <em>flags</em>, </td>
2500: </tr>
2501: <tr>
2502: <td></td>
2503: <td></td>
2504: <td class="md" nowrap>u_int16_t </td>
2505: <td class="mdname" nowrap> <em>num_q</em>, </td>
2506: </tr>
2507: <tr>
2508: <td></td>
2509: <td></td>
2510: <td class="md" nowrap>u_int16_t </td>
2511: <td class="mdname" nowrap> <em>num_anws_rr</em>, </td>
2512: </tr>
2513: <tr>
2514: <td></td>
2515: <td></td>
2516: <td class="md" nowrap>u_int16_t </td>
2517: <td class="mdname" nowrap> <em>num_auth_rr</em>, </td>
2518: </tr>
2519: <tr>
2520: <td></td>
2521: <td></td>
2522: <td class="md" nowrap>u_int16_t </td>
2523: <td class="mdname" nowrap> <em>num_addi_rr</em>, </td>
2524: </tr>
2525: <tr>
2526: <td></td>
2527: <td></td>
2528: <td class="md" nowrap>u_int8_t * </td>
2529: <td class="mdname" nowrap> <em>payload</em>, </td>
2530: </tr>
2531: <tr>
2532: <td></td>
2533: <td></td>
2534: <td class="md" nowrap>u_int32_t </td>
2535: <td class="mdname" nowrap> <em>payload_s</em>, </td>
2536: </tr>
2537: <tr>
2538: <td></td>
2539: <td></td>
2540: <td class="md" nowrap>libnet_t * </td>
2541: <td class="mdname" nowrap> <em>l</em>, </td>
2542: </tr>
2543: <tr>
2544: <td></td>
2545: <td></td>
2546: <td class="md" nowrap>libnet_ptag_t </td>
2547: <td class="mdname" nowrap> <em>ptag</em></td>
2548: </tr>
2549: <tr>
2550: <td></td>
2551: <td class="md">) </td>
2552: <td class="md" colspan="2"></td>
2553: </tr>
2554:
2555: </table>
2556: </td>
2557: </tr>
2558: </table>
2559: <table cellspacing=5 cellpadding=0 border=0>
2560: <tr>
2561: <td>
2562:
2563: </td>
2564: <td>
2565:
2566: <p>
2567: Builds an RFC 1035 version 4 DNS header. Additional DNS payload information should be specified using the payload interface. <dl compact><dt><b>Parameters:</b></dt><dd>
2568: <table border="0" cellspacing="2" cellpadding="0">
2569: <tr><td valign=top><em>id</em> </td><td>DNS packet id </td></tr>
2570: <tr><td valign=top><em>flags</em> </td><td>control flags </td></tr>
2571: <tr><td valign=top><em>num_q</em> </td><td>number of questions </td></tr>
2572: <tr><td valign=top><em>num_anws_rr</em> </td><td>number of answer resource records </td></tr>
2573: <tr><td valign=top><em>num_auth_rr</em> </td><td>number of authority resource records </td></tr>
2574: <tr><td valign=top><em>num_addi_rr</em> </td><td>number of additional resource records </td></tr>
2575: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
2576: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
2577: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
2578: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
2579: </table>
2580: </dl>
2581: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
2582: </td>
2583: </tr>
2584: </table>
2585: <a class="anchor" name="a83" doxytag="libnet-functions.h::libnet_build_egre" ></a><p>
2586: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2587: <tr>
2588: <td class="mdRow">
2589: <table cellpadding="0" cellspacing="0" border="0">
2590: <tr>
2591: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_egre </td>
2592: <td class="md" valign="top">( </td>
2593: <td class="md" nowrap valign="top">u_int16_t </td>
2594: <td class="mdname" nowrap> <em>fv</em>, </td>
2595: </tr>
2596: <tr>
2597: <td></td>
2598: <td></td>
2599: <td class="md" nowrap>u_int16_t </td>
2600: <td class="mdname" nowrap> <em>type</em>, </td>
2601: </tr>
2602: <tr>
2603: <td></td>
2604: <td></td>
2605: <td class="md" nowrap>u_int16_t </td>
2606: <td class="mdname" nowrap> <em>sum</em>, </td>
2607: </tr>
2608: <tr>
2609: <td></td>
2610: <td></td>
2611: <td class="md" nowrap>u_int16_t </td>
2612: <td class="mdname" nowrap> <em>offset</em>, </td>
2613: </tr>
2614: <tr>
2615: <td></td>
2616: <td></td>
2617: <td class="md" nowrap>u_int32_t </td>
2618: <td class="mdname" nowrap> <em>key</em>, </td>
2619: </tr>
2620: <tr>
2621: <td></td>
2622: <td></td>
2623: <td class="md" nowrap>u_int32_t </td>
2624: <td class="mdname" nowrap> <em>seq</em>, </td>
2625: </tr>
2626: <tr>
2627: <td></td>
2628: <td></td>
2629: <td class="md" nowrap>u_int16_t </td>
2630: <td class="mdname" nowrap> <em>len</em>, </td>
2631: </tr>
2632: <tr>
2633: <td></td>
2634: <td></td>
2635: <td class="md" nowrap>u_int8_t * </td>
2636: <td class="mdname" nowrap> <em>payload</em>, </td>
2637: </tr>
2638: <tr>
2639: <td></td>
2640: <td></td>
2641: <td class="md" nowrap>u_int32_t </td>
2642: <td class="mdname" nowrap> <em>payload_s</em>, </td>
2643: </tr>
2644: <tr>
2645: <td></td>
2646: <td></td>
2647: <td class="md" nowrap>libnet_t * </td>
2648: <td class="mdname" nowrap> <em>l</em>, </td>
2649: </tr>
2650: <tr>
2651: <td></td>
2652: <td></td>
2653: <td class="md" nowrap>libnet_ptag_t </td>
2654: <td class="mdname" nowrap> <em>ptag</em></td>
2655: </tr>
2656: <tr>
2657: <td></td>
2658: <td class="md">) </td>
2659: <td class="md" colspan="2"></td>
2660: </tr>
2661:
2662: </table>
2663: </td>
2664: </tr>
2665: </table>
2666: <table cellspacing=5 cellpadding=0 border=0>
2667: <tr>
2668: <td>
2669:
2670: </td>
2671: <td>
2672:
2673: <p>
2674: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
2675: <table border="0" cellspacing="2" cellpadding="0">
2676: <tr><td valign=top><em>fv</em> </td><td>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. </td></tr>
2677: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
2678: <tr><td valign=top><em>type</em> </td><td>which protocol is encapsulated (PPP, IP, ...) </td></tr>
2679: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill). </td></tr>
2680: <tr><td valign=top><em>offset</em> </td><td>byte offset from the start of the routing field to the first byte of the SRE </td></tr>
2681: <tr><td valign=top><em>key</em> </td><td>inserted by the encapsulator to authenticate the source </td></tr>
2682: <tr><td valign=top><em>seq</em> </td><td>sequence number used by the receiver to sort the packets </td></tr>
2683: <tr><td valign=top><em>len</em> </td><td>size of the GRE packet </td></tr>
2684: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
2685: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
2686: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
2687: </table>
2688: </dl>
2689: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
2690: </td>
2691: </tr>
2692: </table>
2693: <a class="anchor" name="a28" doxytag="libnet-functions.h::libnet_build_ethernet" ></a><p>
2694: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2695: <tr>
2696: <td class="mdRow">
2697: <table cellpadding="0" cellspacing="0" border="0">
2698: <tr>
2699: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ethernet </td>
2700: <td class="md" valign="top">( </td>
2701: <td class="md" nowrap valign="top">u_int8_t * </td>
2702: <td class="mdname" nowrap> <em>dst</em>, </td>
2703: </tr>
2704: <tr>
2705: <td></td>
2706: <td></td>
2707: <td class="md" nowrap>u_int8_t * </td>
2708: <td class="mdname" nowrap> <em>src</em>, </td>
2709: </tr>
2710: <tr>
2711: <td></td>
2712: <td></td>
2713: <td class="md" nowrap>u_int16_t </td>
2714: <td class="mdname" nowrap> <em>type</em>, </td>
2715: </tr>
2716: <tr>
2717: <td></td>
2718: <td></td>
2719: <td class="md" nowrap>u_int8_t * </td>
2720: <td class="mdname" nowrap> <em>payload</em>, </td>
2721: </tr>
2722: <tr>
2723: <td></td>
2724: <td></td>
2725: <td class="md" nowrap>u_int32_t </td>
2726: <td class="mdname" nowrap> <em>payload_s</em>, </td>
2727: </tr>
2728: <tr>
2729: <td></td>
2730: <td></td>
2731: <td class="md" nowrap>libnet_t * </td>
2732: <td class="mdname" nowrap> <em>l</em>, </td>
2733: </tr>
2734: <tr>
2735: <td></td>
2736: <td></td>
2737: <td class="md" nowrap>libnet_ptag_t </td>
2738: <td class="mdname" nowrap> <em>ptag</em></td>
2739: </tr>
2740: <tr>
2741: <td></td>
2742: <td class="md">) </td>
2743: <td class="md" colspan="2"></td>
2744: </tr>
2745:
2746: </table>
2747: </td>
2748: </tr>
2749: </table>
2750: <table cellspacing=5 cellpadding=0 border=0>
2751: <tr>
2752: <td>
2753:
2754: </td>
2755: <td>
2756:
2757: <p>
2758: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
2759: <table border="0" cellspacing="2" cellpadding="0">
2760: <tr><td valign=top><em>dst</em> </td><td>destination ethernet address </td></tr>
2761: <tr><td valign=top><em>src</em> </td><td>source ethernet address </td></tr>
2762: <tr><td valign=top><em>type</em> </td><td>upper layer protocol type </td></tr>
2763: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
2764: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
2765: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
2766: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
2767: </table>
2768: </dl>
2769: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
2770: </td>
2771: </tr>
2772: </table>
2773: <a class="anchor" name="a30" doxytag="libnet-functions.h::libnet_build_fddi" ></a><p>
2774: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2775: <tr>
2776: <td class="mdRow">
2777: <table cellpadding="0" cellspacing="0" border="0">
2778: <tr>
2779: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_fddi </td>
2780: <td class="md" valign="top">( </td>
2781: <td class="md" nowrap valign="top">u_int8_t </td>
2782: <td class="mdname" nowrap> <em>fc</em>, </td>
2783: </tr>
2784: <tr>
2785: <td></td>
2786: <td></td>
2787: <td class="md" nowrap>u_int8_t * </td>
2788: <td class="mdname" nowrap> <em>dst</em>, </td>
2789: </tr>
2790: <tr>
2791: <td></td>
2792: <td></td>
2793: <td class="md" nowrap>u_int8_t * </td>
2794: <td class="mdname" nowrap> <em>src</em>, </td>
2795: </tr>
2796: <tr>
2797: <td></td>
2798: <td></td>
2799: <td class="md" nowrap>u_int8_t </td>
2800: <td class="mdname" nowrap> <em>dsap</em>, </td>
2801: </tr>
2802: <tr>
2803: <td></td>
2804: <td></td>
2805: <td class="md" nowrap>u_int8_t </td>
2806: <td class="mdname" nowrap> <em>ssap</em>, </td>
2807: </tr>
2808: <tr>
2809: <td></td>
2810: <td></td>
2811: <td class="md" nowrap>u_int8_t </td>
2812: <td class="mdname" nowrap> <em>cf</em>, </td>
2813: </tr>
2814: <tr>
2815: <td></td>
2816: <td></td>
2817: <td class="md" nowrap>u_int8_t * </td>
2818: <td class="mdname" nowrap> <em>org</em>, </td>
2819: </tr>
2820: <tr>
2821: <td></td>
2822: <td></td>
2823: <td class="md" nowrap>u_int16_t </td>
2824: <td class="mdname" nowrap> <em>type</em>, </td>
2825: </tr>
2826: <tr>
2827: <td></td>
2828: <td></td>
2829: <td class="md" nowrap>u_int8_t * </td>
2830: <td class="mdname" nowrap> <em>payload</em>, </td>
2831: </tr>
2832: <tr>
2833: <td></td>
2834: <td></td>
2835: <td class="md" nowrap>u_int32_t </td>
2836: <td class="mdname" nowrap> <em>payload_s</em>, </td>
2837: </tr>
2838: <tr>
2839: <td></td>
2840: <td></td>
2841: <td class="md" nowrap>libnet_t * </td>
2842: <td class="mdname" nowrap> <em>l</em>, </td>
2843: </tr>
2844: <tr>
2845: <td></td>
2846: <td></td>
2847: <td class="md" nowrap>libnet_ptag_t </td>
2848: <td class="mdname" nowrap> <em>ptag</em></td>
2849: </tr>
2850: <tr>
2851: <td></td>
2852: <td class="md">) </td>
2853: <td class="md" colspan="2"></td>
2854: </tr>
2855:
2856: </table>
2857: </td>
2858: </tr>
2859: </table>
2860: <table cellspacing=5 cellpadding=0 border=0>
2861: <tr>
2862: <td>
2863:
2864: </td>
2865: <td>
2866:
2867: <p>
2868: Builds a Fiber Distributed Data Interface (FDDI) header. <dl compact><dt><b>Parameters:</b></dt><dd>
2869: <table border="0" cellspacing="2" cellpadding="0">
2870: <tr><td valign=top><em>fc</em> </td><td>class format and priority dst destination fddi address src source fddi address </td></tr>
2871: <tr><td valign=top><em>dsap</em> </td><td>destination service access point </td></tr>
2872: <tr><td valign=top><em>ssap</em> </td><td>source service access point </td></tr>
2873: <tr><td valign=top><em>cf</em> </td><td>cf </td></tr>
2874: <tr><td valign=top><em>org</em> </td><td>3 byte IEEE organizational code </td></tr>
2875: <tr><td valign=top><em>type</em> </td><td>upper layer protocol </td></tr>
2876: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
2877: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
2878: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
2879: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
2880: </table>
2881: </dl>
2882: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
2883: </td>
2884: </tr>
2885: </table>
2886: <a class="anchor" name="a82" doxytag="libnet-functions.h::libnet_build_gre" ></a><p>
2887: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2888: <tr>
2889: <td class="mdRow">
2890: <table cellpadding="0" cellspacing="0" border="0">
2891: <tr>
2892: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_gre </td>
2893: <td class="md" valign="top">( </td>
2894: <td class="md" nowrap valign="top">u_int16_t </td>
2895: <td class="mdname" nowrap> <em>fv</em>, </td>
2896: </tr>
2897: <tr>
2898: <td></td>
2899: <td></td>
2900: <td class="md" nowrap>u_int16_t </td>
2901: <td class="mdname" nowrap> <em>type</em>, </td>
2902: </tr>
2903: <tr>
2904: <td></td>
2905: <td></td>
2906: <td class="md" nowrap>u_int16_t </td>
2907: <td class="mdname" nowrap> <em>sum</em>, </td>
2908: </tr>
2909: <tr>
2910: <td></td>
2911: <td></td>
2912: <td class="md" nowrap>u_int16_t </td>
2913: <td class="mdname" nowrap> <em>offset</em>, </td>
2914: </tr>
2915: <tr>
2916: <td></td>
2917: <td></td>
2918: <td class="md" nowrap>u_int32_t </td>
2919: <td class="mdname" nowrap> <em>key</em>, </td>
2920: </tr>
2921: <tr>
2922: <td></td>
2923: <td></td>
2924: <td class="md" nowrap>u_int32_t </td>
2925: <td class="mdname" nowrap> <em>seq</em>, </td>
2926: </tr>
2927: <tr>
2928: <td></td>
2929: <td></td>
2930: <td class="md" nowrap>u_int16_t </td>
2931: <td class="mdname" nowrap> <em>len</em>, </td>
2932: </tr>
2933: <tr>
2934: <td></td>
2935: <td></td>
2936: <td class="md" nowrap>u_int8_t * </td>
2937: <td class="mdname" nowrap> <em>payload</em>, </td>
2938: </tr>
2939: <tr>
2940: <td></td>
2941: <td></td>
2942: <td class="md" nowrap>u_int32_t </td>
2943: <td class="mdname" nowrap> <em>payload_s</em>, </td>
2944: </tr>
2945: <tr>
2946: <td></td>
2947: <td></td>
2948: <td class="md" nowrap>libnet_t * </td>
2949: <td class="mdname" nowrap> <em>l</em>, </td>
2950: </tr>
2951: <tr>
2952: <td></td>
2953: <td></td>
2954: <td class="md" nowrap>libnet_ptag_t </td>
2955: <td class="mdname" nowrap> <em>ptag</em></td>
2956: </tr>
2957: <tr>
2958: <td></td>
2959: <td class="md">) </td>
2960: <td class="md" colspan="2"></td>
2961: </tr>
2962:
2963: </table>
2964: </td>
2965: </tr>
2966: </table>
2967: <table cellspacing=5 cellpadding=0 border=0>
2968: <tr>
2969: <td>
2970:
2971: </td>
2972: <td>
2973:
2974: <p>
2975: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
2976: <table border="0" cellspacing="2" cellpadding="0">
2977: <tr><td valign=top><em>fv</em> </td><td>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. </td></tr>
2978: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
2979: <tr><td valign=top><em>type</em> </td><td>which protocol is encapsulated (PPP, IP, ...) </td></tr>
2980: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill). </td></tr>
2981: <tr><td valign=top><em>offset</em> </td><td>byte offset from the start of the routing field to the first byte of the SRE </td></tr>
2982: <tr><td valign=top><em>key</em> </td><td>inserted by the encapsulator to authenticate the source </td></tr>
2983: <tr><td valign=top><em>seq</em> </td><td>sequence number used by the receiver to sort the packets </td></tr>
2984: <tr><td valign=top><em>len</em> </td><td>size of the GRE packet </td></tr>
2985: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
2986: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
2987: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
2988: </table>
2989: </dl>
2990: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
2991: </td>
2992: </tr>
2993: </table>
2994: <a class="anchor" name="a85" doxytag="libnet-functions.h::libnet_build_gre_last_sre" ></a><p>
2995: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
2996: <tr>
2997: <td class="mdRow">
2998: <table cellpadding="0" cellspacing="0" border="0">
2999: <tr>
3000: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_gre_last_sre </td>
3001: <td class="md" valign="top">( </td>
3002: <td class="md" nowrap valign="top">libnet_t * </td>
3003: <td class="mdname" nowrap> <em>l</em>, </td>
3004: </tr>
3005: <tr>
3006: <td></td>
3007: <td></td>
3008: <td class="md" nowrap>libnet_ptag_t </td>
3009: <td class="mdname" nowrap> <em>ptag</em></td>
3010: </tr>
3011: <tr>
3012: <td></td>
3013: <td class="md">) </td>
3014: <td class="md" colspan="2"></td>
3015: </tr>
3016:
3017: </table>
3018: </td>
3019: </tr>
3020: </table>
3021: <table cellspacing=5 cellpadding=0 border=0>
3022: <tr>
3023: <td>
3024:
3025: </td>
3026: <td>
3027:
3028: <p>
3029: <dl compact><dt><b>Parameters:</b></dt><dd>
3030: <table border="0" cellspacing="2" cellpadding="0">
3031: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
3032: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
3033: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
3034: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
3035: </table>
3036: </dl>
3037: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
3038: </td>
3039: </tr>
3040: </table>
3041: <a class="anchor" name="a84" doxytag="libnet-functions.h::libnet_build_gre_sre" ></a><p>
3042: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3043: <tr>
3044: <td class="mdRow">
3045: <table cellpadding="0" cellspacing="0" border="0">
3046: <tr>
3047: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_gre_sre </td>
3048: <td class="md" valign="top">( </td>
3049: <td class="md" nowrap valign="top">u_int16_t </td>
3050: <td class="mdname" nowrap> <em>af</em>, </td>
3051: </tr>
3052: <tr>
3053: <td></td>
3054: <td></td>
3055: <td class="md" nowrap>u_int8_t </td>
3056: <td class="mdname" nowrap> <em>offset</em>, </td>
3057: </tr>
3058: <tr>
3059: <td></td>
3060: <td></td>
3061: <td class="md" nowrap>u_int8_t </td>
3062: <td class="mdname" nowrap> <em>length</em>, </td>
3063: </tr>
3064: <tr>
3065: <td></td>
3066: <td></td>
3067: <td class="md" nowrap>u_int8_t * </td>
3068: <td class="mdname" nowrap> <em>routing</em>, </td>
3069: </tr>
3070: <tr>
3071: <td></td>
3072: <td></td>
3073: <td class="md" nowrap>u_int8_t * </td>
3074: <td class="mdname" nowrap> <em>payload</em>, </td>
3075: </tr>
3076: <tr>
3077: <td></td>
3078: <td></td>
3079: <td class="md" nowrap>u_int32_t </td>
3080: <td class="mdname" nowrap> <em>payload_s</em>, </td>
3081: </tr>
3082: <tr>
3083: <td></td>
3084: <td></td>
3085: <td class="md" nowrap>libnet_t * </td>
3086: <td class="mdname" nowrap> <em>l</em>, </td>
3087: </tr>
3088: <tr>
3089: <td></td>
3090: <td></td>
3091: <td class="md" nowrap>libnet_ptag_t </td>
3092: <td class="mdname" nowrap> <em>ptag</em></td>
3093: </tr>
3094: <tr>
3095: <td></td>
3096: <td class="md">) </td>
3097: <td class="md" colspan="2"></td>
3098: </tr>
3099:
3100: </table>
3101: </td>
3102: </tr>
3103: </table>
3104: <table cellspacing=5 cellpadding=0 border=0>
3105: <tr>
3106: <td>
3107:
3108: </td>
3109: <td>
3110:
3111: <p>
3112: <dl compact><dt><b>Parameters:</b></dt><dd>
3113: <table border="0" cellspacing="2" cellpadding="0">
3114: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
3115: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
3116: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
3117: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
3118: </table>
3119: </dl>
3120: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
3121: </td>
3122: </tr>
3123: </table>
3124: <a class="anchor" name="a38" doxytag="libnet-functions.h::libnet_build_icmpv4_echo" ></a><p>
3125: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3126: <tr>
3127: <td class="mdRow">
3128: <table cellpadding="0" cellspacing="0" border="0">
3129: <tr>
3130: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_echo </td>
3131: <td class="md" valign="top">( </td>
3132: <td class="md" nowrap valign="top">u_int8_t </td>
3133: <td class="mdname" nowrap> <em>type</em>, </td>
3134: </tr>
3135: <tr>
3136: <td></td>
3137: <td></td>
3138: <td class="md" nowrap>u_int8_t </td>
3139: <td class="mdname" nowrap> <em>code</em>, </td>
3140: </tr>
3141: <tr>
3142: <td></td>
3143: <td></td>
3144: <td class="md" nowrap>u_int16_t </td>
3145: <td class="mdname" nowrap> <em>sum</em>, </td>
3146: </tr>
3147: <tr>
3148: <td></td>
3149: <td></td>
3150: <td class="md" nowrap>u_int16_t </td>
3151: <td class="mdname" nowrap> <em>id</em>, </td>
3152: </tr>
3153: <tr>
3154: <td></td>
3155: <td></td>
3156: <td class="md" nowrap>u_int16_t </td>
3157: <td class="mdname" nowrap> <em>seq</em>, </td>
3158: </tr>
3159: <tr>
3160: <td></td>
3161: <td></td>
3162: <td class="md" nowrap>u_int8_t * </td>
3163: <td class="mdname" nowrap> <em>payload</em>, </td>
3164: </tr>
3165: <tr>
3166: <td></td>
3167: <td></td>
3168: <td class="md" nowrap>u_int32_t </td>
3169: <td class="mdname" nowrap> <em>payload_s</em>, </td>
3170: </tr>
3171: <tr>
3172: <td></td>
3173: <td></td>
3174: <td class="md" nowrap>libnet_t * </td>
3175: <td class="mdname" nowrap> <em>l</em>, </td>
3176: </tr>
3177: <tr>
3178: <td></td>
3179: <td></td>
3180: <td class="md" nowrap>libnet_ptag_t </td>
3181: <td class="mdname" nowrap> <em>ptag</em></td>
3182: </tr>
3183: <tr>
3184: <td></td>
3185: <td class="md">) </td>
3186: <td class="md" colspan="2"></td>
3187: </tr>
3188:
3189: </table>
3190: </td>
3191: </tr>
3192: </table>
3193: <table cellspacing=5 cellpadding=0 border=0>
3194: <tr>
3195: <td>
3196:
3197: </td>
3198: <td>
3199:
3200: <p>
3201: Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) echo request/reply header <dl compact><dt><b>Parameters:</b></dt><dd>
3202: <table border="0" cellspacing="2" cellpadding="0">
3203: <tr><td valign=top><em>type</em> </td><td>type of ICMP packet (should be ICMP_ECHOREPLY or ICMP_ECHO) </td></tr>
3204: <tr><td valign=top><em>code</em> </td><td>code of ICMP packet (should be 0) </td></tr>
3205: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
3206: <tr><td valign=top><em>id</em> </td><td>identification number </td></tr>
3207: <tr><td valign=top><em>seq</em> </td><td>packet sequence number </td></tr>
3208: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
3209: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
3210: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
3211: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
3212: </table>
3213: </dl>
3214: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
3215: </td>
3216: </tr>
3217: </table>
3218: <a class="anchor" name="a39" doxytag="libnet-functions.h::libnet_build_icmpv4_mask" ></a><p>
3219: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3220: <tr>
3221: <td class="mdRow">
3222: <table cellpadding="0" cellspacing="0" border="0">
3223: <tr>
3224: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_mask </td>
3225: <td class="md" valign="top">( </td>
3226: <td class="md" nowrap valign="top">u_int8_t </td>
3227: <td class="mdname" nowrap> <em>type</em>, </td>
3228: </tr>
3229: <tr>
3230: <td></td>
3231: <td></td>
3232: <td class="md" nowrap>u_int8_t </td>
3233: <td class="mdname" nowrap> <em>code</em>, </td>
3234: </tr>
3235: <tr>
3236: <td></td>
3237: <td></td>
3238: <td class="md" nowrap>u_int16_t </td>
3239: <td class="mdname" nowrap> <em>sum</em>, </td>
3240: </tr>
3241: <tr>
3242: <td></td>
3243: <td></td>
3244: <td class="md" nowrap>u_int16_t </td>
3245: <td class="mdname" nowrap> <em>id</em>, </td>
3246: </tr>
3247: <tr>
3248: <td></td>
3249: <td></td>
3250: <td class="md" nowrap>u_int16_t </td>
3251: <td class="mdname" nowrap> <em>seq</em>, </td>
3252: </tr>
3253: <tr>
3254: <td></td>
3255: <td></td>
3256: <td class="md" nowrap>u_int32_t </td>
3257: <td class="mdname" nowrap> <em>mask</em>, </td>
3258: </tr>
3259: <tr>
3260: <td></td>
3261: <td></td>
3262: <td class="md" nowrap>u_int8_t * </td>
3263: <td class="mdname" nowrap> <em>payload</em>, </td>
3264: </tr>
3265: <tr>
3266: <td></td>
3267: <td></td>
3268: <td class="md" nowrap>u_int32_t </td>
3269: <td class="mdname" nowrap> <em>payload_s</em>, </td>
3270: </tr>
3271: <tr>
3272: <td></td>
3273: <td></td>
3274: <td class="md" nowrap>libnet_t * </td>
3275: <td class="mdname" nowrap> <em>l</em>, </td>
3276: </tr>
3277: <tr>
3278: <td></td>
3279: <td></td>
3280: <td class="md" nowrap>libnet_ptag_t </td>
3281: <td class="mdname" nowrap> <em>ptag</em></td>
3282: </tr>
3283: <tr>
3284: <td></td>
3285: <td class="md">) </td>
3286: <td class="md" colspan="2"></td>
3287: </tr>
3288:
3289: </table>
3290: </td>
3291: </tr>
3292: </table>
3293: <table cellspacing=5 cellpadding=0 border=0>
3294: <tr>
3295: <td>
3296:
3297: </td>
3298: <td>
3299:
3300: <p>
3301: Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) IP netmask request/reply header. <dl compact><dt><b>Parameters:</b></dt><dd>
3302: <table border="0" cellspacing="2" cellpadding="0">
3303: <tr><td valign=top><em>type</em> </td><td>type of ICMP packet (should be ICMP_MASKREQ or ICMP_MASKREPLY) </td></tr>
3304: <tr><td valign=top><em>code</em> </td><td>code of ICMP packet (should be 0) </td></tr>
3305: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
3306: <tr><td valign=top><em>id</em> </td><td>identification number </td></tr>
3307: <tr><td valign=top><em>seq</em> </td><td>packet sequence number </td></tr>
3308: <tr><td valign=top><em>mask</em> </td><td>subnet mask </td></tr>
3309: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
3310: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
3311: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
3312: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
3313: </table>
3314: </dl>
3315: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
3316: </td>
3317: </tr>
3318: </table>
3319: <a class="anchor" name="a41" doxytag="libnet-functions.h::libnet_build_icmpv4_redirect" ></a><p>
3320: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3321: <tr>
3322: <td class="mdRow">
3323: <table cellpadding="0" cellspacing="0" border="0">
3324: <tr>
3325: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_redirect </td>
3326: <td class="md" valign="top">( </td>
3327: <td class="md" nowrap valign="top">u_int8_t </td>
3328: <td class="mdname" nowrap> <em>type</em>, </td>
3329: </tr>
3330: <tr>
3331: <td></td>
3332: <td></td>
3333: <td class="md" nowrap>u_int8_t </td>
3334: <td class="mdname" nowrap> <em>code</em>, </td>
3335: </tr>
3336: <tr>
3337: <td></td>
3338: <td></td>
3339: <td class="md" nowrap>u_int16_t </td>
3340: <td class="mdname" nowrap> <em>sum</em>, </td>
3341: </tr>
3342: <tr>
3343: <td></td>
3344: <td></td>
3345: <td class="md" nowrap>u_int32_t </td>
3346: <td class="mdname" nowrap> <em>gateway</em>, </td>
3347: </tr>
3348: <tr>
3349: <td></td>
3350: <td></td>
3351: <td class="md" nowrap>u_int16_t </td>
3352: <td class="mdname" nowrap> <em>orig_len</em>, </td>
3353: </tr>
3354: <tr>
3355: <td></td>
3356: <td></td>
3357: <td class="md" nowrap>u_int8_t </td>
3358: <td class="mdname" nowrap> <em>orig_tos</em>, </td>
3359: </tr>
3360: <tr>
3361: <td></td>
3362: <td></td>
3363: <td class="md" nowrap>u_int16_t </td>
3364: <td class="mdname" nowrap> <em>orig_id</em>, </td>
3365: </tr>
3366: <tr>
3367: <td></td>
3368: <td></td>
3369: <td class="md" nowrap>u_int16_t </td>
3370: <td class="mdname" nowrap> <em>orig_frag</em>, </td>
3371: </tr>
3372: <tr>
3373: <td></td>
3374: <td></td>
3375: <td class="md" nowrap>u_int8_t </td>
3376: <td class="mdname" nowrap> <em>orig_ttl</em>, </td>
3377: </tr>
3378: <tr>
3379: <td></td>
3380: <td></td>
3381: <td class="md" nowrap>u_int8_t </td>
3382: <td class="mdname" nowrap> <em>orig_prot</em>, </td>
3383: </tr>
3384: <tr>
3385: <td></td>
3386: <td></td>
3387: <td class="md" nowrap>u_int16_t </td>
3388: <td class="mdname" nowrap> <em>orig_check</em>, </td>
3389: </tr>
3390: <tr>
3391: <td></td>
3392: <td></td>
3393: <td class="md" nowrap>u_int32_t </td>
3394: <td class="mdname" nowrap> <em>orig_src</em>, </td>
3395: </tr>
3396: <tr>
3397: <td></td>
3398: <td></td>
3399: <td class="md" nowrap>u_int32_t </td>
3400: <td class="mdname" nowrap> <em>orig_dst</em>, </td>
3401: </tr>
3402: <tr>
3403: <td></td>
3404: <td></td>
3405: <td class="md" nowrap>u_int8_t * </td>
3406: <td class="mdname" nowrap> <em>payload</em>, </td>
3407: </tr>
3408: <tr>
3409: <td></td>
3410: <td></td>
3411: <td class="md" nowrap>u_int32_t </td>
3412: <td class="mdname" nowrap> <em>payload_s</em>, </td>
3413: </tr>
3414: <tr>
3415: <td></td>
3416: <td></td>
3417: <td class="md" nowrap>libnet_t * </td>
3418: <td class="mdname" nowrap> <em>l</em>, </td>
3419: </tr>
3420: <tr>
3421: <td></td>
3422: <td></td>
3423: <td class="md" nowrap>libnet_ptag_t </td>
3424: <td class="mdname" nowrap> <em>ptag</em></td>
3425: </tr>
3426: <tr>
3427: <td></td>
3428: <td class="md">) </td>
3429: <td class="md" colspan="2"></td>
3430: </tr>
3431:
3432: </table>
3433: </td>
3434: </tr>
3435: </table>
3436: <table cellspacing=5 cellpadding=0 border=0>
3437: <tr>
3438: <td>
3439:
3440: </td>
3441: <td>
3442:
3443: <p>
3444: 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). <dl compact><dt><b>Parameters:</b></dt><dd>
3445: <table border="0" cellspacing="2" cellpadding="0">
3446: <tr><td valign=top><em>type</em> </td><td>type of ICMP packet (should be ICMP_REDIRECT) </td></tr>
3447: <tr><td valign=top><em>code</em> </td><td>code of ICMP packet (should be one of the four redirect codes) </td></tr>
3448: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
3449: <tr><td valign=top><em>orig_id</em> </td><td>original IP header identification </td></tr>
3450: <tr><td valign=top><em>orig_frag</em> </td><td>original IP header fragmentation information </td></tr>
3451: <tr><td valign=top><em>orig_ttl</em> </td><td>orginal IP header time to live </td></tr>
3452: <tr><td valign=top><em>orig_prot</em> </td><td>original IP header protocol </td></tr>
3453: <tr><td valign=top><em>orig_check</em> </td><td>original IP header checksum </td></tr>
3454: <tr><td valign=top><em>orig_src</em> </td><td>original IP header source address </td></tr>
3455: <tr><td valign=top><em>orig_dst</em> </td><td>original IP header destination address </td></tr>
3456: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
3457: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
3458: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
3459: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
3460: </table>
3461: </dl>
3462: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
3463: </td>
3464: </tr>
3465: </table>
3466: <a class="anchor" name="a42" doxytag="libnet-functions.h::libnet_build_icmpv4_timeexceed" ></a><p>
3467: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3468: <tr>
3469: <td class="mdRow">
3470: <table cellpadding="0" cellspacing="0" border="0">
3471: <tr>
3472: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_timeexceed </td>
3473: <td class="md" valign="top">( </td>
3474: <td class="md" nowrap valign="top">u_int8_t </td>
3475: <td class="mdname" nowrap> <em>type</em>, </td>
3476: </tr>
3477: <tr>
3478: <td></td>
3479: <td></td>
3480: <td class="md" nowrap>u_int8_t </td>
3481: <td class="mdname" nowrap> <em>code</em>, </td>
3482: </tr>
3483: <tr>
3484: <td></td>
3485: <td></td>
3486: <td class="md" nowrap>u_int16_t </td>
3487: <td class="mdname" nowrap> <em>sum</em>, </td>
3488: </tr>
3489: <tr>
3490: <td></td>
3491: <td></td>
3492: <td class="md" nowrap>u_int16_t </td>
3493: <td class="mdname" nowrap> <em>orig_len</em>, </td>
3494: </tr>
3495: <tr>
3496: <td></td>
3497: <td></td>
3498: <td class="md" nowrap>u_int8_t </td>
3499: <td class="mdname" nowrap> <em>orig_tos</em>, </td>
3500: </tr>
3501: <tr>
3502: <td></td>
3503: <td></td>
3504: <td class="md" nowrap>u_int16_t </td>
3505: <td class="mdname" nowrap> <em>orig_id</em>, </td>
3506: </tr>
3507: <tr>
3508: <td></td>
3509: <td></td>
3510: <td class="md" nowrap>u_int16_t </td>
3511: <td class="mdname" nowrap> <em>orig_frag</em>, </td>
3512: </tr>
3513: <tr>
3514: <td></td>
3515: <td></td>
3516: <td class="md" nowrap>u_int8_t </td>
3517: <td class="mdname" nowrap> <em>orig_ttl</em>, </td>
3518: </tr>
3519: <tr>
3520: <td></td>
3521: <td></td>
3522: <td class="md" nowrap>u_int8_t </td>
3523: <td class="mdname" nowrap> <em>orig_prot</em>, </td>
3524: </tr>
3525: <tr>
3526: <td></td>
3527: <td></td>
3528: <td class="md" nowrap>u_int16_t </td>
3529: <td class="mdname" nowrap> <em>orig_check</em>, </td>
3530: </tr>
3531: <tr>
3532: <td></td>
3533: <td></td>
3534: <td class="md" nowrap>u_int32_t </td>
3535: <td class="mdname" nowrap> <em>orig_src</em>, </td>
3536: </tr>
3537: <tr>
3538: <td></td>
3539: <td></td>
3540: <td class="md" nowrap>u_int32_t </td>
3541: <td class="mdname" nowrap> <em>orig_dst</em>, </td>
3542: </tr>
3543: <tr>
3544: <td></td>
3545: <td></td>
3546: <td class="md" nowrap>u_int8_t * </td>
3547: <td class="mdname" nowrap> <em>payload</em>, </td>
3548: </tr>
3549: <tr>
3550: <td></td>
3551: <td></td>
3552: <td class="md" nowrap>u_int32_t </td>
3553: <td class="mdname" nowrap> <em>payload_s</em>, </td>
3554: </tr>
3555: <tr>
3556: <td></td>
3557: <td></td>
3558: <td class="md" nowrap>libnet_t * </td>
3559: <td class="mdname" nowrap> <em>l</em>, </td>
3560: </tr>
3561: <tr>
3562: <td></td>
3563: <td></td>
3564: <td class="md" nowrap>libnet_ptag_t </td>
3565: <td class="mdname" nowrap> <em>ptag</em></td>
3566: </tr>
3567: <tr>
3568: <td></td>
3569: <td class="md">) </td>
3570: <td class="md" colspan="2"></td>
3571: </tr>
3572:
3573: </table>
3574: </td>
3575: </tr>
3576: </table>
3577: <table cellspacing=5 cellpadding=0 border=0>
3578: <tr>
3579: <td>
3580:
3581: </td>
3582: <td>
3583:
3584: <p>
3585: 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). <dl compact><dt><b>Parameters:</b></dt><dd>
3586: <table border="0" cellspacing="2" cellpadding="0">
3587: <tr><td valign=top><em>type</em> </td><td>type of ICMP packet (should be ICMP_TIMXCEED) </td></tr>
3588: <tr><td valign=top><em>code</em> </td><td>code of ICMP packet (ICMP_TIMXCEED_INTRANS / ICMP_TIMXCEED_REASS) </td></tr>
3589: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
3590: <tr><td valign=top><em>orig_id</em> </td><td>original IP header identification </td></tr>
3591: <tr><td valign=top><em>orig_frag</em> </td><td>original IP header fragmentation information </td></tr>
3592: <tr><td valign=top><em>orig_ttl</em> </td><td>orginal IP header time to live </td></tr>
3593: <tr><td valign=top><em>orig_prot</em> </td><td>original IP header protocol </td></tr>
3594: <tr><td valign=top><em>orig_check</em> </td><td>original IP header checksum </td></tr>
3595: <tr><td valign=top><em>orig_src</em> </td><td>original IP header source address </td></tr>
3596: <tr><td valign=top><em>orig_dst</em> </td><td>original IP header destination address </td></tr>
3597: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
3598: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
3599: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
3600: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
3601: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
3602: </table>
3603: </dl>
3604: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
3605: </td>
3606: </tr>
3607: </table>
3608: <a class="anchor" name="a43" doxytag="libnet-functions.h::libnet_build_icmpv4_timestamp" ></a><p>
3609: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3610: <tr>
3611: <td class="mdRow">
3612: <table cellpadding="0" cellspacing="0" border="0">
3613: <tr>
3614: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_timestamp </td>
3615: <td class="md" valign="top">( </td>
3616: <td class="md" nowrap valign="top">u_int8_t </td>
3617: <td class="mdname" nowrap> <em>type</em>, </td>
3618: </tr>
3619: <tr>
3620: <td></td>
3621: <td></td>
3622: <td class="md" nowrap>u_int8_t </td>
3623: <td class="mdname" nowrap> <em>code</em>, </td>
3624: </tr>
3625: <tr>
3626: <td></td>
3627: <td></td>
3628: <td class="md" nowrap>u_int16_t </td>
3629: <td class="mdname" nowrap> <em>sum</em>, </td>
3630: </tr>
3631: <tr>
3632: <td></td>
3633: <td></td>
3634: <td class="md" nowrap>u_int16_t </td>
3635: <td class="mdname" nowrap> <em>id</em>, </td>
3636: </tr>
3637: <tr>
3638: <td></td>
3639: <td></td>
3640: <td class="md" nowrap>u_int16_t </td>
3641: <td class="mdname" nowrap> <em>seq</em>, </td>
3642: </tr>
3643: <tr>
3644: <td></td>
3645: <td></td>
3646: <td class="md" nowrap>n_time </td>
3647: <td class="mdname" nowrap> <em>otime</em>, </td>
3648: </tr>
3649: <tr>
3650: <td></td>
3651: <td></td>
3652: <td class="md" nowrap>n_time </td>
3653: <td class="mdname" nowrap> <em>rtime</em>, </td>
3654: </tr>
3655: <tr>
3656: <td></td>
3657: <td></td>
3658: <td class="md" nowrap>n_time </td>
3659: <td class="mdname" nowrap> <em>ttime</em>, </td>
3660: </tr>
3661: <tr>
3662: <td></td>
3663: <td></td>
3664: <td class="md" nowrap>u_int8_t * </td>
3665: <td class="mdname" nowrap> <em>payload</em>, </td>
3666: </tr>
3667: <tr>
3668: <td></td>
3669: <td></td>
3670: <td class="md" nowrap>u_int32_t </td>
3671: <td class="mdname" nowrap> <em>payload_s</em>, </td>
3672: </tr>
3673: <tr>
3674: <td></td>
3675: <td></td>
3676: <td class="md" nowrap>libnet_t * </td>
3677: <td class="mdname" nowrap> <em>l</em>, </td>
3678: </tr>
3679: <tr>
3680: <td></td>
3681: <td></td>
3682: <td class="md" nowrap>libnet_ptag_t </td>
3683: <td class="mdname" nowrap> <em>ptag</em></td>
3684: </tr>
3685: <tr>
3686: <td></td>
3687: <td class="md">) </td>
3688: <td class="md" colspan="2"></td>
3689: </tr>
3690:
3691: </table>
3692: </td>
3693: </tr>
3694: </table>
3695: <table cellspacing=5 cellpadding=0 border=0>
3696: <tr>
3697: <td>
3698:
3699: </td>
3700: <td>
3701:
3702: <p>
3703: Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) timestamp request/reply header. <dl compact><dt><b>Parameters:</b></dt><dd>
3704: <table border="0" cellspacing="2" cellpadding="0">
3705: <tr><td valign=top><em>type</em> </td><td>type of ICMP packet (should be ICMP_TSTAMP or ICMP_TSTAMPREPLY) </td></tr>
3706: <tr><td valign=top><em>code</em> </td><td>code of ICMP packet (should be 0) </td></tr>
3707: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
3708: <tr><td valign=top><em>id</em> </td><td>identification number </td></tr>
3709: <tr><td valign=top><em>seq</em> </td><td>sequence number </td></tr>
3710: <tr><td valign=top><em>otime</em> </td><td>originate timestamp </td></tr>
3711: <tr><td valign=top><em>rtime</em> </td><td>receive timestamp </td></tr>
3712: <tr><td valign=top><em>ttime</em> </td><td>transmit timestamp </td></tr>
3713: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
3714: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
3715: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
3716: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
3717: </table>
3718: </dl>
3719: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
3720: </td>
3721: </tr>
3722: </table>
3723: <a class="anchor" name="a40" doxytag="libnet-functions.h::libnet_build_icmpv4_unreach" ></a><p>
3724: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3725: <tr>
3726: <td class="mdRow">
3727: <table cellpadding="0" cellspacing="0" border="0">
3728: <tr>
3729: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_icmpv4_unreach </td>
3730: <td class="md" valign="top">( </td>
3731: <td class="md" nowrap valign="top">u_int8_t </td>
3732: <td class="mdname" nowrap> <em>type</em>, </td>
3733: </tr>
3734: <tr>
3735: <td></td>
3736: <td></td>
3737: <td class="md" nowrap>u_int8_t </td>
3738: <td class="mdname" nowrap> <em>code</em>, </td>
3739: </tr>
3740: <tr>
3741: <td></td>
3742: <td></td>
3743: <td class="md" nowrap>u_int16_t </td>
3744: <td class="mdname" nowrap> <em>sum</em>, </td>
3745: </tr>
3746: <tr>
3747: <td></td>
3748: <td></td>
3749: <td class="md" nowrap>u_int16_t </td>
3750: <td class="mdname" nowrap> <em>orig_len</em>, </td>
3751: </tr>
3752: <tr>
3753: <td></td>
3754: <td></td>
3755: <td class="md" nowrap>u_int8_t </td>
3756: <td class="mdname" nowrap> <em>orig_tos</em>, </td>
3757: </tr>
3758: <tr>
3759: <td></td>
3760: <td></td>
3761: <td class="md" nowrap>u_int16_t </td>
3762: <td class="mdname" nowrap> <em>orig_id</em>, </td>
3763: </tr>
3764: <tr>
3765: <td></td>
3766: <td></td>
3767: <td class="md" nowrap>u_int16_t </td>
3768: <td class="mdname" nowrap> <em>orig_frag</em>, </td>
3769: </tr>
3770: <tr>
3771: <td></td>
3772: <td></td>
3773: <td class="md" nowrap>u_int8_t </td>
3774: <td class="mdname" nowrap> <em>orig_ttl</em>, </td>
3775: </tr>
3776: <tr>
3777: <td></td>
3778: <td></td>
3779: <td class="md" nowrap>u_int8_t </td>
3780: <td class="mdname" nowrap> <em>orig_prot</em>, </td>
3781: </tr>
3782: <tr>
3783: <td></td>
3784: <td></td>
3785: <td class="md" nowrap>u_int16_t </td>
3786: <td class="mdname" nowrap> <em>orig_check</em>, </td>
3787: </tr>
3788: <tr>
3789: <td></td>
3790: <td></td>
3791: <td class="md" nowrap>u_int32_t </td>
3792: <td class="mdname" nowrap> <em>orig_src</em>, </td>
3793: </tr>
3794: <tr>
3795: <td></td>
3796: <td></td>
3797: <td class="md" nowrap>u_int32_t </td>
3798: <td class="mdname" nowrap> <em>orig_dst</em>, </td>
3799: </tr>
3800: <tr>
3801: <td></td>
3802: <td></td>
3803: <td class="md" nowrap>u_int8_t * </td>
3804: <td class="mdname" nowrap> <em>payload</em>, </td>
3805: </tr>
3806: <tr>
3807: <td></td>
3808: <td></td>
3809: <td class="md" nowrap>u_int32_t </td>
3810: <td class="mdname" nowrap> <em>payload_s</em>, </td>
3811: </tr>
3812: <tr>
3813: <td></td>
3814: <td></td>
3815: <td class="md" nowrap>libnet_t * </td>
3816: <td class="mdname" nowrap> <em>l</em>, </td>
3817: </tr>
3818: <tr>
3819: <td></td>
3820: <td></td>
3821: <td class="md" nowrap>libnet_ptag_t </td>
3822: <td class="mdname" nowrap> <em>ptag</em></td>
3823: </tr>
3824: <tr>
3825: <td></td>
3826: <td class="md">) </td>
3827: <td class="md" colspan="2"></td>
3828: </tr>
3829:
3830: </table>
3831: </td>
3832: </tr>
3833: </table>
3834: <table cellspacing=5 cellpadding=0 border=0>
3835: <tr>
3836: <td>
3837:
3838: </td>
3839: <td>
3840:
3841: <p>
3842: 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). <dl compact><dt><b>Parameters:</b></dt><dd>
3843: <table border="0" cellspacing="2" cellpadding="0">
3844: <tr><td valign=top><em>type</em> </td><td>type of ICMP packet (should be ICMP_UNREACH) </td></tr>
3845: <tr><td valign=top><em>code</em> </td><td>code of ICMP packet (should be one of the 16 unreachable codes) </td></tr>
3846: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
3847: <tr><td valign=top><em>orig_id</em> </td><td>original IP header identification </td></tr>
3848: <tr><td valign=top><em>orig_frag</em> </td><td>original IP header fragmentation information </td></tr>
3849: <tr><td valign=top><em>orig_ttl</em> </td><td>orginal IP header time to live </td></tr>
3850: <tr><td valign=top><em>orig_prot</em> </td><td>original IP header protocol </td></tr>
3851: <tr><td valign=top><em>orig_check</em> </td><td>original IP header checksum </td></tr>
3852: <tr><td valign=top><em>orig_src</em> </td><td>original IP header source address </td></tr>
3853: <tr><td valign=top><em>orig_dst</em> </td><td>original IP header destination address </td></tr>
3854: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
3855: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
3856: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
3857: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
3858: </table>
3859: </dl>
3860: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
3861: </td>
3862: </tr>
3863: </table>
3864: <a class="anchor" name="a44" doxytag="libnet-functions.h::libnet_build_igmp" ></a><p>
3865: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3866: <tr>
3867: <td class="mdRow">
3868: <table cellpadding="0" cellspacing="0" border="0">
3869: <tr>
3870: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_igmp </td>
3871: <td class="md" valign="top">( </td>
3872: <td class="md" nowrap valign="top">u_int8_t </td>
3873: <td class="mdname" nowrap> <em>type</em>, </td>
3874: </tr>
3875: <tr>
3876: <td></td>
3877: <td></td>
3878: <td class="md" nowrap>u_int8_t </td>
3879: <td class="mdname" nowrap> <em>code</em>, </td>
3880: </tr>
3881: <tr>
3882: <td></td>
3883: <td></td>
3884: <td class="md" nowrap>u_int16_t </td>
3885: <td class="mdname" nowrap> <em>sum</em>, </td>
3886: </tr>
3887: <tr>
3888: <td></td>
3889: <td></td>
3890: <td class="md" nowrap>u_int32_t </td>
3891: <td class="mdname" nowrap> <em>ip</em>, </td>
3892: </tr>
3893: <tr>
3894: <td></td>
3895: <td></td>
3896: <td class="md" nowrap>u_int8_t * </td>
3897: <td class="mdname" nowrap> <em>payload</em>, </td>
3898: </tr>
3899: <tr>
3900: <td></td>
3901: <td></td>
3902: <td class="md" nowrap>u_int32_t </td>
3903: <td class="mdname" nowrap> <em>payload_s</em>, </td>
3904: </tr>
3905: <tr>
3906: <td></td>
3907: <td></td>
3908: <td class="md" nowrap>libnet_t * </td>
3909: <td class="mdname" nowrap> <em>l</em>, </td>
3910: </tr>
3911: <tr>
3912: <td></td>
3913: <td></td>
3914: <td class="md" nowrap>libnet_ptag_t </td>
3915: <td class="mdname" nowrap> <em>ptag</em></td>
3916: </tr>
3917: <tr>
3918: <td></td>
3919: <td class="md">) </td>
3920: <td class="md" colspan="2"></td>
3921: </tr>
3922:
3923: </table>
3924: </td>
3925: </tr>
3926: </table>
3927: <table cellspacing=5 cellpadding=0 border=0>
3928: <tr>
3929: <td>
3930:
3931: </td>
3932: <td>
3933:
3934: <p>
3935: Builds an RFC 1112 Internet Group Memebership Protocol (IGMP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
3936: <table border="0" cellspacing="2" cellpadding="0">
3937: <tr><td valign=top><em>type</em> </td><td>packet type </td></tr>
3938: <tr><td valign=top><em>code</em> </td><td>packet code (should be 0) </td></tr>
3939: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
3940: <tr><td valign=top><em>ip</em> </td><td>IPv4 address </td></tr>
3941: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
3942: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
3943: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
3944: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
3945: </table>
3946: </dl>
3947: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
3948: </td>
3949: </tr>
3950: </table>
3951: <a class="anchor" name="a57" doxytag="libnet-functions.h::libnet_build_ipsec_ah" ></a><p>
3952: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
3953: <tr>
3954: <td class="mdRow">
3955: <table cellpadding="0" cellspacing="0" border="0">
3956: <tr>
3957: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipsec_ah </td>
3958: <td class="md" valign="top">( </td>
3959: <td class="md" nowrap valign="top">u_int8_t </td>
3960: <td class="mdname" nowrap> <em>nh</em>, </td>
3961: </tr>
3962: <tr>
3963: <td></td>
3964: <td></td>
3965: <td class="md" nowrap>u_int8_t </td>
3966: <td class="mdname" nowrap> <em>len</em>, </td>
3967: </tr>
3968: <tr>
3969: <td></td>
3970: <td></td>
3971: <td class="md" nowrap>u_int16_t </td>
3972: <td class="mdname" nowrap> <em>res</em>, </td>
3973: </tr>
3974: <tr>
3975: <td></td>
3976: <td></td>
3977: <td class="md" nowrap>u_int32_t </td>
3978: <td class="mdname" nowrap> <em>spi</em>, </td>
3979: </tr>
3980: <tr>
3981: <td></td>
3982: <td></td>
3983: <td class="md" nowrap>u_int32_t </td>
3984: <td class="mdname" nowrap> <em>seq</em>, </td>
3985: </tr>
3986: <tr>
3987: <td></td>
3988: <td></td>
3989: <td class="md" nowrap>u_int32_t </td>
3990: <td class="mdname" nowrap> <em>auth</em>, </td>
3991: </tr>
3992: <tr>
3993: <td></td>
3994: <td></td>
3995: <td class="md" nowrap>u_int8_t * </td>
3996: <td class="mdname" nowrap> <em>payload</em>, </td>
3997: </tr>
3998: <tr>
3999: <td></td>
4000: <td></td>
4001: <td class="md" nowrap>u_int32_t </td>
4002: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4003: </tr>
4004: <tr>
4005: <td></td>
4006: <td></td>
4007: <td class="md" nowrap>libnet_t * </td>
4008: <td class="mdname" nowrap> <em>l</em>, </td>
4009: </tr>
4010: <tr>
4011: <td></td>
4012: <td></td>
4013: <td class="md" nowrap>libnet_ptag_t </td>
4014: <td class="mdname" nowrap> <em>ptag</em></td>
4015: </tr>
4016: <tr>
4017: <td></td>
4018: <td class="md">) </td>
4019: <td class="md" colspan="2"></td>
4020: </tr>
4021:
4022: </table>
4023: </td>
4024: </tr>
4025: </table>
4026: <table cellspacing=5 cellpadding=0 border=0>
4027: <tr>
4028: <td>
4029:
4030: </td>
4031: <td>
4032:
4033: <p>
4034: Builds an Internet Protocol Security Authentication header. <dl compact><dt><b>Parameters:</b></dt><dd>
4035: <table border="0" cellspacing="2" cellpadding="0">
4036: <tr><td valign=top><em>nh</em> </td><td>next header </td></tr>
4037: <tr><td valign=top><em>len</em> </td><td>payload length </td></tr>
4038: <tr><td valign=top><em>res</em> </td><td>reserved </td></tr>
4039: <tr><td valign=top><em>spi</em> </td><td>security parameter index </td></tr>
4040: <tr><td valign=top><em>seq</em> </td><td>sequence number </td></tr>
4041: <tr><td valign=top><em>auth</em> </td><td>authentication data </td></tr>
4042: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
4043: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
4044: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4045: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4046: </table>
4047: </dl>
4048: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4049: </td>
4050: </tr>
4051: </table>
4052: <a class="anchor" name="a56" doxytag="libnet-functions.h::libnet_build_ipsec_esp_ftr" ></a><p>
4053: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4054: <tr>
4055: <td class="mdRow">
4056: <table cellpadding="0" cellspacing="0" border="0">
4057: <tr>
4058: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipsec_esp_ftr </td>
4059: <td class="md" valign="top">( </td>
4060: <td class="md" nowrap valign="top">u_int8_t </td>
4061: <td class="mdname" nowrap> <em>len</em>, </td>
4062: </tr>
4063: <tr>
4064: <td></td>
4065: <td></td>
4066: <td class="md" nowrap>u_int8_t </td>
4067: <td class="mdname" nowrap> <em>nh</em>, </td>
4068: </tr>
4069: <tr>
4070: <td></td>
4071: <td></td>
4072: <td class="md" nowrap>int8_t * </td>
4073: <td class="mdname" nowrap> <em>auth</em>, </td>
4074: </tr>
4075: <tr>
4076: <td></td>
4077: <td></td>
4078: <td class="md" nowrap>u_int8_t * </td>
4079: <td class="mdname" nowrap> <em>payload</em>, </td>
4080: </tr>
4081: <tr>
4082: <td></td>
4083: <td></td>
4084: <td class="md" nowrap>u_int32_t </td>
4085: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4086: </tr>
4087: <tr>
4088: <td></td>
4089: <td></td>
4090: <td class="md" nowrap>libnet_t * </td>
4091: <td class="mdname" nowrap> <em>l</em>, </td>
4092: </tr>
4093: <tr>
4094: <td></td>
4095: <td></td>
4096: <td class="md" nowrap>libnet_ptag_t </td>
4097: <td class="mdname" nowrap> <em>ptag</em></td>
4098: </tr>
4099: <tr>
4100: <td></td>
4101: <td class="md">) </td>
4102: <td class="md" colspan="2"></td>
4103: </tr>
4104:
4105: </table>
4106: </td>
4107: </tr>
4108: </table>
4109: <table cellspacing=5 cellpadding=0 border=0>
4110: <tr>
4111: <td>
4112:
4113: </td>
4114: <td>
4115:
4116: <p>
4117: Builds an Internet Protocol Security Encapsulating Security Payload footer. <dl compact><dt><b>Parameters:</b></dt><dd>
4118: <table border="0" cellspacing="2" cellpadding="0">
4119: <tr><td valign=top><em>len</em> </td><td>padding length </td></tr>
4120: <tr><td valign=top><em>nh</em> </td><td>next header </td></tr>
4121: <tr><td valign=top><em>auth</em> </td><td>authentication data </td></tr>
4122: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
4123: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
4124: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4125: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4126: </table>
4127: </dl>
4128: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4129: </td>
4130: </tr>
4131: </table>
4132: <a class="anchor" name="a55" doxytag="libnet-functions.h::libnet_build_ipsec_esp_hdr" ></a><p>
4133: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4134: <tr>
4135: <td class="mdRow">
4136: <table cellpadding="0" cellspacing="0" border="0">
4137: <tr>
4138: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipsec_esp_hdr </td>
4139: <td class="md" valign="top">( </td>
4140: <td class="md" nowrap valign="top">u_int32_t </td>
4141: <td class="mdname" nowrap> <em>spi</em>, </td>
4142: </tr>
4143: <tr>
4144: <td></td>
4145: <td></td>
4146: <td class="md" nowrap>u_int32_t </td>
4147: <td class="mdname" nowrap> <em>seq</em>, </td>
4148: </tr>
4149: <tr>
4150: <td></td>
4151: <td></td>
4152: <td class="md" nowrap>u_int32_t </td>
4153: <td class="mdname" nowrap> <em>iv</em>, </td>
4154: </tr>
4155: <tr>
4156: <td></td>
4157: <td></td>
4158: <td class="md" nowrap>u_int8_t * </td>
4159: <td class="mdname" nowrap> <em>payload</em>, </td>
4160: </tr>
4161: <tr>
4162: <td></td>
4163: <td></td>
4164: <td class="md" nowrap>u_int32_t </td>
4165: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4166: </tr>
4167: <tr>
4168: <td></td>
4169: <td></td>
4170: <td class="md" nowrap>libnet_t * </td>
4171: <td class="mdname" nowrap> <em>l</em>, </td>
4172: </tr>
4173: <tr>
4174: <td></td>
4175: <td></td>
4176: <td class="md" nowrap>libnet_ptag_t </td>
4177: <td class="mdname" nowrap> <em>ptag</em></td>
4178: </tr>
4179: <tr>
4180: <td></td>
4181: <td class="md">) </td>
4182: <td class="md" colspan="2"></td>
4183: </tr>
4184:
4185: </table>
4186: </td>
4187: </tr>
4188: </table>
4189: <table cellspacing=5 cellpadding=0 border=0>
4190: <tr>
4191: <td>
4192:
4193: </td>
4194: <td>
4195:
4196: <p>
4197: Builds an Internet Protocol Security Encapsulating Security Payload header. <dl compact><dt><b>Parameters:</b></dt><dd>
4198: <table border="0" cellspacing="2" cellpadding="0">
4199: <tr><td valign=top><em>spi</em> </td><td>security parameter index </td></tr>
4200: <tr><td valign=top><em>seq</em> </td><td>ESP sequence number </td></tr>
4201: <tr><td valign=top><em>iv</em> </td><td>initialization vector </td></tr>
4202: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
4203: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
4204: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4205: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4206: </table>
4207: </dl>
4208: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4209: </td>
4210: </tr>
4211: </table>
4212: <a class="anchor" name="a45" doxytag="libnet-functions.h::libnet_build_ipv4" ></a><p>
4213: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4214: <tr>
4215: <td class="mdRow">
4216: <table cellpadding="0" cellspacing="0" border="0">
4217: <tr>
4218: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv4 </td>
4219: <td class="md" valign="top">( </td>
4220: <td class="md" nowrap valign="top">u_int16_t </td>
4221: <td class="mdname" nowrap> <em>len</em>, </td>
4222: </tr>
4223: <tr>
4224: <td></td>
4225: <td></td>
4226: <td class="md" nowrap>u_int8_t </td>
4227: <td class="mdname" nowrap> <em>tos</em>, </td>
4228: </tr>
4229: <tr>
4230: <td></td>
4231: <td></td>
4232: <td class="md" nowrap>u_int16_t </td>
4233: <td class="mdname" nowrap> <em>id</em>, </td>
4234: </tr>
4235: <tr>
4236: <td></td>
4237: <td></td>
4238: <td class="md" nowrap>u_int16_t </td>
4239: <td class="mdname" nowrap> <em>frag</em>, </td>
4240: </tr>
4241: <tr>
4242: <td></td>
4243: <td></td>
4244: <td class="md" nowrap>u_int8_t </td>
4245: <td class="mdname" nowrap> <em>ttl</em>, </td>
4246: </tr>
4247: <tr>
4248: <td></td>
4249: <td></td>
4250: <td class="md" nowrap>u_int8_t </td>
4251: <td class="mdname" nowrap> <em>prot</em>, </td>
4252: </tr>
4253: <tr>
4254: <td></td>
4255: <td></td>
4256: <td class="md" nowrap>u_int16_t </td>
4257: <td class="mdname" nowrap> <em>sum</em>, </td>
4258: </tr>
4259: <tr>
4260: <td></td>
4261: <td></td>
4262: <td class="md" nowrap>u_int32_t </td>
4263: <td class="mdname" nowrap> <em>src</em>, </td>
4264: </tr>
4265: <tr>
4266: <td></td>
4267: <td></td>
4268: <td class="md" nowrap>u_int32_t </td>
4269: <td class="mdname" nowrap> <em>dst</em>, </td>
4270: </tr>
4271: <tr>
4272: <td></td>
4273: <td></td>
4274: <td class="md" nowrap>u_int8_t * </td>
4275: <td class="mdname" nowrap> <em>payload</em>, </td>
4276: </tr>
4277: <tr>
4278: <td></td>
4279: <td></td>
4280: <td class="md" nowrap>u_int32_t </td>
4281: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4282: </tr>
4283: <tr>
4284: <td></td>
4285: <td></td>
4286: <td class="md" nowrap>libnet_t * </td>
4287: <td class="mdname" nowrap> <em>l</em>, </td>
4288: </tr>
4289: <tr>
4290: <td></td>
4291: <td></td>
4292: <td class="md" nowrap>libnet_ptag_t </td>
4293: <td class="mdname" nowrap> <em>ptag</em></td>
4294: </tr>
4295: <tr>
4296: <td></td>
4297: <td class="md">) </td>
4298: <td class="md" colspan="2"></td>
4299: </tr>
4300:
4301: </table>
4302: </td>
4303: </tr>
4304: </table>
4305: <table cellspacing=5 cellpadding=0 border=0>
4306: <tr>
4307: <td>
4308:
4309: </td>
4310: <td>
4311:
4312: <p>
4313: Builds a version 4 RFC 791 Internet Protocol (IP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
4314: <table border="0" cellspacing="2" cellpadding="0">
4315: <tr><td valign=top><em>len</em> </td><td>total length of the IP packet including all subsequent data </td></tr>
4316: <tr><td valign=top><em>tos</em> </td><td>type of service bits </td></tr>
4317: <tr><td valign=top><em>id</em> </td><td>IP identification number </td></tr>
4318: <tr><td valign=top><em>frag</em> </td><td>fragmentation bits and offset </td></tr>
4319: <tr><td valign=top><em>ttl</em> </td><td>time to live in the network </td></tr>
4320: <tr><td valign=top><em>prot</em> </td><td>upper layer protocol </td></tr>
4321: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
4322: <tr><td valign=top><em>src</em> </td><td>source IPv4 address (little endian) </td></tr>
4323: <tr><td valign=top><em>dst</em> </td><td>destination IPv4 address (little endian) </td></tr>
4324: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
4325: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
4326: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4327: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4328: </table>
4329: </dl>
4330: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4331: </td>
4332: </tr>
4333: </table>
4334: <a class="anchor" name="a46" doxytag="libnet-functions.h::libnet_build_ipv4_options" ></a><p>
4335: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4336: <tr>
4337: <td class="mdRow">
4338: <table cellpadding="0" cellspacing="0" border="0">
4339: <tr>
4340: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv4_options </td>
4341: <td class="md" valign="top">( </td>
4342: <td class="md" nowrap valign="top">u_int8_t * </td>
4343: <td class="mdname" nowrap> <em>options</em>, </td>
4344: </tr>
4345: <tr>
4346: <td></td>
4347: <td></td>
4348: <td class="md" nowrap>u_int32_t </td>
4349: <td class="mdname" nowrap> <em>options_s</em>, </td>
4350: </tr>
4351: <tr>
4352: <td></td>
4353: <td></td>
4354: <td class="md" nowrap>libnet_t * </td>
4355: <td class="mdname" nowrap> <em>l</em>, </td>
4356: </tr>
4357: <tr>
4358: <td></td>
4359: <td></td>
4360: <td class="md" nowrap>libnet_ptag_t </td>
4361: <td class="mdname" nowrap> <em>ptag</em></td>
4362: </tr>
4363: <tr>
4364: <td></td>
4365: <td class="md">) </td>
4366: <td class="md" colspan="2"></td>
4367: </tr>
4368:
4369: </table>
4370: </td>
4371: </tr>
4372: </table>
4373: <table cellspacing=5 cellpadding=0 border=0>
4374: <tr>
4375: <td>
4376:
4377: </td>
4378: <td>
4379:
4380: <p>
4381: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
4382: <table border="0" cellspacing="2" cellpadding="0">
4383: <tr><td valign=top><em>options</em> </td><td>byte string of IP options </td></tr>
4384: <tr><td valign=top><em>options_s</em> </td><td>length of options string </td></tr>
4385: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4386: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4387: </table>
4388: </dl>
4389: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4390: </td>
4391: </tr>
4392: </table>
4393: <a class="anchor" name="a48" doxytag="libnet-functions.h::libnet_build_ipv6" ></a><p>
4394: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4395: <tr>
4396: <td class="mdRow">
4397: <table cellpadding="0" cellspacing="0" border="0">
4398: <tr>
4399: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv6 </td>
4400: <td class="md" valign="top">( </td>
4401: <td class="md" nowrap valign="top">u_int8_t </td>
4402: <td class="mdname" nowrap> <em>tc</em>, </td>
4403: </tr>
4404: <tr>
4405: <td></td>
4406: <td></td>
4407: <td class="md" nowrap>u_int32_t </td>
4408: <td class="mdname" nowrap> <em>fl</em>, </td>
4409: </tr>
4410: <tr>
4411: <td></td>
4412: <td></td>
4413: <td class="md" nowrap>u_int16_t </td>
4414: <td class="mdname" nowrap> <em>len</em>, </td>
4415: </tr>
4416: <tr>
4417: <td></td>
4418: <td></td>
4419: <td class="md" nowrap>u_int8_t </td>
4420: <td class="mdname" nowrap> <em>nh</em>, </td>
4421: </tr>
4422: <tr>
4423: <td></td>
4424: <td></td>
4425: <td class="md" nowrap>u_int8_t </td>
4426: <td class="mdname" nowrap> <em>hl</em>, </td>
4427: </tr>
4428: <tr>
4429: <td></td>
4430: <td></td>
4431: <td class="md" nowrap>struct libnet_in6_addr </td>
4432: <td class="mdname" nowrap> <em>src</em>, </td>
4433: </tr>
4434: <tr>
4435: <td></td>
4436: <td></td>
4437: <td class="md" nowrap>struct libnet_in6_addr </td>
4438: <td class="mdname" nowrap> <em>dst</em>, </td>
4439: </tr>
4440: <tr>
4441: <td></td>
4442: <td></td>
4443: <td class="md" nowrap>u_int8_t * </td>
4444: <td class="mdname" nowrap> <em>payload</em>, </td>
4445: </tr>
4446: <tr>
4447: <td></td>
4448: <td></td>
4449: <td class="md" nowrap>u_int32_t </td>
4450: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4451: </tr>
4452: <tr>
4453: <td></td>
4454: <td></td>
4455: <td class="md" nowrap>libnet_t * </td>
4456: <td class="mdname" nowrap> <em>l</em>, </td>
4457: </tr>
4458: <tr>
4459: <td></td>
4460: <td></td>
4461: <td class="md" nowrap>libnet_ptag_t </td>
4462: <td class="mdname" nowrap> <em>ptag</em></td>
4463: </tr>
4464: <tr>
4465: <td></td>
4466: <td class="md">) </td>
4467: <td class="md" colspan="2"></td>
4468: </tr>
4469:
4470: </table>
4471: </td>
4472: </tr>
4473: </table>
4474: <table cellspacing=5 cellpadding=0 border=0>
4475: <tr>
4476: <td>
4477:
4478: </td>
4479: <td>
4480:
4481: <p>
4482: Builds a version 6 RFC 2460 Internet Protocol (IP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
4483: <table border="0" cellspacing="2" cellpadding="0">
4484: <tr><td valign=top><em>tc</em> </td><td>traffic class </td></tr>
4485: <tr><td valign=top><em>fl</em> </td><td>flow label </td></tr>
4486: <tr><td valign=top><em>len</em> </td><td>total length of the IP packet </td></tr>
4487: <tr><td valign=top><em>nh</em> </td><td>next header </td></tr>
4488: <tr><td valign=top><em>hl</em> </td><td>hop limit </td></tr>
4489: <tr><td valign=top><em>src</em> </td><td>source IPv6 address </td></tr>
4490: <tr><td valign=top><em>dst</em> </td><td>destination IPv6 address </td></tr>
4491: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
4492: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
4493: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4494: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4495: </table>
4496: </dl>
4497: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4498: </td>
4499: </tr>
4500: </table>
4501: <a class="anchor" name="a51" doxytag="libnet-functions.h::libnet_build_ipv6_destopts" ></a><p>
4502: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4503: <tr>
4504: <td class="mdRow">
4505: <table cellpadding="0" cellspacing="0" border="0">
4506: <tr>
4507: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv6_destopts </td>
4508: <td class="md" valign="top">( </td>
4509: <td class="md" nowrap valign="top">u_int8_t </td>
4510: <td class="mdname" nowrap> <em>nh</em>, </td>
4511: </tr>
4512: <tr>
4513: <td></td>
4514: <td></td>
4515: <td class="md" nowrap>u_int8_t </td>
4516: <td class="mdname" nowrap> <em>len</em>, </td>
4517: </tr>
4518: <tr>
4519: <td></td>
4520: <td></td>
4521: <td class="md" nowrap>u_int8_t * </td>
4522: <td class="mdname" nowrap> <em>payload</em>, </td>
4523: </tr>
4524: <tr>
4525: <td></td>
4526: <td></td>
4527: <td class="md" nowrap>u_int32_t </td>
4528: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4529: </tr>
4530: <tr>
4531: <td></td>
4532: <td></td>
4533: <td class="md" nowrap>libnet_t * </td>
4534: <td class="mdname" nowrap> <em>l</em>, </td>
4535: </tr>
4536: <tr>
4537: <td></td>
4538: <td></td>
4539: <td class="md" nowrap>libnet_ptag_t </td>
4540: <td class="mdname" nowrap> <em>ptag</em></td>
4541: </tr>
4542: <tr>
4543: <td></td>
4544: <td class="md">) </td>
4545: <td class="md" colspan="2"></td>
4546: </tr>
4547:
4548: </table>
4549: </td>
4550: </tr>
4551: </table>
4552: <table cellspacing=5 cellpadding=0 border=0>
4553: <tr>
4554: <td>
4555:
4556: </td>
4557: <td>
4558:
4559: <p>
4560: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
4561: <table border="0" cellspacing="2" cellpadding="0">
4562: <tr><td valign=top><em>nh</em> </td><td>next header </td></tr>
4563: <tr><td valign=top><em>len</em> </td><td>length of the header in 8-byte octets not including the first 8 octets </td></tr>
4564: <tr><td valign=top><em>payload</em> </td><td>options payload </td></tr>
4565: <tr><td valign=top><em>payload_s</em> </td><td>payload length </td></tr>
4566: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4567: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4568: </table>
4569: </dl>
4570: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4571: </td>
4572: </tr>
4573: </table>
4574: <a class="anchor" name="a49" doxytag="libnet-functions.h::libnet_build_ipv6_frag" ></a><p>
4575: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4576: <tr>
4577: <td class="mdRow">
4578: <table cellpadding="0" cellspacing="0" border="0">
4579: <tr>
4580: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv6_frag </td>
4581: <td class="md" valign="top">( </td>
4582: <td class="md" nowrap valign="top">u_int8_t </td>
4583: <td class="mdname" nowrap> <em>nh</em>, </td>
4584: </tr>
4585: <tr>
4586: <td></td>
4587: <td></td>
4588: <td class="md" nowrap>u_int8_t </td>
4589: <td class="mdname" nowrap> <em>reserved</em>, </td>
4590: </tr>
4591: <tr>
4592: <td></td>
4593: <td></td>
4594: <td class="md" nowrap>u_int16_t </td>
4595: <td class="mdname" nowrap> <em>frag</em>, </td>
4596: </tr>
4597: <tr>
4598: <td></td>
4599: <td></td>
4600: <td class="md" nowrap>u_int32_t </td>
4601: <td class="mdname" nowrap> <em>id</em>, </td>
4602: </tr>
4603: <tr>
4604: <td></td>
4605: <td></td>
4606: <td class="md" nowrap>u_int8_t * </td>
4607: <td class="mdname" nowrap> <em>payload</em>, </td>
4608: </tr>
4609: <tr>
4610: <td></td>
4611: <td></td>
4612: <td class="md" nowrap>u_int32_t </td>
4613: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4614: </tr>
4615: <tr>
4616: <td></td>
4617: <td></td>
4618: <td class="md" nowrap>libnet_t * </td>
4619: <td class="mdname" nowrap> <em>l</em>, </td>
4620: </tr>
4621: <tr>
4622: <td></td>
4623: <td></td>
4624: <td class="md" nowrap>libnet_ptag_t </td>
4625: <td class="mdname" nowrap> <em>ptag</em></td>
4626: </tr>
4627: <tr>
4628: <td></td>
4629: <td class="md">) </td>
4630: <td class="md" colspan="2"></td>
4631: </tr>
4632:
4633: </table>
4634: </td>
4635: </tr>
4636: </table>
4637: <table cellspacing=5 cellpadding=0 border=0>
4638: <tr>
4639: <td>
4640:
4641: </td>
4642: <td>
4643:
4644: <p>
4645: Builds a version 6 RFC 2460 Internet Protocol (IP) fragmentation header. <dl compact><dt><b>Parameters:</b></dt><dd>
4646: <table border="0" cellspacing="2" cellpadding="0">
4647: <tr><td valign=top><em>nh</em> </td><td>next header </td></tr>
4648: <tr><td valign=top><em>reserved</em> </td><td>unused value... OR IS IT! </td></tr>
4649: <tr><td valign=top><em>frag</em> </td><td>fragmentation bits (ala ipv4) </td></tr>
4650: <tr><td valign=top><em>id</em> </td><td>packet identification </td></tr>
4651: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
4652: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
4653: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4654: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4655: </table>
4656: </dl>
4657: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4658: </td>
4659: </tr>
4660: </table>
4661: <a class="anchor" name="a52" doxytag="libnet-functions.h::libnet_build_ipv6_hbhopts" ></a><p>
4662: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4663: <tr>
4664: <td class="mdRow">
4665: <table cellpadding="0" cellspacing="0" border="0">
4666: <tr>
4667: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv6_hbhopts </td>
4668: <td class="md" valign="top">( </td>
4669: <td class="md" nowrap valign="top">u_int8_t </td>
4670: <td class="mdname" nowrap> <em>nh</em>, </td>
4671: </tr>
4672: <tr>
4673: <td></td>
4674: <td></td>
4675: <td class="md" nowrap>u_int8_t </td>
4676: <td class="mdname" nowrap> <em>len</em>, </td>
4677: </tr>
4678: <tr>
4679: <td></td>
4680: <td></td>
4681: <td class="md" nowrap>u_int8_t * </td>
4682: <td class="mdname" nowrap> <em>payload</em>, </td>
4683: </tr>
4684: <tr>
4685: <td></td>
4686: <td></td>
4687: <td class="md" nowrap>u_int32_t </td>
4688: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4689: </tr>
4690: <tr>
4691: <td></td>
4692: <td></td>
4693: <td class="md" nowrap>libnet_t * </td>
4694: <td class="mdname" nowrap> <em>l</em>, </td>
4695: </tr>
4696: <tr>
4697: <td></td>
4698: <td></td>
4699: <td class="md" nowrap>libnet_ptag_t </td>
4700: <td class="mdname" nowrap> <em>ptag</em></td>
4701: </tr>
4702: <tr>
4703: <td></td>
4704: <td class="md">) </td>
4705: <td class="md" colspan="2"></td>
4706: </tr>
4707:
4708: </table>
4709: </td>
4710: </tr>
4711: </table>
4712: <table cellspacing=5 cellpadding=0 border=0>
4713: <tr>
4714: <td>
4715:
4716: </td>
4717: <td>
4718:
4719: <p>
4720: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
4721: <table border="0" cellspacing="2" cellpadding="0">
4722: <tr><td valign=top><em>nh</em> </td><td>next header </td></tr>
4723: <tr><td valign=top><em>len</em> </td><td>length of the header in 8-byte octets not including the first 8 octets </td></tr>
4724: <tr><td valign=top><em>payload</em> </td><td>options payload </td></tr>
4725: <tr><td valign=top><em>payload_s</em> </td><td>payload length </td></tr>
4726: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4727: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4728: </table>
4729: </dl>
4730: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4731: </td>
4732: </tr>
4733: </table>
4734: <a class="anchor" name="a50" doxytag="libnet-functions.h::libnet_build_ipv6_routing" ></a><p>
4735: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4736: <tr>
4737: <td class="mdRow">
4738: <table cellpadding="0" cellspacing="0" border="0">
4739: <tr>
4740: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ipv6_routing </td>
4741: <td class="md" valign="top">( </td>
4742: <td class="md" nowrap valign="top">u_int8_t </td>
4743: <td class="mdname" nowrap> <em>nh</em>, </td>
4744: </tr>
4745: <tr>
4746: <td></td>
4747: <td></td>
4748: <td class="md" nowrap>u_int8_t </td>
4749: <td class="mdname" nowrap> <em>len</em>, </td>
4750: </tr>
4751: <tr>
4752: <td></td>
4753: <td></td>
4754: <td class="md" nowrap>u_int8_t </td>
4755: <td class="mdname" nowrap> <em>rtype</em>, </td>
4756: </tr>
4757: <tr>
4758: <td></td>
4759: <td></td>
4760: <td class="md" nowrap>u_int8_t </td>
4761: <td class="mdname" nowrap> <em>segments</em>, </td>
4762: </tr>
4763: <tr>
4764: <td></td>
4765: <td></td>
4766: <td class="md" nowrap>u_int8_t * </td>
4767: <td class="mdname" nowrap> <em>payload</em>, </td>
4768: </tr>
4769: <tr>
4770: <td></td>
4771: <td></td>
4772: <td class="md" nowrap>u_int32_t </td>
4773: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4774: </tr>
4775: <tr>
4776: <td></td>
4777: <td></td>
4778: <td class="md" nowrap>libnet_t * </td>
4779: <td class="mdname" nowrap> <em>l</em>, </td>
4780: </tr>
4781: <tr>
4782: <td></td>
4783: <td></td>
4784: <td class="md" nowrap>libnet_ptag_t </td>
4785: <td class="mdname" nowrap> <em>ptag</em></td>
4786: </tr>
4787: <tr>
4788: <td></td>
4789: <td class="md">) </td>
4790: <td class="md" colspan="2"></td>
4791: </tr>
4792:
4793: </table>
4794: </td>
4795: </tr>
4796: </table>
4797: <table cellspacing=5 cellpadding=0 border=0>
4798: <tr>
4799: <td>
4800:
4801: </td>
4802: <td>
4803:
4804: <p>
4805: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
4806: <table border="0" cellspacing="2" cellpadding="0">
4807: <tr><td valign=top><em>nh</em> </td><td>next header </td></tr>
4808: <tr><td valign=top><em>len</em> </td><td>length of the header in 8-byte octets not including the first 8 octets routing header type </td></tr>
4809: <tr><td valign=top><em>segments</em> </td><td>number of routing segments that follow </td></tr>
4810: <tr><td valign=top><em>payload</em> </td><td>optional payload of routing information </td></tr>
4811: <tr><td valign=top><em>payload_s</em> </td><td>payload length </td></tr>
4812: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4813: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4814: </table>
4815: </dl>
4816: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4817: </td>
4818: </tr>
4819: </table>
4820: <a class="anchor" name="a54" doxytag="libnet-functions.h::libnet_build_isl" ></a><p>
4821: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4822: <tr>
4823: <td class="mdRow">
4824: <table cellpadding="0" cellspacing="0" border="0">
4825: <tr>
4826: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_isl </td>
4827: <td class="md" valign="top">( </td>
4828: <td class="md" nowrap valign="top">u_int8_t * </td>
4829: <td class="mdname" nowrap> <em>dhost</em>, </td>
4830: </tr>
4831: <tr>
4832: <td></td>
4833: <td></td>
4834: <td class="md" nowrap>u_int8_t </td>
4835: <td class="mdname" nowrap> <em>type</em>, </td>
4836: </tr>
4837: <tr>
4838: <td></td>
4839: <td></td>
4840: <td class="md" nowrap>u_int8_t </td>
4841: <td class="mdname" nowrap> <em>user</em>, </td>
4842: </tr>
4843: <tr>
4844: <td></td>
4845: <td></td>
4846: <td class="md" nowrap>u_int8_t * </td>
4847: <td class="mdname" nowrap> <em>shost</em>, </td>
4848: </tr>
4849: <tr>
4850: <td></td>
4851: <td></td>
4852: <td class="md" nowrap>u_int16_t </td>
4853: <td class="mdname" nowrap> <em>len</em>, </td>
4854: </tr>
4855: <tr>
4856: <td></td>
4857: <td></td>
4858: <td class="md" nowrap>u_int8_t * </td>
4859: <td class="mdname" nowrap> <em>snap</em>, </td>
4860: </tr>
4861: <tr>
4862: <td></td>
4863: <td></td>
4864: <td class="md" nowrap>u_int16_t </td>
4865: <td class="mdname" nowrap> <em>vid</em>, </td>
4866: </tr>
4867: <tr>
4868: <td></td>
4869: <td></td>
4870: <td class="md" nowrap>u_int16_t </td>
4871: <td class="mdname" nowrap> <em>index</em>, </td>
4872: </tr>
4873: <tr>
4874: <td></td>
4875: <td></td>
4876: <td class="md" nowrap>u_int16_t </td>
4877: <td class="mdname" nowrap> <em>reserved</em>, </td>
4878: </tr>
4879: <tr>
4880: <td></td>
4881: <td></td>
4882: <td class="md" nowrap>u_int8_t * </td>
4883: <td class="mdname" nowrap> <em>payload</em>, </td>
4884: </tr>
4885: <tr>
4886: <td></td>
4887: <td></td>
4888: <td class="md" nowrap>u_int32_t </td>
4889: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4890: </tr>
4891: <tr>
4892: <td></td>
4893: <td></td>
4894: <td class="md" nowrap>libnet_t * </td>
4895: <td class="mdname" nowrap> <em>l</em>, </td>
4896: </tr>
4897: <tr>
4898: <td></td>
4899: <td></td>
4900: <td class="md" nowrap>libnet_ptag_t </td>
4901: <td class="mdname" nowrap> <em>ptag</em></td>
4902: </tr>
4903: <tr>
4904: <td></td>
4905: <td class="md">) </td>
4906: <td class="md" colspan="2"></td>
4907: </tr>
4908:
4909: </table>
4910: </td>
4911: </tr>
4912: </table>
4913: <table cellspacing=5 cellpadding=0 border=0>
4914: <tr>
4915: <td>
4916:
4917: </td>
4918: <td>
4919:
4920: <p>
4921: Builds a Cisco Inter-Switch Link (ISL) header. <dl compact><dt><b>Parameters:</b></dt><dd>
4922: <table border="0" cellspacing="2" cellpadding="0">
4923: <tr><td valign=top><em>dhost</em> </td><td>destination address (should be 01:00:0c:00:00) </td></tr>
4924: <tr><td valign=top><em>type</em> </td><td>type of frame </td></tr>
4925: <tr><td valign=top><em>user</em> </td><td>user defined data </td></tr>
4926: <tr><td valign=top><em>shost</em> </td><td>source mac address </td></tr>
4927: <tr><td valign=top><em>len</em> </td><td>total length of the encapuslated packet less 18 bytes </td></tr>
4928: <tr><td valign=top><em>snap</em> </td><td>SNAP information (0xaaaa03 + vendor code) </td></tr>
4929: <tr><td valign=top><em>vid</em> </td><td>15 bit VLAN ID, 1 bit BPDU or CDP indicator </td></tr>
4930: <tr><td valign=top><em>index</em> </td><td>port index </td></tr>
4931: <tr><td valign=top><em>reserved</em> </td><td>used for FDDI and token ring </td></tr>
4932: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
4933: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
4934: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
4935: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
4936: </table>
4937: </dl>
4938: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
4939: </td>
4940: </tr>
4941: </table>
4942: <a class="anchor" name="a91" doxytag="libnet-functions.h::libnet_build_link" ></a><p>
4943: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
4944: <tr>
4945: <td class="mdRow">
4946: <table cellpadding="0" cellspacing="0" border="0">
4947: <tr>
4948: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_link </td>
4949: <td class="md" valign="top">( </td>
4950: <td class="md" nowrap valign="top">u_int8_t * </td>
4951: <td class="mdname" nowrap> <em>dst</em>, </td>
4952: </tr>
4953: <tr>
4954: <td></td>
4955: <td></td>
4956: <td class="md" nowrap>u_int8_t * </td>
4957: <td class="mdname" nowrap> <em>src</em>, </td>
4958: </tr>
4959: <tr>
4960: <td></td>
4961: <td></td>
4962: <td class="md" nowrap>u_int8_t * </td>
4963: <td class="mdname" nowrap> <em>oui</em>, </td>
4964: </tr>
4965: <tr>
4966: <td></td>
4967: <td></td>
4968: <td class="md" nowrap>u_int16_t </td>
4969: <td class="mdname" nowrap> <em>type</em>, </td>
4970: </tr>
4971: <tr>
4972: <td></td>
4973: <td></td>
4974: <td class="md" nowrap>u_int8_t * </td>
4975: <td class="mdname" nowrap> <em>payload</em>, </td>
4976: </tr>
4977: <tr>
4978: <td></td>
4979: <td></td>
4980: <td class="md" nowrap>u_int32_t </td>
4981: <td class="mdname" nowrap> <em>payload_s</em>, </td>
4982: </tr>
4983: <tr>
4984: <td></td>
4985: <td></td>
4986: <td class="md" nowrap>libnet_t * </td>
4987: <td class="mdname" nowrap> <em>l</em>, </td>
4988: </tr>
4989: <tr>
4990: <td></td>
4991: <td></td>
4992: <td class="md" nowrap>libnet_ptag_t </td>
4993: <td class="mdname" nowrap> <em>ptag</em></td>
4994: </tr>
4995: <tr>
4996: <td></td>
4997: <td class="md">) </td>
4998: <td class="md" colspan="2"></td>
4999: </tr>
5000:
5001: </table>
5002: </td>
5003: </tr>
5004: </table>
5005: <table cellspacing=5 cellpadding=0 border=0>
5006: <tr>
5007: <td>
5008:
5009: </td>
5010: <td>
5011:
5012: <p>
5013: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
5014: <table border="0" cellspacing="2" cellpadding="0">
5015: <tr><td valign=top><em>dst</em> </td><td>the destination MAC address </td></tr>
5016: <tr><td valign=top><em>src</em> </td><td>the source MAC address </td></tr>
5017: <tr><td valign=top><em>oui</em> </td><td>Organizationally Unique Identifier (unused for Ethernet) </td></tr>
5018: <tr><td valign=top><em>type</em> </td><td>the upper layer protocol type </td></tr>
5019: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
5020: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
5021: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
5022: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
5023: </table>
5024: </dl>
5025: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
5026: </td>
5027: </tr>
5028: </table>
5029: <a class="anchor" name="a66" doxytag="libnet-functions.h::libnet_build_mpls" ></a><p>
5030: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
5031: <tr>
5032: <td class="mdRow">
5033: <table cellpadding="0" cellspacing="0" border="0">
5034: <tr>
5035: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_mpls </td>
5036: <td class="md" valign="top">( </td>
5037: <td class="md" nowrap valign="top">u_int32_t </td>
5038: <td class="mdname" nowrap> <em>label</em>, </td>
5039: </tr>
5040: <tr>
5041: <td></td>
5042: <td></td>
5043: <td class="md" nowrap>u_int8_t </td>
5044: <td class="mdname" nowrap> <em>experimental</em>, </td>
5045: </tr>
5046: <tr>
5047: <td></td>
5048: <td></td>
5049: <td class="md" nowrap>u_int8_t </td>
5050: <td class="mdname" nowrap> <em>bos</em>, </td>
5051: </tr>
5052: <tr>
5053: <td></td>
5054: <td></td>
5055: <td class="md" nowrap>u_int8_t </td>
5056: <td class="mdname" nowrap> <em>ttl</em>, </td>
5057: </tr>
5058: <tr>
5059: <td></td>
5060: <td></td>
5061: <td class="md" nowrap>u_int8_t * </td>
5062: <td class="mdname" nowrap> <em>payload</em>, </td>
5063: </tr>
5064: <tr>
5065: <td></td>
5066: <td></td>
5067: <td class="md" nowrap>u_int32_t </td>
5068: <td class="mdname" nowrap> <em>payload_s</em>, </td>
5069: </tr>
5070: <tr>
5071: <td></td>
5072: <td></td>
5073: <td class="md" nowrap>libnet_t * </td>
5074: <td class="mdname" nowrap> <em>l</em>, </td>
5075: </tr>
5076: <tr>
5077: <td></td>
5078: <td></td>
5079: <td class="md" nowrap>libnet_ptag_t </td>
5080: <td class="mdname" nowrap> <em>ptag</em></td>
5081: </tr>
5082: <tr>
5083: <td></td>
5084: <td class="md">) </td>
5085: <td class="md" colspan="2"></td>
5086: </tr>
5087:
5088: </table>
5089: </td>
5090: </tr>
5091: </table>
5092: <table cellspacing=5 cellpadding=0 border=0>
5093: <tr>
5094: <td>
5095:
5096: </td>
5097: <td>
5098:
5099: <p>
5100: Builds an RFC 3032 Multi-Protocol Label Switching (MPLS) header. <dl compact><dt><b>Parameters:</b></dt><dd>
5101: <table border="0" cellspacing="2" cellpadding="0">
5102: <tr><td valign=top><em>label</em> </td><td>20-bit label value </td></tr>
5103: <tr><td valign=top><em>experimental</em> </td><td>3-bit reserved field </td></tr>
5104: <tr><td valign=top><em>bos</em> </td><td>1-bit bottom of stack identifier </td></tr>
5105: <tr><td valign=top><em>ttl</em> </td><td>time to live </td></tr>
5106: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
5107: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
5108: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
5109: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
5110: </table>
5111: </dl>
5112: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
5113: </td>
5114: </tr>
5115: </table>
5116: <a class="anchor" name="a67" doxytag="libnet-functions.h::libnet_build_ntp" ></a><p>
5117: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
5118: <tr>
5119: <td class="mdRow">
5120: <table cellpadding="0" cellspacing="0" border="0">
5121: <tr>
5122: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ntp </td>
5123: <td class="md" valign="top">( </td>
5124: <td class="md" nowrap valign="top">u_int8_t </td>
5125: <td class="mdname" nowrap> <em>leap_indicator</em>, </td>
5126: </tr>
5127: <tr>
5128: <td></td>
5129: <td></td>
5130: <td class="md" nowrap>u_int8_t </td>
5131: <td class="mdname" nowrap> <em>version</em>, </td>
5132: </tr>
5133: <tr>
5134: <td></td>
5135: <td></td>
5136: <td class="md" nowrap>u_int8_t </td>
5137: <td class="mdname" nowrap> <em>mode</em>, </td>
5138: </tr>
5139: <tr>
5140: <td></td>
5141: <td></td>
5142: <td class="md" nowrap>u_int8_t </td>
5143: <td class="mdname" nowrap> <em>stratum</em>, </td>
5144: </tr>
5145: <tr>
5146: <td></td>
5147: <td></td>
5148: <td class="md" nowrap>u_int8_t </td>
5149: <td class="mdname" nowrap> <em>poll</em>, </td>
5150: </tr>
5151: <tr>
5152: <td></td>
5153: <td></td>
5154: <td class="md" nowrap>u_int8_t </td>
5155: <td class="mdname" nowrap> <em>precision</em>, </td>
5156: </tr>
5157: <tr>
5158: <td></td>
5159: <td></td>
5160: <td class="md" nowrap>u_int16_t </td>
5161: <td class="mdname" nowrap> <em>delay_int</em>, </td>
5162: </tr>
5163: <tr>
5164: <td></td>
5165: <td></td>
5166: <td class="md" nowrap>u_int16_t </td>
5167: <td class="mdname" nowrap> <em>delay_frac</em>, </td>
5168: </tr>
5169: <tr>
5170: <td></td>
5171: <td></td>
5172: <td class="md" nowrap>u_int16_t </td>
5173: <td class="mdname" nowrap> <em>dispersion_int</em>, </td>
5174: </tr>
5175: <tr>
5176: <td></td>
5177: <td></td>
5178: <td class="md" nowrap>u_int16_t </td>
5179: <td class="mdname" nowrap> <em>dispersion_frac</em>, </td>
5180: </tr>
5181: <tr>
5182: <td></td>
5183: <td></td>
5184: <td class="md" nowrap>u_int32_t </td>
5185: <td class="mdname" nowrap> <em>reference_id</em>, </td>
5186: </tr>
5187: <tr>
5188: <td></td>
5189: <td></td>
5190: <td class="md" nowrap>u_int32_t </td>
5191: <td class="mdname" nowrap> <em>ref_ts_int</em>, </td>
5192: </tr>
5193: <tr>
5194: <td></td>
5195: <td></td>
5196: <td class="md" nowrap>u_int32_t </td>
5197: <td class="mdname" nowrap> <em>ref_ts_frac</em>, </td>
5198: </tr>
5199: <tr>
5200: <td></td>
5201: <td></td>
5202: <td class="md" nowrap>u_int32_t </td>
5203: <td class="mdname" nowrap> <em>orig_ts_int</em>, </td>
5204: </tr>
5205: <tr>
5206: <td></td>
5207: <td></td>
5208: <td class="md" nowrap>u_int32_t </td>
5209: <td class="mdname" nowrap> <em>orig_ts_frac</em>, </td>
5210: </tr>
5211: <tr>
5212: <td></td>
5213: <td></td>
5214: <td class="md" nowrap>u_int32_t </td>
5215: <td class="mdname" nowrap> <em>rec_ts_int</em>, </td>
5216: </tr>
5217: <tr>
5218: <td></td>
5219: <td></td>
5220: <td class="md" nowrap>u_int32_t </td>
5221: <td class="mdname" nowrap> <em>rec_ts_frac</em>, </td>
5222: </tr>
5223: <tr>
5224: <td></td>
5225: <td></td>
5226: <td class="md" nowrap>u_int32_t </td>
5227: <td class="mdname" nowrap> <em>xmt_ts_int</em>, </td>
5228: </tr>
5229: <tr>
5230: <td></td>
5231: <td></td>
5232: <td class="md" nowrap>u_int32_t </td>
5233: <td class="mdname" nowrap> <em>xmt_ts_frac</em>, </td>
5234: </tr>
5235: <tr>
5236: <td></td>
5237: <td></td>
5238: <td class="md" nowrap>u_int8_t * </td>
5239: <td class="mdname" nowrap> <em>payload</em>, </td>
5240: </tr>
5241: <tr>
5242: <td></td>
5243: <td></td>
5244: <td class="md" nowrap>u_int32_t </td>
5245: <td class="mdname" nowrap> <em>payload_s</em>, </td>
5246: </tr>
5247: <tr>
5248: <td></td>
5249: <td></td>
5250: <td class="md" nowrap>libnet_t * </td>
5251: <td class="mdname" nowrap> <em>l</em>, </td>
5252: </tr>
5253: <tr>
5254: <td></td>
5255: <td></td>
5256: <td class="md" nowrap>libnet_ptag_t </td>
5257: <td class="mdname" nowrap> <em>ptag</em></td>
5258: </tr>
5259: <tr>
5260: <td></td>
5261: <td class="md">) </td>
5262: <td class="md" colspan="2"></td>
5263: </tr>
5264:
5265: </table>
5266: </td>
5267: </tr>
5268: </table>
5269: <table cellspacing=5 cellpadding=0 border=0>
5270: <tr>
5271: <td>
5272:
5273: </td>
5274: <td>
5275:
5276: <p>
5277: Builds an RFC 958 Network Time Protocol (NTP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
5278: <table border="0" cellspacing="2" cellpadding="0">
5279: <tr><td valign=top><em>leap_indicator</em> </td><td>the leap indicator </td></tr>
5280: <tr><td valign=top><em>version</em> </td><td>NTP protocol version </td></tr>
5281: <tr><td valign=top><em>mode</em> </td><td>NTP mode </td></tr>
5282: <tr><td valign=top><em>stratum</em> </td><td>stratum </td></tr>
5283: <tr><td valign=top><em>poll</em> </td><td>polling interval </td></tr>
5284: <tr><td valign=top><em>precision</em> </td><td>precision </td></tr>
5285: <tr><td valign=top><em>delay_interval</em> </td><td>delay interval </td></tr>
5286: <tr><td valign=top><em>delay_frac</em> </td><td>delay fraction </td></tr>
5287: <tr><td valign=top><em>dispersion_int</em> </td><td>dispersion interval </td></tr>
5288: <tr><td valign=top><em>dispersion_frac</em> </td><td>dispersion fraction </td></tr>
5289: <tr><td valign=top><em>reference_id</em> </td><td>reference id </td></tr>
5290: <tr><td valign=top><em>ref_ts_int</em> </td><td>reference timestamp integer </td></tr>
5291: <tr><td valign=top><em>ref_ts_frac</em> </td><td>reference timestamp fraction </td></tr>
5292: <tr><td valign=top><em>orig_ts_int</em> </td><td>original timestamp integer </td></tr>
5293: <tr><td valign=top><em>orig_ts_frac</em> </td><td>original timestamp fraction </td></tr>
5294: <tr><td valign=top><em>rec_ts_int</em> </td><td>receiver timestamp integer </td></tr>
5295: <tr><td valign=top><em>rec_ts_frac</em> </td><td>reciever timestamp fraction </td></tr>
5296: <tr><td valign=top><em>xmt_ts_int</em> </td><td>transmit timestamp integer </td></tr>
5297: <tr><td valign=top><em>xmt_ts_frac</em> </td><td>transmit timestamp integer </td></tr>
5298: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
5299: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
5300: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
5301: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
5302: </table>
5303: </dl>
5304: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
5305: </td>
5306: </tr>
5307: </table>
5308: <a class="anchor" name="a68" doxytag="libnet-functions.h::libnet_build_ospfv2" ></a><p>
5309: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
5310: <tr>
5311: <td class="mdRow">
5312: <table cellpadding="0" cellspacing="0" border="0">
5313: <tr>
5314: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2 </td>
5315: <td class="md" valign="top">( </td>
5316: <td class="md" nowrap valign="top">u_int16_t </td>
5317: <td class="mdname" nowrap> <em>len</em>, </td>
5318: </tr>
5319: <tr>
5320: <td></td>
5321: <td></td>
5322: <td class="md" nowrap>u_int8_t </td>
5323: <td class="mdname" nowrap> <em>type</em>, </td>
5324: </tr>
5325: <tr>
5326: <td></td>
5327: <td></td>
5328: <td class="md" nowrap>u_int32_t </td>
5329: <td class="mdname" nowrap> <em>rtr_id</em>, </td>
5330: </tr>
5331: <tr>
5332: <td></td>
5333: <td></td>
5334: <td class="md" nowrap>u_int32_t </td>
5335: <td class="mdname" nowrap> <em>area_id</em>, </td>
5336: </tr>
5337: <tr>
5338: <td></td>
5339: <td></td>
5340: <td class="md" nowrap>u_int16_t </td>
5341: <td class="mdname" nowrap> <em>sum</em>, </td>
5342: </tr>
5343: <tr>
5344: <td></td>
5345: <td></td>
5346: <td class="md" nowrap>u_int16_t </td>
5347: <td class="mdname" nowrap> <em>autype</em>, </td>
5348: </tr>
5349: <tr>
5350: <td></td>
5351: <td></td>
5352: <td class="md" nowrap>u_int8_t * </td>
5353: <td class="mdname" nowrap> <em>payload</em>, </td>
5354: </tr>
5355: <tr>
5356: <td></td>
5357: <td></td>
5358: <td class="md" nowrap>u_int32_t </td>
5359: <td class="mdname" nowrap> <em>payload_s</em>, </td>
5360: </tr>
5361: <tr>
5362: <td></td>
5363: <td></td>
5364: <td class="md" nowrap>libnet_t * </td>
5365: <td class="mdname" nowrap> <em>l</em>, </td>
5366: </tr>
5367: <tr>
5368: <td></td>
5369: <td></td>
5370: <td class="md" nowrap>libnet_ptag_t </td>
5371: <td class="mdname" nowrap> <em>ptag</em></td>
5372: </tr>
5373: <tr>
5374: <td></td>
5375: <td class="md">) </td>
5376: <td class="md" colspan="2"></td>
5377: </tr>
5378:
5379: </table>
5380: </td>
5381: </tr>
5382: </table>
5383: <table cellspacing=5 cellpadding=0 border=0>
5384: <tr>
5385: <td>
5386:
5387: </td>
5388: <td>
5389:
5390: <p>
5391: <dl compact><dt><b>Parameters:</b></dt><dd>
5392: <table border="0" cellspacing="2" cellpadding="0">
5393: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
5394: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
5395: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
5396: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
5397: </table>
5398: </dl>
5399: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
5400: </td>
5401: </tr>
5402: </table>
5403: <a class="anchor" name="a70" doxytag="libnet-functions.h::libnet_build_ospfv2_dbd" ></a><p>
5404: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
5405: <tr>
5406: <td class="mdRow">
5407: <table cellpadding="0" cellspacing="0" border="0">
5408: <tr>
5409: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_dbd </td>
5410: <td class="md" valign="top">( </td>
5411: <td class="md" nowrap valign="top">u_int16_t </td>
5412: <td class="mdname" nowrap> <em>dgram_len</em>, </td>
5413: </tr>
5414: <tr>
5415: <td></td>
5416: <td></td>
5417: <td class="md" nowrap>u_int8_t </td>
5418: <td class="mdname" nowrap> <em>opts</em>, </td>
5419: </tr>
5420: <tr>
5421: <td></td>
5422: <td></td>
5423: <td class="md" nowrap>u_int8_t </td>
5424: <td class="mdname" nowrap> <em>type</em>, </td>
5425: </tr>
5426: <tr>
5427: <td></td>
5428: <td></td>
5429: <td class="md" nowrap>u_int </td>
5430: <td class="mdname" nowrap> <em>seqnum</em>, </td>
5431: </tr>
5432: <tr>
5433: <td></td>
5434: <td></td>
5435: <td class="md" nowrap>u_int8_t * </td>
5436: <td class="mdname" nowrap> <em>payload</em>, </td>
5437: </tr>
5438: <tr>
5439: <td></td>
5440: <td></td>
5441: <td class="md" nowrap>u_int32_t </td>
5442: <td class="mdname" nowrap> <em>payload_s</em>, </td>
5443: </tr>
5444: <tr>
5445: <td></td>
5446: <td></td>
5447: <td class="md" nowrap>libnet_t * </td>
5448: <td class="mdname" nowrap> <em>l</em>, </td>
5449: </tr>
5450: <tr>
5451: <td></td>
5452: <td></td>
5453: <td class="md" nowrap>libnet_ptag_t </td>
5454: <td class="mdname" nowrap> <em>ptag</em></td>
5455: </tr>
5456: <tr>
5457: <td></td>
5458: <td class="md">) </td>
5459: <td class="md" colspan="2"></td>
5460: </tr>
5461:
5462: </table>
5463: </td>
5464: </tr>
5465: </table>
5466: <table cellspacing=5 cellpadding=0 border=0>
5467: <tr>
5468: <td>
5469:
5470: </td>
5471: <td>
5472:
5473: <p>
5474: <dl compact><dt><b>Parameters:</b></dt><dd>
5475: <table border="0" cellspacing="2" cellpadding="0">
5476: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
5477: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
5478: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
5479: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
5480: </table>
5481: </dl>
5482: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
5483: </td>
5484: </tr>
5485: </table>
5486: <a class="anchor" name="a69" doxytag="libnet-functions.h::libnet_build_ospfv2_hello" ></a><p>
5487: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
5488: <tr>
5489: <td class="mdRow">
5490: <table cellpadding="0" cellspacing="0" border="0">
5491: <tr>
5492: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_hello </td>
5493: <td class="md" valign="top">( </td>
5494: <td class="md" nowrap valign="top">u_int32_t </td>
5495: <td class="mdname" nowrap> <em>netmask</em>, </td>
5496: </tr>
5497: <tr>
5498: <td></td>
5499: <td></td>
5500: <td class="md" nowrap>u_int16_t </td>
5501: <td class="mdname" nowrap> <em>interval</em>, </td>
5502: </tr>
5503: <tr>
5504: <td></td>
5505: <td></td>
5506: <td class="md" nowrap>u_int8_t </td>
5507: <td class="mdname" nowrap> <em>opts</em>, </td>
5508: </tr>
5509: <tr>
5510: <td></td>
5511: <td></td>
5512: <td class="md" nowrap>u_int8_t </td>
5513: <td class="mdname" nowrap> <em>priority</em>, </td>
5514: </tr>
5515: <tr>
5516: <td></td>
5517: <td></td>
5518: <td class="md" nowrap>u_int </td>
5519: <td class="mdname" nowrap> <em>dead_int</em>, </td>
5520: </tr>
5521: <tr>
5522: <td></td>
5523: <td></td>
5524: <td class="md" nowrap>u_int32_t </td>
5525: <td class="mdname" nowrap> <em>des_rtr</em>, </td>
5526: </tr>
5527: <tr>
5528: <td></td>
5529: <td></td>
5530: <td class="md" nowrap>u_int32_t </td>
5531: <td class="mdname" nowrap> <em>bkup_rtr</em>, </td>
5532: </tr>
5533: <tr>
5534: <td></td>
5535: <td></td>
5536: <td class="md" nowrap>u_int32_t </td>
5537: <td class="mdname" nowrap> <em>neighbor</em>, </td>
5538: </tr>
5539: <tr>
5540: <td></td>
5541: <td></td>
5542: <td class="md" nowrap>u_int8_t * </td>
5543: <td class="mdname" nowrap> <em>payload</em>, </td>
5544: </tr>
5545: <tr>
5546: <td></td>
5547: <td></td>
5548: <td class="md" nowrap>u_int32_t </td>
5549: <td class="mdname" nowrap> <em>payload_s</em>, </td>
5550: </tr>
5551: <tr>
5552: <td></td>
5553: <td></td>
5554: <td class="md" nowrap>libnet_t * </td>
5555: <td class="mdname" nowrap> <em>l</em>, </td>
5556: </tr>
5557: <tr>
5558: <td></td>
5559: <td></td>
5560: <td class="md" nowrap>libnet_ptag_t </td>
5561: <td class="mdname" nowrap> <em>ptag</em></td>
5562: </tr>
5563: <tr>
5564: <td></td>
5565: <td class="md">) </td>
5566: <td class="md" colspan="2"></td>
5567: </tr>
5568:
5569: </table>
5570: </td>
5571: </tr>
5572: </table>
5573: <table cellspacing=5 cellpadding=0 border=0>
5574: <tr>
5575: <td>
5576:
5577: </td>
5578: <td>
5579:
5580: <p>
5581: <dl compact><dt><b>Parameters:</b></dt><dd>
5582: <table border="0" cellspacing="2" cellpadding="0">
5583: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
5584: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
5585: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
5586: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
5587: </table>
5588: </dl>
5589: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
5590: </td>
5591: </tr>
5592: </table>
5593: <a class="anchor" name="a73" doxytag="libnet-functions.h::libnet_build_ospfv2_lsa" ></a><p>
5594: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
5595: <tr>
5596: <td class="mdRow">
5597: <table cellpadding="0" cellspacing="0" border="0">
5598: <tr>
5599: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsa </td>
5600: <td class="md" valign="top">( </td>
5601: <td class="md" nowrap valign="top">u_int16_t </td>
5602: <td class="mdname" nowrap> <em>age</em>, </td>
5603: </tr>
5604: <tr>
5605: <td></td>
5606: <td></td>
5607: <td class="md" nowrap>u_int8_t </td>
5608: <td class="mdname" nowrap> <em>opts</em>, </td>
5609: </tr>
5610: <tr>
5611: <td></td>
5612: <td></td>
5613: <td class="md" nowrap>u_int8_t </td>
5614: <td class="mdname" nowrap> <em>type</em>, </td>
5615: </tr>
5616: <tr>
5617: <td></td>
5618: <td></td>
5619: <td class="md" nowrap>u_int </td>
5620: <td class="mdname" nowrap> <em>lsid</em>, </td>
5621: </tr>
5622: <tr>
5623: <td></td>
5624: <td></td>
5625: <td class="md" nowrap>u_int32_t </td>
5626: <td class="mdname" nowrap> <em>advrtr</em>, </td>
5627: </tr>
5628: <tr>
5629: <td></td>
5630: <td></td>
5631: <td class="md" nowrap>u_int </td>
5632: <td class="mdname" nowrap> <em>seqnum</em>, </td>
5633: </tr>
5634: <tr>
5635: <td></td>
5636: <td></td>
5637: <td class="md" nowrap>u_int16_t </td>
5638: <td class="mdname" nowrap> <em>sum</em>, </td>
5639: </tr>
5640: <tr>
5641: <td></td>
5642: <td></td>
5643: <td class="md" nowrap>u_int16_t </td>
5644: <td class="mdname" nowrap> <em>len</em>, </td>
5645: </tr>
5646: <tr>
5647: <td></td>
5648: <td></td>
5649: <td class="md" nowrap>u_int8_t * </td>
5650: <td class="mdname" nowrap> <em>payload</em>, </td>
5651: </tr>
5652: <tr>
5653: <td></td>
5654: <td></td>
5655: <td class="md" nowrap>u_int32_t </td>
5656: <td class="mdname" nowrap> <em>payload_s</em>, </td>
5657: </tr>
5658: <tr>
5659: <td></td>
5660: <td></td>
5661: <td class="md" nowrap>libnet_t * </td>
5662: <td class="mdname" nowrap> <em>l</em>, </td>
5663: </tr>
5664: <tr>
5665: <td></td>
5666: <td></td>
5667: <td class="md" nowrap>libnet_ptag_t </td>
5668: <td class="mdname" nowrap> <em>ptag</em></td>
5669: </tr>
5670: <tr>
5671: <td></td>
5672: <td class="md">) </td>
5673: <td class="md" colspan="2"></td>
5674: </tr>
5675:
5676: </table>
5677: </td>
5678: </tr>
5679: </table>
5680: <table cellspacing=5 cellpadding=0 border=0>
5681: <tr>
5682: <td>
5683:
5684: </td>
5685: <td>
5686:
5687: <p>
5688: <dl compact><dt><b>Parameters:</b></dt><dd>
5689: <table border="0" cellspacing="2" cellpadding="0">
5690: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
5691: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
5692: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
5693: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
5694: </table>
5695: </dl>
5696: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
5697: </td>
5698: </tr>
5699: </table>
5700: <a class="anchor" name="a77" doxytag="libnet-functions.h::libnet_build_ospfv2_lsa_as" ></a><p>
5701: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
5702: <tr>
5703: <td class="mdRow">
5704: <table cellpadding="0" cellspacing="0" border="0">
5705: <tr>
5706: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsa_as </td>
5707: <td class="md" valign="top">( </td>
5708: <td class="md" nowrap valign="top">u_int32_t </td>
5709: <td class="mdname" nowrap> <em>nmask</em>, </td>
5710: </tr>
5711: <tr>
5712: <td></td>
5713: <td></td>
5714: <td class="md" nowrap>u_int </td>
5715: <td class="mdname" nowrap> <em>metric</em>, </td>
5716: </tr>
5717: <tr>
5718: <td></td>
5719: <td></td>
5720: <td class="md" nowrap>u_int32_t </td>
5721: <td class="mdname" nowrap> <em>fwdaddr</em>, </td>
5722: </tr>
5723: <tr>
5724: <td></td>
5725: <td></td>
5726: <td class="md" nowrap>u_int </td>
5727: <td class="mdname" nowrap> <em>tag</em>, </td>
5728: </tr>
5729: <tr>
5730: <td></td>
5731: <td></td>
5732: <td class="md" nowrap>u_int8_t * </td>
5733: <td class="mdname" nowrap> <em>payload</em>, </td>
5734: </tr>
5735: <tr>
5736: <td></td>
5737: <td></td>
5738: <td class="md" nowrap>u_int32_t </td>
5739: <td class="mdname" nowrap> <em>payload_s</em>, </td>
5740: </tr>
5741: <tr>
5742: <td></td>
5743: <td></td>
5744: <td class="md" nowrap>libnet_t * </td>
5745: <td class="mdname" nowrap> <em>l</em>, </td>
5746: </tr>
5747: <tr>
5748: <td></td>
5749: <td></td>
5750: <td class="md" nowrap>libnet_ptag_t </td>
5751: <td class="mdname" nowrap> <em>ptag</em></td>
5752: </tr>
5753: <tr>
5754: <td></td>
5755: <td class="md">) </td>
5756: <td class="md" colspan="2"></td>
5757: </tr>
5758:
5759: </table>
5760: </td>
5761: </tr>
5762: </table>
5763: <table cellspacing=5 cellpadding=0 border=0>
5764: <tr>
5765: <td>
5766:
5767: </td>
5768: <td>
5769:
5770: <p>
5771: <dl compact><dt><b>Parameters:</b></dt><dd>
5772: <table border="0" cellspacing="2" cellpadding="0">
5773: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
5774: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
5775: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
5776: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
5777: </table>
5778: </dl>
5779: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
5780: </td>
5781: </tr>
5782: </table>
5783: <a class="anchor" name="a75" doxytag="libnet-functions.h::libnet_build_ospfv2_lsa_net" ></a><p>
5784: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
5785: <tr>
5786: <td class="mdRow">
5787: <table cellpadding="0" cellspacing="0" border="0">
5788: <tr>
5789: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsa_net </td>
5790: <td class="md" valign="top">( </td>
5791: <td class="md" nowrap valign="top">u_int32_t </td>
5792: <td class="mdname" nowrap> <em>nmask</em>, </td>
5793: </tr>
5794: <tr>
5795: <td></td>
5796: <td></td>
5797: <td class="md" nowrap>u_int </td>
5798: <td class="mdname" nowrap> <em>rtrid</em>, </td>
5799: </tr>
5800: <tr>
5801: <td></td>
5802: <td></td>
5803: <td class="md" nowrap>u_int8_t * </td>
5804: <td class="mdname" nowrap> <em>payload</em>, </td>
5805: </tr>
5806: <tr>
5807: <td></td>
5808: <td></td>
5809: <td class="md" nowrap>u_int32_t </td>
5810: <td class="mdname" nowrap> <em>payload_s</em>, </td>
5811: </tr>
5812: <tr>
5813: <td></td>
5814: <td></td>
5815: <td class="md" nowrap>libnet_t * </td>
5816: <td class="mdname" nowrap> <em>l</em>, </td>
5817: </tr>
5818: <tr>
5819: <td></td>
5820: <td></td>
5821: <td class="md" nowrap>libnet_ptag_t </td>
5822: <td class="mdname" nowrap> <em>ptag</em></td>
5823: </tr>
5824: <tr>
5825: <td></td>
5826: <td class="md">) </td>
5827: <td class="md" colspan="2"></td>
5828: </tr>
5829:
5830: </table>
5831: </td>
5832: </tr>
5833: </table>
5834: <table cellspacing=5 cellpadding=0 border=0>
5835: <tr>
5836: <td>
5837:
5838: </td>
5839: <td>
5840:
5841: <p>
5842: <dl compact><dt><b>Parameters:</b></dt><dd>
5843: <table border="0" cellspacing="2" cellpadding="0">
5844: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
5845: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
5846: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
5847: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
5848: </table>
5849: </dl>
5850: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
5851: </td>
5852: </tr>
5853: </table>
5854: <a class="anchor" name="a74" doxytag="libnet-functions.h::libnet_build_ospfv2_lsa_rtr" ></a><p>
5855: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
5856: <tr>
5857: <td class="mdRow">
5858: <table cellpadding="0" cellspacing="0" border="0">
5859: <tr>
5860: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsa_rtr </td>
5861: <td class="md" valign="top">( </td>
5862: <td class="md" nowrap valign="top">u_int16_t </td>
5863: <td class="mdname" nowrap> <em>flags</em>, </td>
5864: </tr>
5865: <tr>
5866: <td></td>
5867: <td></td>
5868: <td class="md" nowrap>u_int16_t </td>
5869: <td class="mdname" nowrap> <em>num</em>, </td>
5870: </tr>
5871: <tr>
5872: <td></td>
5873: <td></td>
5874: <td class="md" nowrap>u_int </td>
5875: <td class="mdname" nowrap> <em>id</em>, </td>
5876: </tr>
5877: <tr>
5878: <td></td>
5879: <td></td>
5880: <td class="md" nowrap>u_int </td>
5881: <td class="mdname" nowrap> <em>data</em>, </td>
5882: </tr>
5883: <tr>
5884: <td></td>
5885: <td></td>
5886: <td class="md" nowrap>u_int8_t </td>
5887: <td class="mdname" nowrap> <em>type</em>, </td>
5888: </tr>
5889: <tr>
5890: <td></td>
5891: <td></td>
5892: <td class="md" nowrap>u_int8_t </td>
5893: <td class="mdname" nowrap> <em>tos</em>, </td>
5894: </tr>
5895: <tr>
5896: <td></td>
5897: <td></td>
5898: <td class="md" nowrap>u_int16_t </td>
5899: <td class="mdname" nowrap> <em>metric</em>, </td>
5900: </tr>
5901: <tr>
5902: <td></td>
5903: <td></td>
5904: <td class="md" nowrap>u_int8_t * </td>
5905: <td class="mdname" nowrap> <em>payload</em>, </td>
5906: </tr>
5907: <tr>
5908: <td></td>
5909: <td></td>
5910: <td class="md" nowrap>u_int32_t </td>
5911: <td class="mdname" nowrap> <em>payload_s</em>, </td>
5912: </tr>
5913: <tr>
5914: <td></td>
5915: <td></td>
5916: <td class="md" nowrap>libnet_t * </td>
5917: <td class="mdname" nowrap> <em>l</em>, </td>
5918: </tr>
5919: <tr>
5920: <td></td>
5921: <td></td>
5922: <td class="md" nowrap>libnet_ptag_t </td>
5923: <td class="mdname" nowrap> <em>ptag</em></td>
5924: </tr>
5925: <tr>
5926: <td></td>
5927: <td class="md">) </td>
5928: <td class="md" colspan="2"></td>
5929: </tr>
5930:
5931: </table>
5932: </td>
5933: </tr>
5934: </table>
5935: <table cellspacing=5 cellpadding=0 border=0>
5936: <tr>
5937: <td>
5938:
5939: </td>
5940: <td>
5941:
5942: <p>
5943: <dl compact><dt><b>Parameters:</b></dt><dd>
5944: <table border="0" cellspacing="2" cellpadding="0">
5945: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
5946: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
5947: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
5948: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
5949: </table>
5950: </dl>
5951: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
5952: </td>
5953: </tr>
5954: </table>
5955: <a class="anchor" name="a76" doxytag="libnet-functions.h::libnet_build_ospfv2_lsa_sum" ></a><p>
5956: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
5957: <tr>
5958: <td class="mdRow">
5959: <table cellpadding="0" cellspacing="0" border="0">
5960: <tr>
5961: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsa_sum </td>
5962: <td class="md" valign="top">( </td>
5963: <td class="md" nowrap valign="top">u_int32_t </td>
5964: <td class="mdname" nowrap> <em>nmask</em>, </td>
5965: </tr>
5966: <tr>
5967: <td></td>
5968: <td></td>
5969: <td class="md" nowrap>u_int </td>
5970: <td class="mdname" nowrap> <em>metric</em>, </td>
5971: </tr>
5972: <tr>
5973: <td></td>
5974: <td></td>
5975: <td class="md" nowrap>u_int </td>
5976: <td class="mdname" nowrap> <em>tos</em>, </td>
5977: </tr>
5978: <tr>
5979: <td></td>
5980: <td></td>
5981: <td class="md" nowrap>u_int8_t * </td>
5982: <td class="mdname" nowrap> <em>payload</em>, </td>
5983: </tr>
5984: <tr>
5985: <td></td>
5986: <td></td>
5987: <td class="md" nowrap>u_int32_t </td>
5988: <td class="mdname" nowrap> <em>payload_s</em>, </td>
5989: </tr>
5990: <tr>
5991: <td></td>
5992: <td></td>
5993: <td class="md" nowrap>libnet_t * </td>
5994: <td class="mdname" nowrap> <em>l</em>, </td>
5995: </tr>
5996: <tr>
5997: <td></td>
5998: <td></td>
5999: <td class="md" nowrap>libnet_ptag_t </td>
6000: <td class="mdname" nowrap> <em>ptag</em></td>
6001: </tr>
6002: <tr>
6003: <td></td>
6004: <td class="md">) </td>
6005: <td class="md" colspan="2"></td>
6006: </tr>
6007:
6008: </table>
6009: </td>
6010: </tr>
6011: </table>
6012: <table cellspacing=5 cellpadding=0 border=0>
6013: <tr>
6014: <td>
6015:
6016: </td>
6017: <td>
6018:
6019: <p>
6020: <dl compact><dt><b>Parameters:</b></dt><dd>
6021: <table border="0" cellspacing="2" cellpadding="0">
6022: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
6023: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
6024: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
6025: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
6026: </table>
6027: </dl>
6028: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
6029: </td>
6030: </tr>
6031: </table>
6032: <a class="anchor" name="a71" doxytag="libnet-functions.h::libnet_build_ospfv2_lsr" ></a><p>
6033: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
6034: <tr>
6035: <td class="mdRow">
6036: <table cellpadding="0" cellspacing="0" border="0">
6037: <tr>
6038: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsr </td>
6039: <td class="md" valign="top">( </td>
6040: <td class="md" nowrap valign="top">u_int </td>
6041: <td class="mdname" nowrap> <em>type</em>, </td>
6042: </tr>
6043: <tr>
6044: <td></td>
6045: <td></td>
6046: <td class="md" nowrap>u_int </td>
6047: <td class="mdname" nowrap> <em>lsid</em>, </td>
6048: </tr>
6049: <tr>
6050: <td></td>
6051: <td></td>
6052: <td class="md" nowrap>u_int32_t </td>
6053: <td class="mdname" nowrap> <em>advrtr</em>, </td>
6054: </tr>
6055: <tr>
6056: <td></td>
6057: <td></td>
6058: <td class="md" nowrap>u_int8_t * </td>
6059: <td class="mdname" nowrap> <em>payload</em>, </td>
6060: </tr>
6061: <tr>
6062: <td></td>
6063: <td></td>
6064: <td class="md" nowrap>u_int32_t </td>
6065: <td class="mdname" nowrap> <em>payload_s</em>, </td>
6066: </tr>
6067: <tr>
6068: <td></td>
6069: <td></td>
6070: <td class="md" nowrap>libnet_t * </td>
6071: <td class="mdname" nowrap> <em>l</em>, </td>
6072: </tr>
6073: <tr>
6074: <td></td>
6075: <td></td>
6076: <td class="md" nowrap>libnet_ptag_t </td>
6077: <td class="mdname" nowrap> <em>ptag</em></td>
6078: </tr>
6079: <tr>
6080: <td></td>
6081: <td class="md">) </td>
6082: <td class="md" colspan="2"></td>
6083: </tr>
6084:
6085: </table>
6086: </td>
6087: </tr>
6088: </table>
6089: <table cellspacing=5 cellpadding=0 border=0>
6090: <tr>
6091: <td>
6092:
6093: </td>
6094: <td>
6095:
6096: <p>
6097: <dl compact><dt><b>Parameters:</b></dt><dd>
6098: <table border="0" cellspacing="2" cellpadding="0">
6099: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
6100: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
6101: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
6102: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
6103: </table>
6104: </dl>
6105: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
6106: </td>
6107: </tr>
6108: </table>
6109: <a class="anchor" name="a72" doxytag="libnet-functions.h::libnet_build_ospfv2_lsu" ></a><p>
6110: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
6111: <tr>
6112: <td class="mdRow">
6113: <table cellpadding="0" cellspacing="0" border="0">
6114: <tr>
6115: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_ospfv2_lsu </td>
6116: <td class="md" valign="top">( </td>
6117: <td class="md" nowrap valign="top">u_int </td>
6118: <td class="mdname" nowrap> <em>num</em>, </td>
6119: </tr>
6120: <tr>
6121: <td></td>
6122: <td></td>
6123: <td class="md" nowrap>u_int8_t * </td>
6124: <td class="mdname" nowrap> <em>payload</em>, </td>
6125: </tr>
6126: <tr>
6127: <td></td>
6128: <td></td>
6129: <td class="md" nowrap>u_int32_t </td>
6130: <td class="mdname" nowrap> <em>payload_s</em>, </td>
6131: </tr>
6132: <tr>
6133: <td></td>
6134: <td></td>
6135: <td class="md" nowrap>libnet_t * </td>
6136: <td class="mdname" nowrap> <em>l</em>, </td>
6137: </tr>
6138: <tr>
6139: <td></td>
6140: <td></td>
6141: <td class="md" nowrap>libnet_ptag_t </td>
6142: <td class="mdname" nowrap> <em>ptag</em></td>
6143: </tr>
6144: <tr>
6145: <td></td>
6146: <td class="md">) </td>
6147: <td class="md" colspan="2"></td>
6148: </tr>
6149:
6150: </table>
6151: </td>
6152: </tr>
6153: </table>
6154: <table cellspacing=5 cellpadding=0 border=0>
6155: <tr>
6156: <td>
6157:
6158: </td>
6159: <td>
6160:
6161: <p>
6162: <dl compact><dt><b>Parameters:</b></dt><dd>
6163: <table border="0" cellspacing="2" cellpadding="0">
6164: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
6165: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
6166: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
6167: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
6168: </table>
6169: </dl>
6170: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
6171: </td>
6172: </tr>
6173: </table>
6174: <a class="anchor" name="a59" doxytag="libnet-functions.h::libnet_build_rip" ></a><p>
6175: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
6176: <tr>
6177: <td class="mdRow">
6178: <table cellpadding="0" cellspacing="0" border="0">
6179: <tr>
6180: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_rip </td>
6181: <td class="md" valign="top">( </td>
6182: <td class="md" nowrap valign="top">u_int8_t </td>
6183: <td class="mdname" nowrap> <em>cmd</em>, </td>
6184: </tr>
6185: <tr>
6186: <td></td>
6187: <td></td>
6188: <td class="md" nowrap>u_int8_t </td>
6189: <td class="mdname" nowrap> <em>version</em>, </td>
6190: </tr>
6191: <tr>
6192: <td></td>
6193: <td></td>
6194: <td class="md" nowrap>u_int16_t </td>
6195: <td class="mdname" nowrap> <em>rd</em>, </td>
6196: </tr>
6197: <tr>
6198: <td></td>
6199: <td></td>
6200: <td class="md" nowrap>u_int16_t </td>
6201: <td class="mdname" nowrap> <em>af</em>, </td>
6202: </tr>
6203: <tr>
6204: <td></td>
6205: <td></td>
6206: <td class="md" nowrap>u_int16_t </td>
6207: <td class="mdname" nowrap> <em>rt</em>, </td>
6208: </tr>
6209: <tr>
6210: <td></td>
6211: <td></td>
6212: <td class="md" nowrap>u_int32_t </td>
6213: <td class="mdname" nowrap> <em>addr</em>, </td>
6214: </tr>
6215: <tr>
6216: <td></td>
6217: <td></td>
6218: <td class="md" nowrap>u_int32_t </td>
6219: <td class="mdname" nowrap> <em>mask</em>, </td>
6220: </tr>
6221: <tr>
6222: <td></td>
6223: <td></td>
6224: <td class="md" nowrap>u_int32_t </td>
6225: <td class="mdname" nowrap> <em>next_hop</em>, </td>
6226: </tr>
6227: <tr>
6228: <td></td>
6229: <td></td>
6230: <td class="md" nowrap>u_int32_t </td>
6231: <td class="mdname" nowrap> <em>metric</em>, </td>
6232: </tr>
6233: <tr>
6234: <td></td>
6235: <td></td>
6236: <td class="md" nowrap>u_int8_t * </td>
6237: <td class="mdname" nowrap> <em>payload</em>, </td>
6238: </tr>
6239: <tr>
6240: <td></td>
6241: <td></td>
6242: <td class="md" nowrap>u_int32_t </td>
6243: <td class="mdname" nowrap> <em>payload_s</em>, </td>
6244: </tr>
6245: <tr>
6246: <td></td>
6247: <td></td>
6248: <td class="md" nowrap>libnet_t * </td>
6249: <td class="mdname" nowrap> <em>l</em>, </td>
6250: </tr>
6251: <tr>
6252: <td></td>
6253: <td></td>
6254: <td class="md" nowrap>libnet_ptag_t </td>
6255: <td class="mdname" nowrap> <em>ptag</em></td>
6256: </tr>
6257: <tr>
6258: <td></td>
6259: <td class="md">) </td>
6260: <td class="md" colspan="2"></td>
6261: </tr>
6262:
6263: </table>
6264: </td>
6265: </tr>
6266: </table>
6267: <table cellspacing=5 cellpadding=0 border=0>
6268: <tr>
6269: <td>
6270:
6271: </td>
6272: <td>
6273:
6274: <p>
6275: Builds a Routing Information Protocol header (RFCs 1058 and 2453). <dl compact><dt><b>Parameters:</b></dt><dd>
6276: <table border="0" cellspacing="2" cellpadding="0">
6277: <tr><td valign=top><em>cmd</em> </td><td>command </td></tr>
6278: <tr><td valign=top><em>version</em> </td><td>protocol version </td></tr>
6279: <tr><td valign=top><em>rd</em> </td><td>version one: 0, version two: routing domain </td></tr>
6280: <tr><td valign=top><em>af</em> </td><td>address family </td></tr>
6281: <tr><td valign=top><em>rt</em> </td><td>version one: 0, version two: route tag </td></tr>
6282: <tr><td valign=top><em>addr</em> </td><td>IPv4 address </td></tr>
6283: <tr><td valign=top><em>mask</em> </td><td>version one: 0, version two: subnet mask </td></tr>
6284: <tr><td valign=top><em>next_hop</em> </td><td>version one: 0, version two: next hop address </td></tr>
6285: <tr><td valign=top><em>metric</em> </td><td>routing metric </td></tr>
6286: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
6287: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
6288: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
6289: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
6290: </table>
6291: </dl>
6292: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
6293: </td>
6294: </tr>
6295: </table>
6296: <a class="anchor" name="a60" doxytag="libnet-functions.h::libnet_build_rpc_call" ></a><p>
6297: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
6298: <tr>
6299: <td class="mdRow">
6300: <table cellpadding="0" cellspacing="0" border="0">
6301: <tr>
6302: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_rpc_call </td>
6303: <td class="md" valign="top">( </td>
6304: <td class="md" nowrap valign="top">u_int32_t </td>
6305: <td class="mdname" nowrap> <em>rm</em>, </td>
6306: </tr>
6307: <tr>
6308: <td></td>
6309: <td></td>
6310: <td class="md" nowrap>u_int32_t </td>
6311: <td class="mdname" nowrap> <em>xid</em>, </td>
6312: </tr>
6313: <tr>
6314: <td></td>
6315: <td></td>
6316: <td class="md" nowrap>u_int32_t </td>
6317: <td class="mdname" nowrap> <em>prog_num</em>, </td>
6318: </tr>
6319: <tr>
6320: <td></td>
6321: <td></td>
6322: <td class="md" nowrap>u_int32_t </td>
6323: <td class="mdname" nowrap> <em>prog_vers</em>, </td>
6324: </tr>
6325: <tr>
6326: <td></td>
6327: <td></td>
6328: <td class="md" nowrap>u_int32_t </td>
6329: <td class="mdname" nowrap> <em>procedure</em>, </td>
6330: </tr>
6331: <tr>
6332: <td></td>
6333: <td></td>
6334: <td class="md" nowrap>u_int32_t </td>
6335: <td class="mdname" nowrap> <em>cflavor</em>, </td>
6336: </tr>
6337: <tr>
6338: <td></td>
6339: <td></td>
6340: <td class="md" nowrap>u_int32_t </td>
6341: <td class="mdname" nowrap> <em>clength</em>, </td>
6342: </tr>
6343: <tr>
6344: <td></td>
6345: <td></td>
6346: <td class="md" nowrap>u_int8_t * </td>
6347: <td class="mdname" nowrap> <em>cdata</em>, </td>
6348: </tr>
6349: <tr>
6350: <td></td>
6351: <td></td>
6352: <td class="md" nowrap>u_int32_t </td>
6353: <td class="mdname" nowrap> <em>vflavor</em>, </td>
6354: </tr>
6355: <tr>
6356: <td></td>
6357: <td></td>
6358: <td class="md" nowrap>u_int32_t </td>
6359: <td class="mdname" nowrap> <em>vlength</em>, </td>
6360: </tr>
6361: <tr>
6362: <td></td>
6363: <td></td>
6364: <td class="md" nowrap>u_int8_t * </td>
6365: <td class="mdname" nowrap> <em>vdata</em>, </td>
6366: </tr>
6367: <tr>
6368: <td></td>
6369: <td></td>
6370: <td class="md" nowrap>u_int8_t * </td>
6371: <td class="mdname" nowrap> <em>payload</em>, </td>
6372: </tr>
6373: <tr>
6374: <td></td>
6375: <td></td>
6376: <td class="md" nowrap>u_int32_t </td>
6377: <td class="mdname" nowrap> <em>payload_s</em>, </td>
6378: </tr>
6379: <tr>
6380: <td></td>
6381: <td></td>
6382: <td class="md" nowrap>libnet_t * </td>
6383: <td class="mdname" nowrap> <em>l</em>, </td>
6384: </tr>
6385: <tr>
6386: <td></td>
6387: <td></td>
6388: <td class="md" nowrap>libnet_ptag_t </td>
6389: <td class="mdname" nowrap> <em>ptag</em></td>
6390: </tr>
6391: <tr>
6392: <td></td>
6393: <td class="md">) </td>
6394: <td class="md" colspan="2"></td>
6395: </tr>
6396:
6397: </table>
6398: </td>
6399: </tr>
6400: </table>
6401: <table cellspacing=5 cellpadding=0 border=0>
6402: <tr>
6403: <td>
6404:
6405: </td>
6406: <td>
6407:
6408: <p>
6409: 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). <dl compact><dt><b>Parameters:</b></dt><dd>
6410: <table border="0" cellspacing="2" cellpadding="0">
6411: <tr><td valign=top><em>rm</em> </td><td>record marking indicating the position in a stream, 0 otherwise </td></tr>
6412: <tr><td valign=top><em>xid</em> </td><td>transaction identifier used to link calls and replies </td></tr>
6413: <tr><td valign=top><em>prog_num</em> </td><td>remote program specification typically between 0 - 1fffffff </td></tr>
6414: <tr><td valign=top><em>prog_vers</em> </td><td>remote program version specification </td></tr>
6415: <tr><td valign=top><em>procedure</em> </td><td>procedure to be performed by remote program </td></tr>
6416: <tr><td valign=top><em>cflavor</em> </td><td>authentication credential type </td></tr>
6417: <tr><td valign=top><em>clength</em> </td><td>credential length (should be 0) </td></tr>
6418: <tr><td valign=top><em>cdata</em> </td><td>opaque credential data (currently unused) </td></tr>
6419: <tr><td valign=top><em>vflavor</em> </td><td>authentication verifier type </td></tr>
6420: <tr><td valign=top><em>vlength</em> </td><td>verifier length (should be 0) </td></tr>
6421: <tr><td valign=top><em>vdata</em> </td><td>opaque verifier data (currently unused) </td></tr>
6422: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
6423: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
6424: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
6425: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
6426: </table>
6427: </dl>
6428: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
6429: </td>
6430: </tr>
6431: </table>
6432: <a class="anchor" name="a90" doxytag="libnet-functions.h::libnet_build_sebek" ></a><p>
6433: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
6434: <tr>
6435: <td class="mdRow">
6436: <table cellpadding="0" cellspacing="0" border="0">
6437: <tr>
6438: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_sebek </td>
6439: <td class="md" valign="top">( </td>
6440: <td class="md" nowrap valign="top">u_int32_t </td>
6441: <td class="mdname" nowrap> <em>magic</em>, </td>
6442: </tr>
6443: <tr>
6444: <td></td>
6445: <td></td>
6446: <td class="md" nowrap>u_int16_t </td>
6447: <td class="mdname" nowrap> <em>version</em>, </td>
6448: </tr>
6449: <tr>
6450: <td></td>
6451: <td></td>
6452: <td class="md" nowrap>u_int16_t </td>
6453: <td class="mdname" nowrap> <em>type</em>, </td>
6454: </tr>
6455: <tr>
6456: <td></td>
6457: <td></td>
6458: <td class="md" nowrap>u_int32_t </td>
6459: <td class="mdname" nowrap> <em>counter</em>, </td>
6460: </tr>
6461: <tr>
6462: <td></td>
6463: <td></td>
6464: <td class="md" nowrap>u_int32_t </td>
6465: <td class="mdname" nowrap> <em>time_sec</em>, </td>
6466: </tr>
6467: <tr>
6468: <td></td>
6469: <td></td>
6470: <td class="md" nowrap>u_int32_t </td>
6471: <td class="mdname" nowrap> <em>time_usec</em>, </td>
6472: </tr>
6473: <tr>
6474: <td></td>
6475: <td></td>
6476: <td class="md" nowrap>u_int32_t </td>
6477: <td class="mdname" nowrap> <em>pid</em>, </td>
6478: </tr>
6479: <tr>
6480: <td></td>
6481: <td></td>
6482: <td class="md" nowrap>u_int32_t </td>
6483: <td class="mdname" nowrap> <em>uid</em>, </td>
6484: </tr>
6485: <tr>
6486: <td></td>
6487: <td></td>
6488: <td class="md" nowrap>u_int32_t </td>
6489: <td class="mdname" nowrap> <em>fd</em>, </td>
6490: </tr>
6491: <tr>
6492: <td></td>
6493: <td></td>
6494: <td class="md" nowrap>u_int8_t </td>
6495: <td class="mdname" nowrap> <em>cmd</em>[SEBEK_CMD_LENGTH], </td>
6496: </tr>
6497: <tr>
6498: <td></td>
6499: <td></td>
6500: <td class="md" nowrap>u_int32_t </td>
6501: <td class="mdname" nowrap> <em>length</em>, </td>
6502: </tr>
6503: <tr>
6504: <td></td>
6505: <td></td>
6506: <td class="md" nowrap>u_int8_t * </td>
6507: <td class="mdname" nowrap> <em>payload</em>, </td>
6508: </tr>
6509: <tr>
6510: <td></td>
6511: <td></td>
6512: <td class="md" nowrap>u_int32_t </td>
6513: <td class="mdname" nowrap> <em>payload_s</em>, </td>
6514: </tr>
6515: <tr>
6516: <td></td>
6517: <td></td>
6518: <td class="md" nowrap>libnet_t * </td>
6519: <td class="mdname" nowrap> <em>l</em>, </td>
6520: </tr>
6521: <tr>
6522: <td></td>
6523: <td></td>
6524: <td class="md" nowrap>libnet_ptag_t </td>
6525: <td class="mdname" nowrap> <em>ptag</em></td>
6526: </tr>
6527: <tr>
6528: <td></td>
6529: <td class="md">) </td>
6530: <td class="md" colspan="2"></td>
6531: </tr>
6532:
6533: </table>
6534: </td>
6535: </tr>
6536: </table>
6537: <table cellspacing=5 cellpadding=0 border=0>
6538: <tr>
6539: <td>
6540:
6541: </td>
6542: <td>
6543:
6544: <p>
6545: 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: <a href="http://www.honeynet.org/papers/sebek.pdf.">http://www.honeynet.org/papers/sebek.pdf.</a><p>
6546: <dl compact><dt><b>Parameters:</b></dt><dd>
6547: <table border="0" cellspacing="2" cellpadding="0">
6548: <tr><td valign=top><em>magic</em> </td><td>identify packets that should be hidden </td></tr>
6549: <tr><td valign=top><em>version</em> </td><td>protocol version, currently 1 </td></tr>
6550: <tr><td valign=top><em>type</em> </td><td>type of record (read data is type 0, write data is type 1) </td></tr>
6551: <tr><td valign=top><em>counter</em> </td><td>PDU counter used to identify when packet are lost </td></tr>
6552: <tr><td valign=top><em>time_sec</em> </td><td>seconds since EPOCH according to the honeypot </td></tr>
6553: <tr><td valign=top><em>time_usec</em> </td><td>residual microseconds </td></tr>
6554: <tr><td valign=top><em>pid</em> </td><td>PID </td></tr>
6555: <tr><td valign=top><em>uid</em> </td><td>UID </td></tr>
6556: <tr><td valign=top><em>fd</em> </td><td>FD </td></tr>
6557: <tr><td valign=top><em>cmd[SEBEK_CMD_LENGTH]</em> </td><td>12 first characters of the command </td></tr>
6558: <tr><td valign=top><em>length</em> </td><td>length in bytes of the PDU's body </td></tr>
6559: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
6560: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
6561: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
6562: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
6563: </table>
6564: </dl>
6565: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
6566: </td>
6567: </tr>
6568: </table>
6569: <a class="anchor" name="a61" doxytag="libnet-functions.h::libnet_build_stp_conf" ></a><p>
6570: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
6571: <tr>
6572: <td class="mdRow">
6573: <table cellpadding="0" cellspacing="0" border="0">
6574: <tr>
6575: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_stp_conf </td>
6576: <td class="md" valign="top">( </td>
6577: <td class="md" nowrap valign="top">u_int16_t </td>
6578: <td class="mdname" nowrap> <em>id</em>, </td>
6579: </tr>
6580: <tr>
6581: <td></td>
6582: <td></td>
6583: <td class="md" nowrap>u_int8_t </td>
6584: <td class="mdname" nowrap> <em>version</em>, </td>
6585: </tr>
6586: <tr>
6587: <td></td>
6588: <td></td>
6589: <td class="md" nowrap>u_int8_t </td>
6590: <td class="mdname" nowrap> <em>bpdu_type</em>, </td>
6591: </tr>
6592: <tr>
6593: <td></td>
6594: <td></td>
6595: <td class="md" nowrap>u_int8_t </td>
6596: <td class="mdname" nowrap> <em>flags</em>, </td>
6597: </tr>
6598: <tr>
6599: <td></td>
6600: <td></td>
6601: <td class="md" nowrap>u_int8_t * </td>
6602: <td class="mdname" nowrap> <em>root_id</em>, </td>
6603: </tr>
6604: <tr>
6605: <td></td>
6606: <td></td>
6607: <td class="md" nowrap>u_int32_t </td>
6608: <td class="mdname" nowrap> <em>root_pc</em>, </td>
6609: </tr>
6610: <tr>
6611: <td></td>
6612: <td></td>
6613: <td class="md" nowrap>u_int8_t * </td>
6614: <td class="mdname" nowrap> <em>bridge_id</em>, </td>
6615: </tr>
6616: <tr>
6617: <td></td>
6618: <td></td>
6619: <td class="md" nowrap>u_int16_t </td>
6620: <td class="mdname" nowrap> <em>port_id</em>, </td>
6621: </tr>
6622: <tr>
6623: <td></td>
6624: <td></td>
6625: <td class="md" nowrap>u_int16_t </td>
6626: <td class="mdname" nowrap> <em>message_age</em>, </td>
6627: </tr>
6628: <tr>
6629: <td></td>
6630: <td></td>
6631: <td class="md" nowrap>u_int16_t </td>
6632: <td class="mdname" nowrap> <em>max_age</em>, </td>
6633: </tr>
6634: <tr>
6635: <td></td>
6636: <td></td>
6637: <td class="md" nowrap>u_int16_t </td>
6638: <td class="mdname" nowrap> <em>hello_time</em>, </td>
6639: </tr>
6640: <tr>
6641: <td></td>
6642: <td></td>
6643: <td class="md" nowrap>u_int16_t </td>
6644: <td class="mdname" nowrap> <em>f_delay</em>, </td>
6645: </tr>
6646: <tr>
6647: <td></td>
6648: <td></td>
6649: <td class="md" nowrap>u_int8_t * </td>
6650: <td class="mdname" nowrap> <em>payload</em>, </td>
6651: </tr>
6652: <tr>
6653: <td></td>
6654: <td></td>
6655: <td class="md" nowrap>u_int32_t </td>
6656: <td class="mdname" nowrap> <em>payload_s</em>, </td>
6657: </tr>
6658: <tr>
6659: <td></td>
6660: <td></td>
6661: <td class="md" nowrap>libnet_t * </td>
6662: <td class="mdname" nowrap> <em>l</em>, </td>
6663: </tr>
6664: <tr>
6665: <td></td>
6666: <td></td>
6667: <td class="md" nowrap>libnet_ptag_t </td>
6668: <td class="mdname" nowrap> <em>ptag</em></td>
6669: </tr>
6670: <tr>
6671: <td></td>
6672: <td class="md">) </td>
6673: <td class="md" colspan="2"></td>
6674: </tr>
6675:
6676: </table>
6677: </td>
6678: </tr>
6679: </table>
6680: <table cellspacing=5 cellpadding=0 border=0>
6681: <tr>
6682: <td>
6683:
6684: </td>
6685: <td>
6686:
6687: <p>
6688: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
6689: <table border="0" cellspacing="2" cellpadding="0">
6690: <tr><td valign=top><em>id</em> </td><td>protocol id </td></tr>
6691: <tr><td valign=top><em>version</em> </td><td>protocol version </td></tr>
6692: <tr><td valign=top><em>bpdu_type</em> </td><td>bridge protocol data unit type </td></tr>
6693: <tr><td valign=top><em>flags</em> </td><td>flags </td></tr>
6694: <tr><td valign=top><em>root_id</em> </td><td>root id </td></tr>
6695: <tr><td valign=top><em>root_pc</em> </td><td>root path cost </td></tr>
6696: <tr><td valign=top><em>bridge_id</em> </td><td>bridge id </td></tr>
6697: <tr><td valign=top><em>port_id</em> </td><td>port id </td></tr>
6698: <tr><td valign=top><em>message_age</em> </td><td>message age </td></tr>
6699: <tr><td valign=top><em>max_age</em> </td><td>max age </td></tr>
6700: <tr><td valign=top><em>hello_time</em> </td><td>hello time </td></tr>
6701: <tr><td valign=top><em>f_delay</em> </td><td>forward delay </td></tr>
6702: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
6703: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
6704: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
6705: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
6706: </table>
6707: </dl>
6708: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
6709: </td>
6710: </tr>
6711: </table>
6712: <a class="anchor" name="a62" doxytag="libnet-functions.h::libnet_build_stp_tcn" ></a><p>
6713: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
6714: <tr>
6715: <td class="mdRow">
6716: <table cellpadding="0" cellspacing="0" border="0">
6717: <tr>
6718: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_stp_tcn </td>
6719: <td class="md" valign="top">( </td>
6720: <td class="md" nowrap valign="top">u_int16_t </td>
6721: <td class="mdname" nowrap> <em>id</em>, </td>
6722: </tr>
6723: <tr>
6724: <td></td>
6725: <td></td>
6726: <td class="md" nowrap>u_int8_t </td>
6727: <td class="mdname" nowrap> <em>version</em>, </td>
6728: </tr>
6729: <tr>
6730: <td></td>
6731: <td></td>
6732: <td class="md" nowrap>u_int8_t </td>
6733: <td class="mdname" nowrap> <em>bpdu_type</em>, </td>
6734: </tr>
6735: <tr>
6736: <td></td>
6737: <td></td>
6738: <td class="md" nowrap>u_int8_t * </td>
6739: <td class="mdname" nowrap> <em>payload</em>, </td>
6740: </tr>
6741: <tr>
6742: <td></td>
6743: <td></td>
6744: <td class="md" nowrap>u_int32_t </td>
6745: <td class="mdname" nowrap> <em>payload_s</em>, </td>
6746: </tr>
6747: <tr>
6748: <td></td>
6749: <td></td>
6750: <td class="md" nowrap>libnet_t * </td>
6751: <td class="mdname" nowrap> <em>l</em>, </td>
6752: </tr>
6753: <tr>
6754: <td></td>
6755: <td></td>
6756: <td class="md" nowrap>libnet_ptag_t </td>
6757: <td class="mdname" nowrap> <em>ptag</em></td>
6758: </tr>
6759: <tr>
6760: <td></td>
6761: <td class="md">) </td>
6762: <td class="md" colspan="2"></td>
6763: </tr>
6764:
6765: </table>
6766: </td>
6767: </tr>
6768: </table>
6769: <table cellspacing=5 cellpadding=0 border=0>
6770: <tr>
6771: <td>
6772:
6773: </td>
6774: <td>
6775:
6776: <p>
6777: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
6778: <table border="0" cellspacing="2" cellpadding="0">
6779: <tr><td valign=top><em>id</em> </td><td>protocol id </td></tr>
6780: <tr><td valign=top><em>version</em> </td><td>protocol version </td></tr>
6781: <tr><td valign=top><em>bpdu_type</em> </td><td>bridge protocol data unit type </td></tr>
6782: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
6783: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
6784: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
6785: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
6786: </table>
6787: </dl>
6788: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
6789: </td>
6790: </tr>
6791: </table>
6792: <a class="anchor" name="a34" doxytag="libnet-functions.h::libnet_build_tcp" ></a><p>
6793: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
6794: <tr>
6795: <td class="mdRow">
6796: <table cellpadding="0" cellspacing="0" border="0">
6797: <tr>
6798: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_tcp </td>
6799: <td class="md" valign="top">( </td>
6800: <td class="md" nowrap valign="top">u_int16_t </td>
6801: <td class="mdname" nowrap> <em>sp</em>, </td>
6802: </tr>
6803: <tr>
6804: <td></td>
6805: <td></td>
6806: <td class="md" nowrap>u_int16_t </td>
6807: <td class="mdname" nowrap> <em>dp</em>, </td>
6808: </tr>
6809: <tr>
6810: <td></td>
6811: <td></td>
6812: <td class="md" nowrap>u_int32_t </td>
6813: <td class="mdname" nowrap> <em>seq</em>, </td>
6814: </tr>
6815: <tr>
6816: <td></td>
6817: <td></td>
6818: <td class="md" nowrap>u_int32_t </td>
6819: <td class="mdname" nowrap> <em>ack</em>, </td>
6820: </tr>
6821: <tr>
6822: <td></td>
6823: <td></td>
6824: <td class="md" nowrap>u_int8_t </td>
6825: <td class="mdname" nowrap> <em>control</em>, </td>
6826: </tr>
6827: <tr>
6828: <td></td>
6829: <td></td>
6830: <td class="md" nowrap>u_int16_t </td>
6831: <td class="mdname" nowrap> <em>win</em>, </td>
6832: </tr>
6833: <tr>
6834: <td></td>
6835: <td></td>
6836: <td class="md" nowrap>u_int16_t </td>
6837: <td class="mdname" nowrap> <em>sum</em>, </td>
6838: </tr>
6839: <tr>
6840: <td></td>
6841: <td></td>
6842: <td class="md" nowrap>u_int16_t </td>
6843: <td class="mdname" nowrap> <em>urg</em>, </td>
6844: </tr>
6845: <tr>
6846: <td></td>
6847: <td></td>
6848: <td class="md" nowrap>u_int16_t </td>
6849: <td class="mdname" nowrap> <em>len</em>, </td>
6850: </tr>
6851: <tr>
6852: <td></td>
6853: <td></td>
6854: <td class="md" nowrap>u_int8_t * </td>
6855: <td class="mdname" nowrap> <em>payload</em>, </td>
6856: </tr>
6857: <tr>
6858: <td></td>
6859: <td></td>
6860: <td class="md" nowrap>u_int32_t </td>
6861: <td class="mdname" nowrap> <em>payload_s</em>, </td>
6862: </tr>
6863: <tr>
6864: <td></td>
6865: <td></td>
6866: <td class="md" nowrap>libnet_t * </td>
6867: <td class="mdname" nowrap> <em>l</em>, </td>
6868: </tr>
6869: <tr>
6870: <td></td>
6871: <td></td>
6872: <td class="md" nowrap>libnet_ptag_t </td>
6873: <td class="mdname" nowrap> <em>ptag</em></td>
6874: </tr>
6875: <tr>
6876: <td></td>
6877: <td class="md">) </td>
6878: <td class="md" colspan="2"></td>
6879: </tr>
6880:
6881: </table>
6882: </td>
6883: </tr>
6884: </table>
6885: <table cellspacing=5 cellpadding=0 border=0>
6886: <tr>
6887: <td>
6888:
6889: </td>
6890: <td>
6891:
6892: <p>
6893: Builds an RFC 793 Transmission Control Protocol (TCP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
6894: <table border="0" cellspacing="2" cellpadding="0">
6895: <tr><td valign=top><em>sp</em> </td><td>source port </td></tr>
6896: <tr><td valign=top><em>dp</em> </td><td>destination port </td></tr>
6897: <tr><td valign=top><em>seq</em> </td><td>sequence number </td></tr>
6898: <tr><td valign=top><em>ack</em> </td><td>acknowledgement number </td></tr>
6899: <tr><td valign=top><em>control</em> </td><td>control flags </td></tr>
6900: <tr><td valign=top><em>win</em> </td><td>window size </td></tr>
6901: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
6902: <tr><td valign=top><em>urg</em> </td><td>urgent pointer len total length of the TCP packet (for checksum calculation) </td></tr>
6903: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
6904: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
6905: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
6906: </table>
6907: </dl>
6908: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
6909: </td>
6910: </tr>
6911: </table>
6912: <a class="anchor" name="a35" doxytag="libnet-functions.h::libnet_build_tcp_options" ></a><p>
6913: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
6914: <tr>
6915: <td class="mdRow">
6916: <table cellpadding="0" cellspacing="0" border="0">
6917: <tr>
6918: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_tcp_options </td>
6919: <td class="md" valign="top">( </td>
6920: <td class="md" nowrap valign="top">u_int8_t * </td>
6921: <td class="mdname" nowrap> <em>options</em>, </td>
6922: </tr>
6923: <tr>
6924: <td></td>
6925: <td></td>
6926: <td class="md" nowrap>u_int32_t </td>
6927: <td class="mdname" nowrap> <em>options_s</em>, </td>
6928: </tr>
6929: <tr>
6930: <td></td>
6931: <td></td>
6932: <td class="md" nowrap>libnet_t * </td>
6933: <td class="mdname" nowrap> <em>l</em>, </td>
6934: </tr>
6935: <tr>
6936: <td></td>
6937: <td></td>
6938: <td class="md" nowrap>libnet_ptag_t </td>
6939: <td class="mdname" nowrap> <em>ptag</em></td>
6940: </tr>
6941: <tr>
6942: <td></td>
6943: <td class="md">) </td>
6944: <td class="md" colspan="2"></td>
6945: </tr>
6946:
6947: </table>
6948: </td>
6949: </tr>
6950: </table>
6951: <table cellspacing=5 cellpadding=0 border=0>
6952: <tr>
6953: <td>
6954:
6955: </td>
6956: <td>
6957:
6958: <p>
6959: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
6960: <table border="0" cellspacing="2" cellpadding="0">
6961: <tr><td valign=top><em>options</em> </td><td>byte string of TCP options </td></tr>
6962: <tr><td valign=top><em>options_s</em> </td><td>length of options string </td></tr>
6963: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
6964: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
6965: </table>
6966: </dl>
6967: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
6968: </td>
6969: </tr>
6970: </table>
6971: <a class="anchor" name="a63" doxytag="libnet-functions.h::libnet_build_token_ring" ></a><p>
6972: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
6973: <tr>
6974: <td class="mdRow">
6975: <table cellpadding="0" cellspacing="0" border="0">
6976: <tr>
6977: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_token_ring </td>
6978: <td class="md" valign="top">( </td>
6979: <td class="md" nowrap valign="top">u_int8_t </td>
6980: <td class="mdname" nowrap> <em>ac</em>, </td>
6981: </tr>
6982: <tr>
6983: <td></td>
6984: <td></td>
6985: <td class="md" nowrap>u_int8_t </td>
6986: <td class="mdname" nowrap> <em>fc</em>, </td>
6987: </tr>
6988: <tr>
6989: <td></td>
6990: <td></td>
6991: <td class="md" nowrap>u_int8_t * </td>
6992: <td class="mdname" nowrap> <em>dst</em>, </td>
6993: </tr>
6994: <tr>
6995: <td></td>
6996: <td></td>
6997: <td class="md" nowrap>u_int8_t * </td>
6998: <td class="mdname" nowrap> <em>src</em>, </td>
6999: </tr>
7000: <tr>
7001: <td></td>
7002: <td></td>
7003: <td class="md" nowrap>u_int8_t </td>
7004: <td class="mdname" nowrap> <em>dsap</em>, </td>
7005: </tr>
7006: <tr>
7007: <td></td>
7008: <td></td>
7009: <td class="md" nowrap>u_int8_t </td>
7010: <td class="mdname" nowrap> <em>ssap</em>, </td>
7011: </tr>
7012: <tr>
7013: <td></td>
7014: <td></td>
7015: <td class="md" nowrap>u_int8_t </td>
7016: <td class="mdname" nowrap> <em>cf</em>, </td>
7017: </tr>
7018: <tr>
7019: <td></td>
7020: <td></td>
7021: <td class="md" nowrap>u_int8_t * </td>
7022: <td class="mdname" nowrap> <em>org</em>, </td>
7023: </tr>
7024: <tr>
7025: <td></td>
7026: <td></td>
7027: <td class="md" nowrap>u_int16_t </td>
7028: <td class="mdname" nowrap> <em>type</em>, </td>
7029: </tr>
7030: <tr>
7031: <td></td>
7032: <td></td>
7033: <td class="md" nowrap>u_int8_t * </td>
7034: <td class="mdname" nowrap> <em>payload</em>, </td>
7035: </tr>
7036: <tr>
7037: <td></td>
7038: <td></td>
7039: <td class="md" nowrap>u_int32_t </td>
7040: <td class="mdname" nowrap> <em>payload_s</em>, </td>
7041: </tr>
7042: <tr>
7043: <td></td>
7044: <td></td>
7045: <td class="md" nowrap>libnet_t * </td>
7046: <td class="mdname" nowrap> <em>l</em>, </td>
7047: </tr>
7048: <tr>
7049: <td></td>
7050: <td></td>
7051: <td class="md" nowrap>libnet_ptag_t </td>
7052: <td class="mdname" nowrap> <em>ptag</em></td>
7053: </tr>
7054: <tr>
7055: <td></td>
7056: <td class="md">) </td>
7057: <td class="md" colspan="2"></td>
7058: </tr>
7059:
7060: </table>
7061: </td>
7062: </tr>
7063: </table>
7064: <table cellspacing=5 cellpadding=0 border=0>
7065: <tr>
7066: <td>
7067:
7068: </td>
7069: <td>
7070:
7071: <p>
7072: Builds a token ring header. <dl compact><dt><b>Parameters:</b></dt><dd>
7073: <table border="0" cellspacing="2" cellpadding="0">
7074: <tr><td valign=top><em>ac</em> </td><td>access control </td></tr>
7075: <tr><td valign=top><em>fc</em> </td><td>frame control </td></tr>
7076: <tr><td valign=top><em>dst</em> </td><td>destination address </td></tr>
7077: <tr><td valign=top><em>src</em> </td><td>source address </td></tr>
7078: <tr><td valign=top><em>dsap</em> </td><td>destination service access point </td></tr>
7079: <tr><td valign=top><em>ssap</em> </td><td>source service access point </td></tr>
7080: <tr><td valign=top><em>cf</em> </td><td>control field </td></tr>
7081: <tr><td valign=top><em>oui</em> </td><td>Organizationally Unique Identifier </td></tr>
7082: <tr><td valign=top><em>type</em> </td><td>upper layer protocol type </td></tr>
7083: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
7084: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
7085: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7086: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
7087: </table>
7088: </dl>
7089: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
7090: </td>
7091: </tr>
7092: </table>
7093: <a class="anchor" name="a36" doxytag="libnet-functions.h::libnet_build_udp" ></a><p>
7094: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7095: <tr>
7096: <td class="mdRow">
7097: <table cellpadding="0" cellspacing="0" border="0">
7098: <tr>
7099: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_udp </td>
7100: <td class="md" valign="top">( </td>
7101: <td class="md" nowrap valign="top">u_int16_t </td>
7102: <td class="mdname" nowrap> <em>sp</em>, </td>
7103: </tr>
7104: <tr>
7105: <td></td>
7106: <td></td>
7107: <td class="md" nowrap>u_int16_t </td>
7108: <td class="mdname" nowrap> <em>dp</em>, </td>
7109: </tr>
7110: <tr>
7111: <td></td>
7112: <td></td>
7113: <td class="md" nowrap>u_int16_t </td>
7114: <td class="mdname" nowrap> <em>len</em>, </td>
7115: </tr>
7116: <tr>
7117: <td></td>
7118: <td></td>
7119: <td class="md" nowrap>u_int16_t </td>
7120: <td class="mdname" nowrap> <em>sum</em>, </td>
7121: </tr>
7122: <tr>
7123: <td></td>
7124: <td></td>
7125: <td class="md" nowrap>u_int8_t * </td>
7126: <td class="mdname" nowrap> <em>payload</em>, </td>
7127: </tr>
7128: <tr>
7129: <td></td>
7130: <td></td>
7131: <td class="md" nowrap>u_int32_t </td>
7132: <td class="mdname" nowrap> <em>payload_s</em>, </td>
7133: </tr>
7134: <tr>
7135: <td></td>
7136: <td></td>
7137: <td class="md" nowrap>libnet_t * </td>
7138: <td class="mdname" nowrap> <em>l</em>, </td>
7139: </tr>
7140: <tr>
7141: <td></td>
7142: <td></td>
7143: <td class="md" nowrap>libnet_ptag_t </td>
7144: <td class="mdname" nowrap> <em>ptag</em></td>
7145: </tr>
7146: <tr>
7147: <td></td>
7148: <td class="md">) </td>
7149: <td class="md" colspan="2"></td>
7150: </tr>
7151:
7152: </table>
7153: </td>
7154: </tr>
7155: </table>
7156: <table cellspacing=5 cellpadding=0 border=0>
7157: <tr>
7158: <td>
7159:
7160: </td>
7161: <td>
7162:
7163: <p>
7164: Builds an RFC 768 User Datagram Protocol (UDP) header. <dl compact><dt><b>Parameters:</b></dt><dd>
7165: <table border="0" cellspacing="2" cellpadding="0">
7166: <tr><td valign=top><em>sp</em> </td><td>source port </td></tr>
7167: <tr><td valign=top><em>dp</em> </td><td>destination port </td></tr>
7168: <tr><td valign=top><em>len</em> </td><td>total length of the UDP packet </td></tr>
7169: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
7170: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
7171: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
7172: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7173: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
7174: </table>
7175: </dl>
7176: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
7177: </td>
7178: </tr>
7179: </table>
7180: <a class="anchor" name="a65" doxytag="libnet-functions.h::libnet_build_vrrp" ></a><p>
7181: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7182: <tr>
7183: <td class="mdRow">
7184: <table cellpadding="0" cellspacing="0" border="0">
7185: <tr>
7186: <td class="md" nowrap valign="top"> libnet_ptag_t libnet_build_vrrp </td>
7187: <td class="md" valign="top">( </td>
7188: <td class="md" nowrap valign="top">u_int8_t </td>
7189: <td class="mdname" nowrap> <em>version</em>, </td>
7190: </tr>
7191: <tr>
7192: <td></td>
7193: <td></td>
7194: <td class="md" nowrap>u_int8_t </td>
7195: <td class="mdname" nowrap> <em>type</em>, </td>
7196: </tr>
7197: <tr>
7198: <td></td>
7199: <td></td>
7200: <td class="md" nowrap>u_int8_t </td>
7201: <td class="mdname" nowrap> <em>vrouter_id</em>, </td>
7202: </tr>
7203: <tr>
7204: <td></td>
7205: <td></td>
7206: <td class="md" nowrap>u_int8_t </td>
7207: <td class="mdname" nowrap> <em>priority</em>, </td>
7208: </tr>
7209: <tr>
7210: <td></td>
7211: <td></td>
7212: <td class="md" nowrap>u_int8_t </td>
7213: <td class="mdname" nowrap> <em>ip_count</em>, </td>
7214: </tr>
7215: <tr>
7216: <td></td>
7217: <td></td>
7218: <td class="md" nowrap>u_int8_t </td>
7219: <td class="mdname" nowrap> <em>auth_type</em>, </td>
7220: </tr>
7221: <tr>
7222: <td></td>
7223: <td></td>
7224: <td class="md" nowrap>u_int8_t </td>
7225: <td class="mdname" nowrap> <em>advert_int</em>, </td>
7226: </tr>
7227: <tr>
7228: <td></td>
7229: <td></td>
7230: <td class="md" nowrap>u_int16_t </td>
7231: <td class="mdname" nowrap> <em>sum</em>, </td>
7232: </tr>
7233: <tr>
7234: <td></td>
7235: <td></td>
7236: <td class="md" nowrap>u_int8_t * </td>
7237: <td class="mdname" nowrap> <em>payload</em>, </td>
7238: </tr>
7239: <tr>
7240: <td></td>
7241: <td></td>
7242: <td class="md" nowrap>u_int32_t </td>
7243: <td class="mdname" nowrap> <em>payload_s</em>, </td>
7244: </tr>
7245: <tr>
7246: <td></td>
7247: <td></td>
7248: <td class="md" nowrap>libnet_t * </td>
7249: <td class="mdname" nowrap> <em>l</em>, </td>
7250: </tr>
7251: <tr>
7252: <td></td>
7253: <td></td>
7254: <td class="md" nowrap>libnet_ptag_t </td>
7255: <td class="mdname" nowrap> <em>ptag</em></td>
7256: </tr>
7257: <tr>
7258: <td></td>
7259: <td class="md">) </td>
7260: <td class="md" colspan="2"></td>
7261: </tr>
7262:
7263: </table>
7264: </td>
7265: </tr>
7266: </table>
7267: <table cellspacing=5 cellpadding=0 border=0>
7268: <tr>
7269: <td>
7270:
7271: </td>
7272: <td>
7273:
7274: <p>
7275: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
7276: <table border="0" cellspacing="2" cellpadding="0">
7277: <tr><td valign=top><em>version</em> </td><td>VRRP version (should be 2) </td></tr>
7278: <tr><td valign=top><em>type</em> </td><td>VRRP packet type (should be 1 -- ADVERTISEMENT) </td></tr>
7279: <tr><td valign=top><em>vrouter_id</em> </td><td>virtual router identification </td></tr>
7280: <tr><td valign=top><em>priority</em> </td><td>priority (higher numbers indicate higher priority) </td></tr>
7281: <tr><td valign=top><em>ip_count</em> </td><td>number of IPv4 addresses contained in this advertisement </td></tr>
7282: <tr><td valign=top><em>auth_type</em> </td><td>type of authentication (0, 1, 2 -- see RFC) </td></tr>
7283: <tr><td valign=top><em>advert_int</em> </td><td>interval between advertisements </td></tr>
7284: <tr><td valign=top><em>sum</em> </td><td>checksum (0 for libnet to autofill) </td></tr>
7285: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
7286: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
7287: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7288: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
7289: </table>
7290: </dl>
7291: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
7292: </td>
7293: </tr>
7294: </table>
7295: <a class="anchor" name="a3" doxytag="libnet-functions.h::libnet_clear_packet" ></a><p>
7296: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7297: <tr>
7298: <td class="mdRow">
7299: <table cellpadding="0" cellspacing="0" border="0">
7300: <tr>
7301: <td class="md" nowrap valign="top"> void libnet_clear_packet </td>
7302: <td class="md" valign="top">( </td>
7303: <td class="md" nowrap valign="top">libnet_t * </td>
7304: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
7305: <td class="md" valign="top"> ) </td>
7306: <td class="md" nowrap></td>
7307: </tr>
7308:
7309: </table>
7310: </td>
7311: </tr>
7312: </table>
7313: <table cellspacing=5 cellpadding=0 border=0>
7314: <tr>
7315: <td>
7316:
7317: </td>
7318: <td>
7319:
7320: <p>
7321: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
7322: <table border="0" cellspacing="2" cellpadding="0">
7323: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7324: </table>
7325: </dl>
7326: </td>
7327: </tr>
7328: </table>
7329: <a class="anchor" name="a102" doxytag="libnet-functions.h::libnet_cq_add" ></a><p>
7330: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7331: <tr>
7332: <td class="mdRow">
7333: <table cellpadding="0" cellspacing="0" border="0">
7334: <tr>
7335: <td class="md" nowrap valign="top"> int libnet_cq_add </td>
7336: <td class="md" valign="top">( </td>
7337: <td class="md" nowrap valign="top">libnet_t * </td>
7338: <td class="mdname" nowrap> <em>l</em>, </td>
7339: </tr>
7340: <tr>
7341: <td></td>
7342: <td></td>
7343: <td class="md" nowrap>char * </td>
7344: <td class="mdname" nowrap> <em>label</em></td>
7345: </tr>
7346: <tr>
7347: <td></td>
7348: <td class="md">) </td>
7349: <td class="md" colspan="2"></td>
7350: </tr>
7351:
7352: </table>
7353: </td>
7354: </tr>
7355: </table>
7356: <table cellspacing=5 cellpadding=0 border=0>
7357: <tr>
7358: <td>
7359:
7360: </td>
7361: <td>
7362:
7363: <p>
7364: [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 <a class="el" href="libnet-functions_8h.html#a1">libnet_init()</a>. If the context queue in write locked, this function will fail. <dl compact><dt><b>Parameters:</b></dt><dd>
7365: <table border="0" cellspacing="2" cellpadding="0">
7366: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7367: <tr><td valign=top><em>label</em> </td><td>a canonical name given to recognize the new context, no longer than LIBNET_LABEL_SIZE </td></tr>
7368: </table>
7369: </dl>
7370: <dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
7371: </td>
7372: </tr>
7373: </table>
7374: <a class="anchor" name="a107" doxytag="libnet-functions.h::libnet_cq_destroy" ></a><p>
7375: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7376: <tr>
7377: <td class="mdRow">
7378: <table cellpadding="0" cellspacing="0" border="0">
7379: <tr>
7380: <td class="md" nowrap valign="top"> void libnet_cq_destroy </td>
7381: <td class="md" valign="top">( </td>
7382: <td class="mdname1" valign="top" nowrap> </td>
7383: <td class="md" valign="top"> ) </td>
7384: <td class="md" nowrap></td>
7385: </tr>
7386:
7387: </table>
7388: </td>
7389: </tr>
7390: </table>
7391: <table cellspacing=5 cellpadding=0 border=0>
7392: <tr>
7393: <td>
7394:
7395: </td>
7396: <td>
7397:
7398: <p>
7399: [Context Queue] Destroys the entire context queue, calling <a class="el" href="libnet-functions_8h.html#a2">libnet_destroy()</a> on each member context. </td>
7400: </tr>
7401: </table>
7402: <a class="anchor" name="a106" doxytag="libnet-functions.h::libnet_cq_find_by_label" ></a><p>
7403: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7404: <tr>
7405: <td class="mdRow">
7406: <table cellpadding="0" cellspacing="0" border="0">
7407: <tr>
7408: <td class="md" nowrap valign="top"> libnet_t* libnet_cq_find_by_label </td>
7409: <td class="md" valign="top">( </td>
7410: <td class="md" nowrap valign="top">char * </td>
7411: <td class="mdname1" valign="top" nowrap> <em>label</em> </td>
7412: <td class="md" valign="top"> ) </td>
7413: <td class="md" nowrap></td>
7414: </tr>
7415:
7416: </table>
7417: </td>
7418: </tr>
7419: </table>
7420: <table cellspacing=5 cellpadding=0 border=0>
7421: <tr>
7422: <td>
7423:
7424: </td>
7425: <td>
7426:
7427: <p>
7428: [Context Queue] Locates a libnet context from the queue, indexed by a canonical label. <dl compact><dt><b>Parameters:</b></dt><dd>
7429: <table border="0" cellspacing="2" cellpadding="0">
7430: <tr><td valign=top><em>label</em> </td><td>canonical label of the libnet context to retrieve </td></tr>
7431: </table>
7432: </dl>
7433: <dl compact><dt><b>Returns:</b></dt><dd>the expected libnet context, NULL on failure </dd></dl>
7434: </td>
7435: </tr>
7436: </table>
7437: <a class="anchor" name="a105" doxytag="libnet-functions.h::libnet_cq_getlabel" ></a><p>
7438: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7439: <tr>
7440: <td class="mdRow">
7441: <table cellpadding="0" cellspacing="0" border="0">
7442: <tr>
7443: <td class="md" nowrap valign="top"> int8_t* libnet_cq_getlabel </td>
7444: <td class="md" valign="top">( </td>
7445: <td class="md" nowrap valign="top">libnet_t * </td>
7446: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
7447: <td class="md" valign="top"> ) </td>
7448: <td class="md" nowrap></td>
7449: </tr>
7450:
7451: </table>
7452: </td>
7453: </tr>
7454: </table>
7455: <table cellspacing=5 cellpadding=0 border=0>
7456: <tr>
7457: <td>
7458:
7459: </td>
7460: <td>
7461:
7462: <p>
7463: [Context Queue] Returns the canonical label associated with the context. <dl compact><dt><b>Parameters:</b></dt><dd>
7464: <table border="0" cellspacing="2" cellpadding="0">
7465: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7466: </table>
7467: </dl>
7468: <dl compact><dt><b>Returns:</b></dt><dd>pointer to the libnet context's label </dd></dl>
7469: </td>
7470: </tr>
7471: </table>
7472: <a class="anchor" name="a108" doxytag="libnet-functions.h::libnet_cq_head" ></a><p>
7473: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7474: <tr>
7475: <td class="mdRow">
7476: <table cellpadding="0" cellspacing="0" border="0">
7477: <tr>
7478: <td class="md" nowrap valign="top"> libnet_t* libnet_cq_head </td>
7479: <td class="md" valign="top">( </td>
7480: <td class="mdname1" valign="top" nowrap> </td>
7481: <td class="md" valign="top"> ) </td>
7482: <td class="md" nowrap></td>
7483: </tr>
7484:
7485: </table>
7486: </td>
7487: </tr>
7488: </table>
7489: <table cellspacing=5 cellpadding=0 border=0>
7490: <tr>
7491: <td>
7492:
7493: </td>
7494: <td>
7495:
7496: <p>
7497: [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:<p>
7498: for (l = <a class="el" href="libnet-functions_8h.html#a108">libnet_cq_head()</a>; <a class="el" href="libnet-functions_8h.html#a109">libnet_cq_last()</a>; l = <a class="el" href="libnet-functions_8h.html#a110">libnet_cq_next()</a>) { ... }<p>
7499: 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, <a class="el" href="libnet-macros_8h.html#a33">for_each_context_in_cq(l)</a>. Warning: do not call the iterator more than once in a single loop. <dl compact><dt><b>Returns:</b></dt><dd>the head of the context queue </dd></dl>
7500: </td>
7501: </tr>
7502: </table>
7503: <a class="anchor" name="a109" doxytag="libnet-functions.h::libnet_cq_last" ></a><p>
7504: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7505: <tr>
7506: <td class="mdRow">
7507: <table cellpadding="0" cellspacing="0" border="0">
7508: <tr>
7509: <td class="md" nowrap valign="top"> int libnet_cq_last </td>
7510: <td class="md" valign="top">( </td>
7511: <td class="mdname1" valign="top" nowrap> </td>
7512: <td class="md" valign="top"> ) </td>
7513: <td class="md" nowrap></td>
7514: </tr>
7515:
7516: </table>
7517: </td>
7518: </tr>
7519: </table>
7520: <table cellspacing=5 cellpadding=0 border=0>
7521: <tr>
7522: <td>
7523:
7524: </td>
7525: <td>
7526:
7527: <p>
7528: [Context Queue] Check whether the iterator is at the last context in the queue. <dl compact><dt><b>Returns:</b></dt><dd>1 if at the end of the context queue, 0 otherwise </dd></dl>
7529: </td>
7530: </tr>
7531: </table>
7532: <a class="anchor" name="a110" doxytag="libnet-functions.h::libnet_cq_next" ></a><p>
7533: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7534: <tr>
7535: <td class="mdRow">
7536: <table cellpadding="0" cellspacing="0" border="0">
7537: <tr>
7538: <td class="md" nowrap valign="top"> libnet_t* libnet_cq_next </td>
7539: <td class="md" valign="top">( </td>
7540: <td class="mdname1" valign="top" nowrap> </td>
7541: <td class="md" valign="top"> ) </td>
7542: <td class="md" nowrap></td>
7543: </tr>
7544:
7545: </table>
7546: </td>
7547: </tr>
7548: </table>
7549: <table cellspacing=5 cellpadding=0 border=0>
7550: <tr>
7551: <td>
7552:
7553: </td>
7554: <td>
7555:
7556: <p>
7557: [Context Queue] Get next context from the context queue. the next context from the context queue </td>
7558: </tr>
7559: </table>
7560: <a class="anchor" name="a103" doxytag="libnet-functions.h::libnet_cq_remove" ></a><p>
7561: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7562: <tr>
7563: <td class="mdRow">
7564: <table cellpadding="0" cellspacing="0" border="0">
7565: <tr>
7566: <td class="md" nowrap valign="top"> libnet_t* libnet_cq_remove </td>
7567: <td class="md" valign="top">( </td>
7568: <td class="md" nowrap valign="top">libnet_t * </td>
7569: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
7570: <td class="md" valign="top"> ) </td>
7571: <td class="md" nowrap></td>
7572: </tr>
7573:
7574: </table>
7575: </td>
7576: </tr>
7577: </table>
7578: <table cellspacing=5 cellpadding=0 border=0>
7579: <tr>
7580: <td>
7581:
7582: </td>
7583: <td>
7584:
7585: <p>
7586: [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 <a class="el" href="libnet-functions_8h.html#a2">libnet_destroy()</a>. 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 <a class="el" href="libnet-functions_8h.html#a104">libnet_cq_remove_by_label()</a>. If the context queue is write locked, this function will fail. <dl compact><dt><b>Parameters:</b></dt><dd>
7587: <table border="0" cellspacing="2" cellpadding="0">
7588: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7589: </table>
7590: </dl>
7591: <dl compact><dt><b>Returns:</b></dt><dd>the pointer to the removed libnet context, NULL on failure </dd></dl>
7592: </td>
7593: </tr>
7594: </table>
7595: <a class="anchor" name="a104" doxytag="libnet-functions.h::libnet_cq_remove_by_label" ></a><p>
7596: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7597: <tr>
7598: <td class="mdRow">
7599: <table cellpadding="0" cellspacing="0" border="0">
7600: <tr>
7601: <td class="md" nowrap valign="top"> libnet_t* libnet_cq_remove_by_label </td>
7602: <td class="md" valign="top">( </td>
7603: <td class="md" nowrap valign="top">char * </td>
7604: <td class="mdname1" valign="top" nowrap> <em>label</em> </td>
7605: <td class="md" valign="top"> ) </td>
7606: <td class="md" nowrap></td>
7607: </tr>
7608:
7609: </table>
7610: </td>
7611: </tr>
7612: </table>
7613: <table cellspacing=5 cellpadding=0 border=0>
7614: <tr>
7615: <td>
7616:
7617: </td>
7618: <td>
7619:
7620: <p>
7621: [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 <a class="el" href="libnet-functions_8h.html#a2">libnet_destroy()</a>. If the context queue is write locked, this function will fail. <dl compact><dt><b>Parameters:</b></dt><dd>
7622: <table border="0" cellspacing="2" cellpadding="0">
7623: <tr><td valign=top><em>label</em> </td><td>canonical name of the context to remove </td></tr>
7624: </table>
7625: </dl>
7626: <dl compact><dt><b>Returns:</b></dt><dd>the pointer to the removed libnet context, NULL on failure </dd></dl>
7627: </td>
7628: </tr>
7629: </table>
7630: <a class="anchor" name="a111" doxytag="libnet-functions.h::libnet_cq_size" ></a><p>
7631: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7632: <tr>
7633: <td class="mdRow">
7634: <table cellpadding="0" cellspacing="0" border="0">
7635: <tr>
7636: <td class="md" nowrap valign="top"> u_int32_t libnet_cq_size </td>
7637: <td class="md" valign="top">( </td>
7638: <td class="mdname1" valign="top" nowrap> </td>
7639: <td class="md" valign="top"> ) </td>
7640: <td class="md" nowrap></td>
7641: </tr>
7642:
7643: </table>
7644: </td>
7645: </tr>
7646: </table>
7647: <table cellspacing=5 cellpadding=0 border=0>
7648: <tr>
7649: <td>
7650:
7651: </td>
7652: <td>
7653:
7654: <p>
7655: [Context Queue] Function returns the number of libnet contexts that are in the queue. <dl compact><dt><b>Returns:</b></dt><dd>the number of libnet contexts currently in the queue </dd></dl>
7656: </td>
7657: </tr>
7658: </table>
7659: <a class="anchor" name="a2" doxytag="libnet-functions.h::libnet_destroy" ></a><p>
7660: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7661: <tr>
7662: <td class="mdRow">
7663: <table cellpadding="0" cellspacing="0" border="0">
7664: <tr>
7665: <td class="md" nowrap valign="top"> void libnet_destroy </td>
7666: <td class="md" valign="top">( </td>
7667: <td class="md" nowrap valign="top">libnet_t * </td>
7668: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
7669: <td class="md" valign="top"> ) </td>
7670: <td class="md" nowrap></td>
7671: </tr>
7672:
7673: </table>
7674: </td>
7675: </tr>
7676: </table>
7677: <table cellspacing=5 cellpadding=0 border=0>
7678: <tr>
7679: <td>
7680:
7681: </td>
7682: <td>
7683:
7684: <p>
7685: Shuts down the libnet session referenced by l. It closes the network interface and frees all internal memory structures associated with l. <dl compact><dt><b>Parameters:</b></dt><dd>
7686: <table border="0" cellspacing="2" cellpadding="0">
7687: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7688: </table>
7689: </dl>
7690: </td>
7691: </tr>
7692: </table>
7693: <a class="anchor" name="a112" doxytag="libnet-functions.h::libnet_diag_dump_context" ></a><p>
7694: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7695: <tr>
7696: <td class="mdRow">
7697: <table cellpadding="0" cellspacing="0" border="0">
7698: <tr>
7699: <td class="md" nowrap valign="top"> void libnet_diag_dump_context </td>
7700: <td class="md" valign="top">( </td>
7701: <td class="md" nowrap valign="top">libnet_t * </td>
7702: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
7703: <td class="md" valign="top"> ) </td>
7704: <td class="md" nowrap></td>
7705: </tr>
7706:
7707: </table>
7708: </td>
7709: </tr>
7710: </table>
7711: <table cellspacing=5 cellpadding=0 border=0>
7712: <tr>
7713: <td>
7714:
7715: </td>
7716: <td>
7717:
7718: <p>
7719: [Diagnostic] Prints the contents of the given context. <dl compact><dt><b>Parameters:</b></dt><dd>
7720: <table border="0" cellspacing="2" cellpadding="0">
7721: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7722: </table>
7723: </dl>
7724: </td>
7725: </tr>
7726: </table>
7727: <a class="anchor" name="a115" doxytag="libnet-functions.h::libnet_diag_dump_hex" ></a><p>
7728: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7729: <tr>
7730: <td class="mdRow">
7731: <table cellpadding="0" cellspacing="0" border="0">
7732: <tr>
7733: <td class="md" nowrap valign="top"> void libnet_diag_dump_hex </td>
7734: <td class="md" valign="top">( </td>
7735: <td class="md" nowrap valign="top">u_int8_t * </td>
7736: <td class="mdname" nowrap> <em>packet</em>, </td>
7737: </tr>
7738: <tr>
7739: <td></td>
7740: <td></td>
7741: <td class="md" nowrap>u_int32_t </td>
7742: <td class="mdname" nowrap> <em>len</em>, </td>
7743: </tr>
7744: <tr>
7745: <td></td>
7746: <td></td>
7747: <td class="md" nowrap>int </td>
7748: <td class="mdname" nowrap> <em>swap</em>, </td>
7749: </tr>
7750: <tr>
7751: <td></td>
7752: <td></td>
7753: <td class="md" nowrap>FILE * </td>
7754: <td class="mdname" nowrap> <em>stream</em></td>
7755: </tr>
7756: <tr>
7757: <td></td>
7758: <td class="md">) </td>
7759: <td class="md" colspan="2"></td>
7760: </tr>
7761:
7762: </table>
7763: </td>
7764: </tr>
7765: </table>
7766: <table cellspacing=5 cellpadding=0 border=0>
7767: <tr>
7768: <td>
7769:
7770: </td>
7771: <td>
7772:
7773: <p>
7774: [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. <dl compact><dt><b>Parameters:</b></dt><dd>
7775: <table border="0" cellspacing="2" cellpadding="0">
7776: <tr><td valign=top><em>packet</em> </td><td>the packet to print </td></tr>
7777: <tr><td valign=top><em>len</em> </td><td>length of the packet in bytes </td></tr>
7778: <tr><td valign=top><em>swap</em> </td><td>1 to swap byte order, 0 to not </td></tr>
7779: <tr><td valign=top><em>stream</em> </td><td>a stream pointer to print to </td></tr>
7780: </table>
7781: </dl>
7782: </td>
7783: </tr>
7784: </table>
7785: <a class="anchor" name="a113" doxytag="libnet-functions.h::libnet_diag_dump_pblock" ></a><p>
7786: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7787: <tr>
7788: <td class="mdRow">
7789: <table cellpadding="0" cellspacing="0" border="0">
7790: <tr>
7791: <td class="md" nowrap valign="top"> void libnet_diag_dump_pblock </td>
7792: <td class="md" valign="top">( </td>
7793: <td class="md" nowrap valign="top">libnet_t * </td>
7794: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
7795: <td class="md" valign="top"> ) </td>
7796: <td class="md" nowrap></td>
7797: </tr>
7798:
7799: </table>
7800: </td>
7801: </tr>
7802: </table>
7803: <table cellspacing=5 cellpadding=0 border=0>
7804: <tr>
7805: <td>
7806:
7807: </td>
7808: <td>
7809:
7810: <p>
7811: [Diagnostic] Prints the contents of every pblock. <dl compact><dt><b>Parameters:</b></dt><dd>
7812: <table border="0" cellspacing="2" cellpadding="0">
7813: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7814: </table>
7815: </dl>
7816: </td>
7817: </tr>
7818: </table>
7819: <a class="anchor" name="a114" doxytag="libnet-functions.h::libnet_diag_dump_pblock_type" ></a><p>
7820: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7821: <tr>
7822: <td class="mdRow">
7823: <table cellpadding="0" cellspacing="0" border="0">
7824: <tr>
7825: <td class="md" nowrap valign="top"> char* libnet_diag_dump_pblock_type </td>
7826: <td class="md" valign="top">( </td>
7827: <td class="md" nowrap valign="top">u_int8_t </td>
7828: <td class="mdname1" valign="top" nowrap> <em>type</em> </td>
7829: <td class="md" valign="top"> ) </td>
7830: <td class="md" nowrap></td>
7831: </tr>
7832:
7833: </table>
7834: </td>
7835: </tr>
7836: </table>
7837: <table cellspacing=5 cellpadding=0 border=0>
7838: <tr>
7839: <td>
7840:
7841: </td>
7842: <td>
7843:
7844: <p>
7845: [Diagnostic] Returns the canonical name of the pblock type. <dl compact><dt><b>Parameters:</b></dt><dd>
7846: <table border="0" cellspacing="2" cellpadding="0">
7847: <tr><td valign=top><em>type</em> </td><td>pblock type </td></tr>
7848: </table>
7849: </dl>
7850: <dl compact><dt><b>Returns:</b></dt><dd>a string representing the pblock type type or "unknown" for an unknown value </dd></dl>
7851: </td>
7852: </tr>
7853: </table>
7854: <a class="anchor" name="a96" doxytag="libnet-functions.h::libnet_get_hwaddr" ></a><p>
7855: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7856: <tr>
7857: <td class="mdRow">
7858: <table cellpadding="0" cellspacing="0" border="0">
7859: <tr>
7860: <td class="md" nowrap valign="top"> struct libnet_ether_addr* libnet_get_hwaddr </td>
7861: <td class="md" valign="top">( </td>
7862: <td class="md" nowrap valign="top">libnet_t * </td>
7863: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
7864: <td class="md" valign="top"> ) </td>
7865: <td class="md" nowrap></td>
7866: </tr>
7867:
7868: </table>
7869: </td>
7870: </tr>
7871: </table>
7872: <table cellspacing=5 cellpadding=0 border=0>
7873: <tr>
7874: <td>
7875:
7876: </td>
7877: <td>
7878:
7879: <p>
7880: 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 <a class="el" href="libnet-functions_8h.html#a9">libnet_geterror()</a> will tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
7881: <table border="0" cellspacing="2" cellpadding="0">
7882: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7883: </table>
7884: </dl>
7885: <dl compact><dt><b>Returns:</b></dt><dd>a pointer to the MAC address or NULL </dd></dl>
7886: </td>
7887: </tr>
7888: </table>
7889: <a class="anchor" name="a94" doxytag="libnet-functions.h::libnet_get_ipaddr4" ></a><p>
7890: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7891: <tr>
7892: <td class="mdRow">
7893: <table cellpadding="0" cellspacing="0" border="0">
7894: <tr>
7895: <td class="md" nowrap valign="top"> u_int32_t libnet_get_ipaddr4 </td>
7896: <td class="md" valign="top">( </td>
7897: <td class="md" nowrap valign="top">libnet_t * </td>
7898: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
7899: <td class="md" valign="top"> ) </td>
7900: <td class="md" nowrap></td>
7901: </tr>
7902:
7903: </table>
7904: </td>
7905: </tr>
7906: </table>
7907: <table cellspacing=5 cellpadding=0 border=0>
7908: <tr>
7909: <td>
7910:
7911: </td>
7912: <td>
7913:
7914: <p>
7915: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
7916: <table border="0" cellspacing="2" cellpadding="0">
7917: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7918: </table>
7919: </dl>
7920: <dl compact><dt><b>Returns:</b></dt><dd>a big endian IP address suitable for use in a libnet_build function or -1 </dd></dl>
7921: </td>
7922: </tr>
7923: </table>
7924: <a class="anchor" name="a95" doxytag="libnet-functions.h::libnet_get_ipaddr6" ></a><p>
7925: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7926: <tr>
7927: <td class="mdRow">
7928: <table cellpadding="0" cellspacing="0" border="0">
7929: <tr>
7930: <td class="md" nowrap valign="top"> struct libnet_in6_addr libnet_get_ipaddr6 </td>
7931: <td class="md" valign="top">( </td>
7932: <td class="md" nowrap valign="top">libnet_t * </td>
7933: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
7934: <td class="md" valign="top"> ) </td>
7935: <td class="md" nowrap></td>
7936: </tr>
7937:
7938: </table>
7939: </td>
7940: </tr>
7941: </table>
7942: <table cellspacing=5 cellpadding=0 border=0>
7943: <tr>
7944: <td>
7945:
7946: </td>
7947: <td>
7948:
7949: <p>
7950: This function is not yet implemented under IPv6. <dl compact><dt><b>Parameters:</b></dt><dd>
7951: <table border="0" cellspacing="2" cellpadding="0">
7952: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
7953: </table>
7954: </dl>
7955: <dl compact><dt><b>Returns:</b></dt><dd>well, nothing yet </dd></dl>
7956: </td>
7957: </tr>
7958: </table>
7959: <a class="anchor" name="a12" doxytag="libnet-functions.h::libnet_get_prand" ></a><p>
7960: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7961: <tr>
7962: <td class="mdRow">
7963: <table cellpadding="0" cellspacing="0" border="0">
7964: <tr>
7965: <td class="md" nowrap valign="top"> u_int32_t libnet_get_prand </td>
7966: <td class="md" valign="top">( </td>
7967: <td class="md" nowrap valign="top">int </td>
7968: <td class="mdname1" valign="top" nowrap> <em>mod</em> </td>
7969: <td class="md" valign="top"> ) </td>
7970: <td class="md" nowrap></td>
7971: </tr>
7972:
7973: </table>
7974: </td>
7975: </tr>
7976: </table>
7977: <table cellspacing=5 cellpadding=0 border=0>
7978: <tr>
7979: <td>
7980:
7981: </td>
7982: <td>
7983:
7984: <p>
7985: 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<p>
7986: <dl compact><dt><b>Parameters:</b></dt><dd>
7987: <table border="0" cellspacing="2" cellpadding="0">
7988: <tr><td valign=top><em>mod</em> </td><td>one the of LIBNET_PR* constants </td></tr>
7989: </table>
7990: </dl>
7991: <dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
7992: </td>
7993: </tr>
7994: </table>
7995: <a class="anchor" name="a6" doxytag="libnet-functions.h::libnet_getdevice" ></a><p>
7996: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
7997: <tr>
7998: <td class="mdRow">
7999: <table cellpadding="0" cellspacing="0" border="0">
8000: <tr>
8001: <td class="md" nowrap valign="top"> int8_t* libnet_getdevice </td>
8002: <td class="md" valign="top">( </td>
8003: <td class="md" nowrap valign="top">libnet_t * </td>
8004: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
8005: <td class="md" valign="top"> ) </td>
8006: <td class="md" nowrap></td>
8007: </tr>
8008:
8009: </table>
8010: </td>
8011: </tr>
8012: </table>
8013: <table cellspacing=5 cellpadding=0 border=0>
8014: <tr>
8015: <td>
8016:
8017: </td>
8018: <td>
8019:
8020: <p>
8021: Returns the canonical name of the device used for packet injection. <dl compact><dt><b>Parameters:</b></dt><dd>
8022: <table border="0" cellspacing="2" cellpadding="0">
8023: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8024: </table>
8025: </dl>
8026: <dl compact><dt><b>Returns:</b></dt><dd>the canonical name of the device used for packet injection. Note it can be NULL without being an error. </dd></dl>
8027: </td>
8028: </tr>
8029: </table>
8030: <a class="anchor" name="a9" doxytag="libnet-functions.h::libnet_geterror" ></a><p>
8031: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8032: <tr>
8033: <td class="mdRow">
8034: <table cellpadding="0" cellspacing="0" border="0">
8035: <tr>
8036: <td class="md" nowrap valign="top"> char* libnet_geterror </td>
8037: <td class="md" valign="top">( </td>
8038: <td class="md" nowrap valign="top">libnet_t * </td>
8039: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
8040: <td class="md" valign="top"> ) </td>
8041: <td class="md" nowrap></td>
8042: </tr>
8043:
8044: </table>
8045: </td>
8046: </tr>
8047: </table>
8048: <table cellspacing=5 cellpadding=0 border=0>
8049: <tr>
8050: <td>
8051:
8052: </td>
8053: <td>
8054:
8055: <p>
8056: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
8057: <table border="0" cellspacing="2" cellpadding="0">
8058: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8059: </table>
8060: </dl>
8061: <dl compact><dt><b>Returns:</b></dt><dd>an error string or NULL if no error has occured </dd></dl>
8062: </td>
8063: </tr>
8064: </table>
8065: <a class="anchor" name="a5" doxytag="libnet-functions.h::libnet_getfd" ></a><p>
8066: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8067: <tr>
8068: <td class="mdRow">
8069: <table cellpadding="0" cellspacing="0" border="0">
8070: <tr>
8071: <td class="md" nowrap valign="top"> int libnet_getfd </td>
8072: <td class="md" valign="top">( </td>
8073: <td class="md" nowrap valign="top">libnet_t * </td>
8074: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
8075: <td class="md" valign="top"> ) </td>
8076: <td class="md" nowrap></td>
8077: </tr>
8078:
8079: </table>
8080: </td>
8081: </tr>
8082: </table>
8083: <table cellspacing=5 cellpadding=0 border=0>
8084: <tr>
8085: <td>
8086:
8087: </td>
8088: <td>
8089:
8090: <p>
8091: Returns the FILENO of the file descriptor used for packet injection. <dl compact><dt><b>Parameters:</b></dt><dd>
8092: <table border="0" cellspacing="2" cellpadding="0">
8093: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8094: </table>
8095: </dl>
8096: <dl compact><dt><b>Returns:</b></dt><dd>the file number of the file descriptor used for packet injection </dd></dl>
8097: </td>
8098: </tr>
8099: </table>
8100: <a class="anchor" name="a81" doxytag="libnet-functions.h::libnet_getgre_length" ></a><p>
8101: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8102: <tr>
8103: <td class="mdRow">
8104: <table cellpadding="0" cellspacing="0" border="0">
8105: <tr>
8106: <td class="md" nowrap valign="top"> u_int32_t libnet_getgre_length </td>
8107: <td class="md" valign="top">( </td>
8108: <td class="md" nowrap valign="top">u_int16_t </td>
8109: <td class="mdname1" valign="top" nowrap> <em>fv</em> </td>
8110: <td class="md" valign="top"> ) </td>
8111: <td class="md" nowrap><code> [inline]</code></td>
8112: </tr>
8113:
8114: </table>
8115: </td>
8116: </tr>
8117: </table>
8118: <table cellspacing=5 cellpadding=0 border=0>
8119: <tr>
8120: <td>
8121:
8122: </td>
8123: <td>
8124:
8125: <p>
8126: <dl compact><dt><b>Parameters:</b></dt><dd>
8127: <table border="0" cellspacing="2" cellpadding="0">
8128: <tr><td valign=top><em>payload</em> </td><td>optional payload or NULL </td></tr>
8129: <tr><td valign=top><em>payload_s</em> </td><td>payload length or 0 </td></tr>
8130: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8131: <tr><td valign=top><em>ptag</em> </td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
8132: </table>
8133: </dl>
8134: <dl compact><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
8135: </td>
8136: </tr>
8137: </table>
8138: <a class="anchor" name="a10" doxytag="libnet-functions.h::libnet_getpacket_size" ></a><p>
8139: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8140: <tr>
8141: <td class="mdRow">
8142: <table cellpadding="0" cellspacing="0" border="0">
8143: <tr>
8144: <td class="md" nowrap valign="top"> u_int32_t libnet_getpacket_size </td>
8145: <td class="md" valign="top">( </td>
8146: <td class="md" nowrap valign="top">libnet_t * </td>
8147: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
8148: <td class="md" valign="top"> ) </td>
8149: <td class="md" nowrap></td>
8150: </tr>
8151:
8152: </table>
8153: </td>
8154: </tr>
8155: </table>
8156: <table cellspacing=5 cellpadding=0 border=0>
8157: <tr>
8158: <td>
8159:
8160: </td>
8161: <td>
8162:
8163: <p>
8164: Returns the sum of the size of all of the pblocks inside of l (this should be the resuling packet size). <dl compact><dt><b>Parameters:</b></dt><dd>
8165: <table border="0" cellspacing="2" cellpadding="0">
8166: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8167: </table>
8168: </dl>
8169: <dl compact><dt><b>Returns:</b></dt><dd>the size of the packet in l </dd></dl>
8170: </td>
8171: </tr>
8172: </table>
8173: <a class="anchor" name="a7" doxytag="libnet-functions.h::libnet_getpbuf" ></a><p>
8174: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8175: <tr>
8176: <td class="mdRow">
8177: <table cellpadding="0" cellspacing="0" border="0">
8178: <tr>
8179: <td class="md" nowrap valign="top"> u_int8_t* libnet_getpbuf </td>
8180: <td class="md" valign="top">( </td>
8181: <td class="md" nowrap valign="top">libnet_t * </td>
8182: <td class="mdname" nowrap> <em>l</em>, </td>
8183: </tr>
8184: <tr>
8185: <td></td>
8186: <td></td>
8187: <td class="md" nowrap>libnet_ptag_t </td>
8188: <td class="mdname" nowrap> <em>ptag</em></td>
8189: </tr>
8190: <tr>
8191: <td></td>
8192: <td class="md">) </td>
8193: <td class="md" colspan="2"></td>
8194: </tr>
8195:
8196: </table>
8197: </td>
8198: </tr>
8199: </table>
8200: <table cellspacing=5 cellpadding=0 border=0>
8201: <tr>
8202: <td>
8203:
8204: </td>
8205: <td>
8206:
8207: <p>
8208: Returns the pblock buffer contents for the specified ptag; a subsequent call to <a class="el" href="libnet-functions_8h.html#a8">libnet_getpbuf_size()</a> should be made to determine the size of the buffer. <dl compact><dt><b>Parameters:</b></dt><dd>
8209: <table border="0" cellspacing="2" cellpadding="0">
8210: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8211: <tr><td valign=top><em>ptag</em> </td><td>the ptag reference number </td></tr>
8212: </table>
8213: </dl>
8214: <dl compact><dt><b>Returns:</b></dt><dd>a pointer to the pblock buffer or NULL on error </dd></dl>
8215: </td>
8216: </tr>
8217: </table>
8218: <a class="anchor" name="a8" doxytag="libnet-functions.h::libnet_getpbuf_size" ></a><p>
8219: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8220: <tr>
8221: <td class="mdRow">
8222: <table cellpadding="0" cellspacing="0" border="0">
8223: <tr>
8224: <td class="md" nowrap valign="top"> u_int32_t libnet_getpbuf_size </td>
8225: <td class="md" valign="top">( </td>
8226: <td class="md" nowrap valign="top">libnet_t * </td>
8227: <td class="mdname" nowrap> <em>l</em>, </td>
8228: </tr>
8229: <tr>
8230: <td></td>
8231: <td></td>
8232: <td class="md" nowrap>libnet_ptag_t </td>
8233: <td class="mdname" nowrap> <em>ptag</em></td>
8234: </tr>
8235: <tr>
8236: <td></td>
8237: <td class="md">) </td>
8238: <td class="md" colspan="2"></td>
8239: </tr>
8240:
8241: </table>
8242: </td>
8243: </tr>
8244: </table>
8245: <table cellspacing=5 cellpadding=0 border=0>
8246: <tr>
8247: <td>
8248:
8249: </td>
8250: <td>
8251:
8252: <p>
8253: Returns the pblock buffer size for the specified ptag; a previous call to <a class="el" href="libnet-functions_8h.html#a7">libnet_getpbuf()</a> should be made to pull the actual buffer contents. <dl compact><dt><b>Parameters:</b></dt><dd>
8254: <table border="0" cellspacing="2" cellpadding="0">
8255: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8256: <tr><td valign=top><em>ptag</em> </td><td>the ptag reference number </td></tr>
8257: </table>
8258: </dl>
8259: <dl compact><dt><b>Returns:</b></dt><dd>the size of the pblock buffer </dd></dl>
8260: </td>
8261: </tr>
8262: </table>
8263: <a class="anchor" name="a97" doxytag="libnet-functions.h::libnet_hex_aton" ></a><p>
8264: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8265: <tr>
8266: <td class="mdRow">
8267: <table cellpadding="0" cellspacing="0" border="0">
8268: <tr>
8269: <td class="md" nowrap valign="top"> u_int8_t* libnet_hex_aton </td>
8270: <td class="md" valign="top">( </td>
8271: <td class="md" nowrap valign="top">int8_t * </td>
8272: <td class="mdname" nowrap> <em>s</em>, </td>
8273: </tr>
8274: <tr>
8275: <td></td>
8276: <td></td>
8277: <td class="md" nowrap>int * </td>
8278: <td class="mdname" nowrap> <em>len</em></td>
8279: </tr>
8280: <tr>
8281: <td></td>
8282: <td class="md">) </td>
8283: <td class="md" colspan="2"></td>
8284: </tr>
8285:
8286: </table>
8287: </td>
8288: </tr>
8289: </table>
8290: <table cellspacing=5 cellpadding=0 border=0>
8291: <tr>
8292: <td>
8293:
8294: </td>
8295: <td>
8296:
8297: <p>
8298: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
8299: <table border="0" cellspacing="2" cellpadding="0">
8300: <tr><td valign=top><em>s</em> </td><td>the string to be parsed </td></tr>
8301: <tr><td valign=top><em>len</em> </td><td>the resulting size of the returned byte string </td></tr>
8302: </table>
8303: </dl>
8304: <dl compact><dt><b>Returns:</b></dt><dd>a byte string or NULL on failure </dd></dl>
8305: </td>
8306: </tr>
8307: </table>
8308: <a class="anchor" name="a1" doxytag="libnet-functions.h::libnet_init" ></a><p>
8309: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8310: <tr>
8311: <td class="mdRow">
8312: <table cellpadding="0" cellspacing="0" border="0">
8313: <tr>
8314: <td class="md" nowrap valign="top"> libnet_t* libnet_init </td>
8315: <td class="md" valign="top">( </td>
8316: <td class="md" nowrap valign="top">int </td>
8317: <td class="mdname" nowrap> <em>injection_type</em>, </td>
8318: </tr>
8319: <tr>
8320: <td></td>
8321: <td></td>
8322: <td class="md" nowrap>char * </td>
8323: <td class="mdname" nowrap> <em>device</em>, </td>
8324: </tr>
8325: <tr>
8326: <td></td>
8327: <td></td>
8328: <td class="md" nowrap>char * </td>
8329: <td class="mdname" nowrap> <em>err_buf</em></td>
8330: </tr>
8331: <tr>
8332: <td></td>
8333: <td class="md">) </td>
8334: <td class="md" colspan="2"></td>
8335: </tr>
8336:
8337: </table>
8338: </td>
8339: </tr>
8340: </table>
8341: <table cellspacing=5 cellpadding=0 border=0>
8342: <tr>
8343: <td>
8344:
8345: </td>
8346: <td>
8347:
8348: <p>
8349: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
8350: <table border="0" cellspacing="2" cellpadding="0">
8351: <tr><td valign=top><em>injection_type</em> </td><td>packet injection type (LIBNET_LINK, LIBNET_LINK_ADV, LIBNET_RAW4, LIBNET_RAW4_ADV, LIBNET_RAW6, LIBNET_RAW6_ADV) </td></tr>
8352: <tr><td valign=top><em>device</em> </td><td>the interface to use (NULL and libnet will choose one) </td></tr>
8353: <tr><td valign=top><em>err_buf</em> </td><td>will contain an error message on failure </td></tr>
8354: </table>
8355: </dl>
8356: <dl compact><dt><b>Returns:</b></dt><dd>libnet context ready for use or NULL on error. </dd></dl>
8357: </td>
8358: </tr>
8359: </table>
8360: <a class="anchor" name="a15" doxytag="libnet-functions.h::libnet_name2addr4" ></a><p>
8361: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8362: <tr>
8363: <td class="mdRow">
8364: <table cellpadding="0" cellspacing="0" border="0">
8365: <tr>
8366: <td class="md" nowrap valign="top"> u_int32_t libnet_name2addr4 </td>
8367: <td class="md" valign="top">( </td>
8368: <td class="md" nowrap valign="top">libnet_t * </td>
8369: <td class="mdname" nowrap> <em>l</em>, </td>
8370: </tr>
8371: <tr>
8372: <td></td>
8373: <td></td>
8374: <td class="md" nowrap>char * </td>
8375: <td class="mdname" nowrap> <em>host_name</em>, </td>
8376: </tr>
8377: <tr>
8378: <td></td>
8379: <td></td>
8380: <td class="md" nowrap>u_int8_t </td>
8381: <td class="mdname" nowrap> <em>use_name</em></td>
8382: </tr>
8383: <tr>
8384: <td></td>
8385: <td class="md">) </td>
8386: <td class="md" colspan="2"></td>
8387: </tr>
8388:
8389: </table>
8390: </td>
8391: </tr>
8392: </table>
8393: <table cellspacing=5 cellpadding=0 border=0>
8394: <tr>
8395: <td>
8396:
8397: </td>
8398: <td>
8399:
8400: <p>
8401: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
8402: <table border="0" cellspacing="2" cellpadding="0">
8403: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8404: <tr><td valign=top><em>host_name</em> </td><td>pointer to a string containing a presentation format host name </td></tr>
8405: <tr><td valign=top><em>use_name</em> </td><td>LIBNET_RESOLVE or LIBNET_DONT_RESOLVE </td></tr>
8406: </table>
8407: </dl>
8408: <dl compact><dt><b>Returns:</b></dt><dd>network byte ordered IPv4 address or -1 (2^32 - 1) on error </dd></dl>
8409: </td>
8410: </tr>
8411: </table>
8412: <a class="anchor" name="a16" doxytag="libnet-functions.h::libnet_name2addr6" ></a><p>
8413: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8414: <tr>
8415: <td class="mdRow">
8416: <table cellpadding="0" cellspacing="0" border="0">
8417: <tr>
8418: <td class="md" nowrap valign="top"> struct libnet_in6_addr libnet_name2addr6 </td>
8419: <td class="md" valign="top">( </td>
8420: <td class="md" nowrap valign="top">libnet_t * </td>
8421: <td class="mdname" nowrap> <em>l</em>, </td>
8422: </tr>
8423: <tr>
8424: <td></td>
8425: <td></td>
8426: <td class="md" nowrap>char * </td>
8427: <td class="mdname" nowrap> <em>host_name</em>, </td>
8428: </tr>
8429: <tr>
8430: <td></td>
8431: <td></td>
8432: <td class="md" nowrap>u_int8_t </td>
8433: <td class="mdname" nowrap> <em>use_name</em></td>
8434: </tr>
8435: <tr>
8436: <td></td>
8437: <td class="md">) </td>
8438: <td class="md" colspan="2"></td>
8439: </tr>
8440:
8441: </table>
8442: </td>
8443: </tr>
8444: </table>
8445: <table cellspacing=5 cellpadding=0 border=0>
8446: <tr>
8447: <td>
8448:
8449: </td>
8450: <td>
8451:
8452: <p>
8453: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
8454: <table border="0" cellspacing="2" cellpadding="0">
8455: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8456: <tr><td valign=top><em>host_name</em> </td><td>pointer to a string containing a presentation format host name </td></tr>
8457: <tr><td valign=top><em>use_name</em> </td><td>LIBNET_RESOLVE or LIBNET_DONT_RESOLVE </td></tr>
8458: </table>
8459: </dl>
8460: <dl compact><dt><b>Returns:</b></dt><dd>network byte ordered IPv6 address structure </dd></dl>
8461: </td>
8462: </tr>
8463: </table>
8464: <a class="anchor" name="a20" doxytag="libnet-functions.h::libnet_plist_chain_dump" ></a><p>
8465: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8466: <tr>
8467: <td class="mdRow">
8468: <table cellpadding="0" cellspacing="0" border="0">
8469: <tr>
8470: <td class="md" nowrap valign="top"> int libnet_plist_chain_dump </td>
8471: <td class="md" valign="top">( </td>
8472: <td class="md" nowrap valign="top">libnet_plist_t * </td>
8473: <td class="mdname1" valign="top" nowrap> <em>plist</em> </td>
8474: <td class="md" valign="top"> ) </td>
8475: <td class="md" nowrap></td>
8476: </tr>
8477:
8478: </table>
8479: </td>
8480: </tr>
8481: </table>
8482: <table cellspacing=5 cellpadding=0 border=0>
8483: <tr>
8484: <td>
8485:
8486: </td>
8487: <td>
8488:
8489: <p>
8490: Runs through the port list and prints the contents of the port list chain list to stdout. <dl compact><dt><b>Parameters:</b></dt><dd>
8491: <table border="0" cellspacing="2" cellpadding="0">
8492: <tr><td valign=top><em>plist</em> </td><td>previously created portlist </td></tr>
8493: </table>
8494: </dl>
8495: <dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
8496: </td>
8497: </tr>
8498: </table>
8499: <a class="anchor" name="a21" doxytag="libnet-functions.h::libnet_plist_chain_dump_string" ></a><p>
8500: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8501: <tr>
8502: <td class="mdRow">
8503: <table cellpadding="0" cellspacing="0" border="0">
8504: <tr>
8505: <td class="md" nowrap valign="top"> char* libnet_plist_chain_dump_string </td>
8506: <td class="md" valign="top">( </td>
8507: <td class="md" nowrap valign="top">libnet_plist_t * </td>
8508: <td class="mdname1" valign="top" nowrap> <em>plist</em> </td>
8509: <td class="md" valign="top"> ) </td>
8510: <td class="md" nowrap></td>
8511: </tr>
8512:
8513: </table>
8514: </td>
8515: </tr>
8516: </table>
8517: <table cellspacing=5 cellpadding=0 border=0>
8518: <tr>
8519: <td>
8520:
8521: </td>
8522: <td>
8523:
8524: <p>
8525: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
8526: <table border="0" cellspacing="2" cellpadding="0">
8527: <tr><td valign=top><em>plist</em> </td><td>previously created portlist </td></tr>
8528: </table>
8529: </dl>
8530: <dl compact><dt><b>Returns:</b></dt><dd>a printable string containing the port list contents on success NULL on error </dd></dl>
8531: </td>
8532: </tr>
8533: </table>
8534: <a class="anchor" name="a22" doxytag="libnet-functions.h::libnet_plist_chain_free" ></a><p>
8535: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8536: <tr>
8537: <td class="mdRow">
8538: <table cellpadding="0" cellspacing="0" border="0">
8539: <tr>
8540: <td class="md" nowrap valign="top"> int libnet_plist_chain_free </td>
8541: <td class="md" valign="top">( </td>
8542: <td class="md" nowrap valign="top">libnet_plist_t * </td>
8543: <td class="mdname1" valign="top" nowrap> <em>plist</em> </td>
8544: <td class="md" valign="top"> ) </td>
8545: <td class="md" nowrap></td>
8546: </tr>
8547:
8548: </table>
8549: </td>
8550: </tr>
8551: </table>
8552: <table cellspacing=5 cellpadding=0 border=0>
8553: <tr>
8554: <td>
8555:
8556: </td>
8557: <td>
8558:
8559: <p>
8560: Frees all memory associated with port list chain. <dl compact><dt><b>Parameters:</b></dt><dd>
8561: <table border="0" cellspacing="2" cellpadding="0">
8562: <tr><td valign=top><em>plist</em> </td><td>previously created portlist </td></tr>
8563: </table>
8564: </dl>
8565: <dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
8566: </td>
8567: </tr>
8568: </table>
8569: <a class="anchor" name="a18" doxytag="libnet-functions.h::libnet_plist_chain_new" ></a><p>
8570: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8571: <tr>
8572: <td class="mdRow">
8573: <table cellpadding="0" cellspacing="0" border="0">
8574: <tr>
8575: <td class="md" nowrap valign="top"> int libnet_plist_chain_new </td>
8576: <td class="md" valign="top">( </td>
8577: <td class="md" nowrap valign="top">libnet_t * </td>
8578: <td class="mdname" nowrap> <em>l</em>, </td>
8579: </tr>
8580: <tr>
8581: <td></td>
8582: <td></td>
8583: <td class="md" nowrap>libnet_plist_t ** </td>
8584: <td class="mdname" nowrap> <em>plist</em>, </td>
8585: </tr>
8586: <tr>
8587: <td></td>
8588: <td></td>
8589: <td class="md" nowrap>char * </td>
8590: <td class="mdname" nowrap> <em>token_list</em></td>
8591: </tr>
8592: <tr>
8593: <td></td>
8594: <td class="md">) </td>
8595: <td class="md" colspan="2"></td>
8596: </tr>
8597:
8598: </table>
8599: </td>
8600: </tr>
8601: </table>
8602: <table cellspacing=5 cellpadding=0 border=0>
8603: <tr>
8604: <td>
8605:
8606: </td>
8607: <td>
8608:
8609: <p>
8610: 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 <a class="el" href="libnet-functions_8h.html#a9">libnet_geterror()</a> can tell you why. <dl compact><dt><b>Parameters:</b></dt><dd>
8611: <table border="0" cellspacing="2" cellpadding="0">
8612: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8613: <tr><td valign=top><em>plist</em> </td><td>if successful, will refer to the portlist, if not, NULL </td></tr>
8614: <tr><td valign=top><em>token_list</em> </td><td>string containing the port list primitive </td></tr>
8615: </table>
8616: </dl>
8617: <dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
8618: </td>
8619: </tr>
8620: </table>
8621: <a class="anchor" name="a19" doxytag="libnet-functions.h::libnet_plist_chain_next_pair" ></a><p>
8622: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8623: <tr>
8624: <td class="mdRow">
8625: <table cellpadding="0" cellspacing="0" border="0">
8626: <tr>
8627: <td class="md" nowrap valign="top"> int libnet_plist_chain_next_pair </td>
8628: <td class="md" valign="top">( </td>
8629: <td class="md" nowrap valign="top">libnet_plist_t * </td>
8630: <td class="mdname" nowrap> <em>plist</em>, </td>
8631: </tr>
8632: <tr>
8633: <td></td>
8634: <td></td>
8635: <td class="md" nowrap>u_int16_t * </td>
8636: <td class="mdname" nowrap> <em>bport</em>, </td>
8637: </tr>
8638: <tr>
8639: <td></td>
8640: <td></td>
8641: <td class="md" nowrap>u_int16_t * </td>
8642: <td class="mdname" nowrap> <em>eport</em></td>
8643: </tr>
8644: <tr>
8645: <td></td>
8646: <td class="md">) </td>
8647: <td class="md" colspan="2"></td>
8648: </tr>
8649:
8650: </table>
8651: </td>
8652: </tr>
8653: </table>
8654: <table cellspacing=5 cellpadding=0 border=0>
8655: <tr>
8656: <td>
8657:
8658: </td>
8659: <td>
8660:
8661: <p>
8662: 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. <dl compact><dt><b>Parameters:</b></dt><dd>
8663: <table border="0" cellspacing="2" cellpadding="0">
8664: <tr><td valign=top><em>plist</em> </td><td>previously created portlist </td></tr>
8665: <tr><td valign=top><em>bport</em> </td><td>will contain the beginning port number or 0 </td></tr>
8666: <tr><td valign=top><em>eport</em> </td><td>will contain the ending port number or 0 </td></tr>
8667: </table>
8668: </dl>
8669: <dl compact><dt><b>Returns:</b></dt><dd>1 on success, 0 if empty, -1 on failure </dd></dl>
8670: </td>
8671: </tr>
8672: </table>
8673: <a class="anchor" name="a11" doxytag="libnet-functions.h::libnet_seed_prand" ></a><p>
8674: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8675: <tr>
8676: <td class="mdRow">
8677: <table cellpadding="0" cellspacing="0" border="0">
8678: <tr>
8679: <td class="md" nowrap valign="top"> int libnet_seed_prand </td>
8680: <td class="md" valign="top">( </td>
8681: <td class="md" nowrap valign="top">libnet_t * </td>
8682: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
8683: <td class="md" valign="top"> ) </td>
8684: <td class="md" nowrap></td>
8685: </tr>
8686:
8687: </table>
8688: </td>
8689: </tr>
8690: </table>
8691: <table cellspacing=5 cellpadding=0 border=0>
8692: <tr>
8693: <td>
8694:
8695: </td>
8696: <td>
8697:
8698: <p>
8699: Seeds the psuedo-random number generator. <dl compact><dt><b>Parameters:</b></dt><dd>
8700: <table border="0" cellspacing="2" cellpadding="0">
8701: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8702: </table>
8703: </dl>
8704: <dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
8705: </td>
8706: </tr>
8707: </table>
8708: <a class="anchor" name="a4" doxytag="libnet-functions.h::libnet_stats" ></a><p>
8709: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8710: <tr>
8711: <td class="mdRow">
8712: <table cellpadding="0" cellspacing="0" border="0">
8713: <tr>
8714: <td class="md" nowrap valign="top"> void libnet_stats </td>
8715: <td class="md" valign="top">( </td>
8716: <td class="md" nowrap valign="top">libnet_t * </td>
8717: <td class="mdname" nowrap> <em>l</em>, </td>
8718: </tr>
8719: <tr>
8720: <td></td>
8721: <td></td>
8722: <td class="md" nowrap>struct libnet_stats * </td>
8723: <td class="mdname" nowrap> <em>ls</em></td>
8724: </tr>
8725: <tr>
8726: <td></td>
8727: <td class="md">) </td>
8728: <td class="md" colspan="2"></td>
8729: </tr>
8730:
8731: </table>
8732: </td>
8733: </tr>
8734: </table>
8735: <table cellspacing=5 cellpadding=0 border=0>
8736: <tr>
8737: <td>
8738:
8739: </td>
8740: <td>
8741:
8742: <p>
8743: Fills in a libnet_stats structure with packet injection statistics (packets written, bytes written, packet sending errors). <dl compact><dt><b>Parameters:</b></dt><dd>
8744: <table border="0" cellspacing="2" cellpadding="0">
8745: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8746: <tr><td valign=top><em>ls</em> </td><td>pointer to a libnet statistics structure </td></tr>
8747: </table>
8748: </dl>
8749: </td>
8750: </tr>
8751: </table>
8752: <a class="anchor" name="a13" doxytag="libnet-functions.h::libnet_toggle_checksum" ></a><p>
8753: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8754: <tr>
8755: <td class="mdRow">
8756: <table cellpadding="0" cellspacing="0" border="0">
8757: <tr>
8758: <td class="md" nowrap valign="top"> int libnet_toggle_checksum </td>
8759: <td class="md" valign="top">( </td>
8760: <td class="md" nowrap valign="top">libnet_t * </td>
8761: <td class="mdname" nowrap> <em>l</em>, </td>
8762: </tr>
8763: <tr>
8764: <td></td>
8765: <td></td>
8766: <td class="md" nowrap>libnet_ptag_t </td>
8767: <td class="mdname" nowrap> <em>ptag</em>, </td>
8768: </tr>
8769: <tr>
8770: <td></td>
8771: <td></td>
8772: <td class="md" nowrap>int </td>
8773: <td class="mdname" nowrap> <em>mode</em></td>
8774: </tr>
8775: <tr>
8776: <td></td>
8777: <td class="md">) </td>
8778: <td class="md" colspan="2"></td>
8779: </tr>
8780:
8781: </table>
8782: </td>
8783: </tr>
8784: </table>
8785: <table cellspacing=5 cellpadding=0 border=0>
8786: <tr>
8787: <td>
8788:
8789: </td>
8790: <td>
8791:
8792: <p>
8793: 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 <a class="el" href="libnet-functions_8h.html#a13">libnet_toggle_checksum()</a>. 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. <dl compact><dt><b>Parameters:</b></dt><dd>
8794: <table border="0" cellspacing="2" cellpadding="0">
8795: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8796: <tr><td valign=top><em>ptag</em> </td><td>the ptag reference number </td></tr>
8797: <tr><td valign=top><em>mode</em> </td><td>LIBNET_ON or LIBNET_OFF </td></tr>
8798: </table>
8799: </dl>
8800: <dl compact><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
8801: </td>
8802: </tr>
8803: </table>
8804: <a class="anchor" name="a93" doxytag="libnet-functions.h::libnet_write" ></a><p>
8805: <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
8806: <tr>
8807: <td class="mdRow">
8808: <table cellpadding="0" cellspacing="0" border="0">
8809: <tr>
8810: <td class="md" nowrap valign="top"> int libnet_write </td>
8811: <td class="md" valign="top">( </td>
8812: <td class="md" nowrap valign="top">libnet_t * </td>
8813: <td class="mdname1" valign="top" nowrap> <em>l</em> </td>
8814: <td class="md" valign="top"> ) </td>
8815: <td class="md" nowrap></td>
8816: </tr>
8817:
8818: </table>
8819: </td>
8820: </tr>
8821: </table>
8822: <table cellspacing=5 cellpadding=0 border=0>
8823: <tr>
8824: <td>
8825:
8826: </td>
8827: <td>
8828:
8829: <p>
8830: Writes a prebuilt packet to the network. The function assumes that l was previously initialized (via a call to <a class="el" href="libnet-functions_8h.html#a1">libnet_init()</a>) 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 <a class="el" href="libnet-functions_8h.html#a4">libnet_stats()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
8831: <table border="0" cellspacing="2" cellpadding="0">
8832: <tr><td valign=top><em>l</em> </td><td>pointer to a libnet context </td></tr>
8833: </table>
8834: </dl>
8835: <dl compact><dt><b>Returns:</b></dt><dd>the number of bytes written, -1 on error </dd></dl>
8836: </td>
8837: </tr>
8838: </table>
8839: <hr size="1"><address style="align: right;"><small>Generated on Wed Mar 10 13:23:38 2004 for libnet by
8840: <a href="http://www.doxygen.org/index.html">
8841: <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
8842: </a>1.3.4 </small></address>
8843: </body>
8844: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>