Annotation of embedaddon/libnet/doc/html/libnet-functions_8h.html, revision 1.1.1.2
1.1.1.2 ! misho 1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
! 2: <html xmlns="http://www.w3.org/1999/xhtml">
! 3: <head>
! 4: <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
1.1 misho 5: <title>libnet: libnet-functions.h File Reference</title>
1.1.1.2 ! misho 6: <link href="tabs.css" rel="stylesheet" type="text/css"/>
! 7: <link href="doxygen.css" rel="stylesheet" type="text/css"/>
! 8: </head>
! 9: <body>
! 10: <!-- Generated by Doxygen 1.7.4 -->
! 11: <div id="top">
! 12: <div id="titlearea">
! 13: <table cellspacing="0" cellpadding="0">
! 14: <tbody>
! 15: <tr style="height: 56px;">
! 16: <td style="padding-left: 0.5em;">
! 17: <div id="projectname">libnet <span id="projectnumber">1.1</span></div>
! 18: </td>
! 19: </tr>
! 20: </tbody>
! 21: </table>
! 22: </div>
! 23: <div id="navrow1" class="tabs">
! 24: <ul class="tablist">
! 25: <li><a href="index.html"><span>Main Page</span></a></li>
! 26: <li class="current"><a href="files.html"><span>Files</span></a></li>
! 27: </ul>
! 28: </div>
! 29: <div id="navrow2" class="tabs2">
! 30: <ul class="tablist">
! 31: <li><a href="files.html"><span>File List</span></a></li>
! 32: <li><a href="globals.html"><span>Globals</span></a></li>
! 33: </ul>
! 34: </div>
! 35: </div>
! 36: <div class="header">
! 37: <div class="summary">
! 38: <a href="#func-members">Functions</a> |
! 39: <a href="#var-members">Variables</a> </div>
! 40: <div class="headertitle">
! 41: <div class="title">libnet-functions.h File Reference</div> </div>
! 42: </div>
! 43: <div class="contents">
1.1 misho 44:
1.1.1.2 ! misho 45: <p>libnet exported function prototypes
! 46: <a href="#details">More...</a></p>
1.1 misho 47:
1.1.1.2 ! misho 48: <p><a href="libnet-functions_8h_source.html">Go to the source code of this file.</a></p>
! 49: <table class="memberdecls">
! 50: <tr><td colspan="2"><h2><a name="func-members"></a>
! 51: Functions</h2></td></tr>
! 52: <tr><td class="memItemLeft" align="right" valign="top">libnet_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a0422723053baf0b254d1ba2215d88118">libnet_init</a> (int injection_type, const char *device, char *err_buf)</td></tr>
! 53: <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a591804711cffa92582703a5aedbd9b25">libnet_destroy</a> (libnet_t *l)</td></tr>
! 54: <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ab84889f7fe57a1801cf03eceac47463e">libnet_clear_packet</a> (libnet_t *l)</td></tr>
! 55: <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a886dc359d6add4b0608e8611af7e1b35">libnet_stats</a> (libnet_t *l, struct libnet_stats *ls)</td></tr>
! 56: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ab9b137f454b3da05d4ac5fe388c1f2b8">libnet_getfd</a> (libnet_t *l)</td></tr>
! 57: <tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a1e68365ece2c976a75bc50e91df40ea0">libnet_getdevice</a> (libnet_t *l)</td></tr>
! 58: <tr><td class="memItemLeft" align="right" valign="top">uint8_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a37ac07877d74f4dad59b86a15f5318d8">libnet_getpbuf</a> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 59: <tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a23ada8f4ab826966aeaf4ab070f3298e">libnet_getpbuf_size</a> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 60: <tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a36c0b24a4926a8f5d9d392836e915f2e">libnet_geterror</a> (libnet_t *l)</td></tr>
! 61: <tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a2a500c6b60a329d873a970ecda4ff6e9">libnet_getpacket_size</a> (libnet_t *l)</td></tr>
! 62: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a69470998be995ec8c5e11ecbb19137f5">libnet_seed_prand</a> (libnet_t *l)</td></tr>
! 63: <tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ab74bd339ef6343077dc79bab2063aee3">libnet_get_prand</a> (int mod)</td></tr>
! 64: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ad36144707ce7994c12ef9d87dc9a2edf">libnet_toggle_checksum</a> (libnet_t *l, libnet_ptag_t ptag, int mode)</td></tr>
! 65: <tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#af6b11f82cfc7982bd0b21a6d4a857d1a">libnet_addr2name4</a> (uint32_t in, uint8_t use_name)</td></tr>
! 66: <tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a05a7f3f901c57be5aebfbd8b79416de9">libnet_name2addr4</a> (libnet_t *l, char *host_name, uint8_t use_name)</td></tr>
! 67: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a917ef012eab1449bba7a0fd33438b292">libnet_in6_is_error</a> (struct libnet_in6_addr addr)</td></tr>
! 68: <tr><td class="memItemLeft" align="right" valign="top">struct libnet_in6_addr </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a69a216eb71e3309c787bd00507148d15">libnet_name2addr6</a> (libnet_t *l, const char *host_name, uint8_t use_name)</td></tr>
! 69: <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a5b7581c7b75c7ecd3e4220c72752efd4">libnet_addr2name6_r</a> (struct libnet_in6_addr addr, uint8_t use_name, char *host_name, int host_name_len)</td></tr>
! 70: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#aaee8e5f54482bf3c9b7c5b101fa8f41f">libnet_plist_chain_new</a> (libnet_t *l, libnet_plist_t **plist, char *token_list)</td></tr>
! 71: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#aa4f1d2acd6b7411d3bf2be73cb617cb2">libnet_plist_chain_next_pair</a> (libnet_plist_t *plist, uint16_t *bport, uint16_t *eport)</td></tr>
! 72: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a39e332daa771627372a01867818b4301">libnet_plist_chain_dump</a> (libnet_plist_t *plist)</td></tr>
! 73: <tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ab854695d1306f9af440145fc6767d953">libnet_plist_chain_dump_string</a> (libnet_plist_t *plist)</td></tr>
! 74: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ab5cb1d70164207a7c279a909576058be">libnet_plist_chain_free</a> (libnet_plist_t *plist)</td></tr>
! 75: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a0fdc98930697ff63e2938efd4082cc16">libnet_build_802_1q</a> (const uint8_t *dst, const uint8_t *src, uint16_t tpi, uint8_t priority, uint8_t cfi, uint16_t vlan_id, uint16_t len_proto, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 76: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a9c6bae7032a3e32b70f9480f9a30a1ad">libnet_build_802_1x</a> (uint8_t eap_ver, uint8_t eap_type, uint16_t length, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 77: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a83c65a0bc641803572115f9f290f39fa">libnet_build_802_2</a> (uint8_t dsap, uint8_t ssap, uint8_t control, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 78: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a0780d8317f3bd7a5e4a2ed10abdbe39b">libnet_build_802_2snap</a> (uint8_t dsap, uint8_t ssap, uint8_t control, uint8_t *oui, uint16_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 79: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a5a200d8b8b3b2a64921db960e8b0da60">libnet_build_802_3</a> (const uint8_t *dst, const uint8_t *src, uint16_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 80: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ac0e53234dfc5205142b0f53c69ab46ae">libnet_build_ethernet</a> (const uint8_t *dst, const uint8_t *src, uint16_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 81: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#acd0747f212c04efd2a4dcb947a3db40b">libnet_autobuild_ethernet</a> (const uint8_t *dst, uint16_t type, libnet_t *l)</td></tr>
! 82: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#af313dd4a88c8bb42f023637aec5d7abf">libnet_build_fddi</a> (uint8_t fc, const uint8_t *dst, const uint8_t *src, uint8_t dsap, uint8_t ssap, uint8_t cf, const uint8_t *oui, uint16_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 83: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a071f9dc69d6992e2c164ed3827f79cc1">libnet_autobuild_fddi</a> (uint8_t fc, const uint8_t *dst, uint8_t dsap, uint8_t ssap, uint8_t cf, const uint8_t *oui, uint16_t type, libnet_t *l)</td></tr>
! 84: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ac81464e42636bc0b9e4800bcf135da57">libnet_build_arp</a> (uint16_t hrd, uint16_t pro, uint8_t hln, uint8_t pln, uint16_t op, const uint8_t *sha, const uint8_t *spa, const uint8_t *tha, const uint8_t *tpa, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 85: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a11bb29bc300b46b1a59009b9e66b6dee">libnet_autobuild_arp</a> (uint16_t op, const uint8_t *sha, const uint8_t *spa, const uint8_t *tha, uint8_t *tpa, libnet_t *l)</td></tr>
! 86: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a729cfdedc3e59a3152c99c914d66ec6f">libnet_build_tcp</a> (uint16_t sp, uint16_t dp, uint32_t seq, uint32_t ack, uint8_t control, uint16_t win, uint16_t sum, uint16_t urg, uint16_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 87: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a11d0bd23cb198f3e940336b62a94839a">libnet_build_tcp_options</a> (const uint8_t *options, uint32_t options_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 88: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a1dee17aa5276df3587ee276b1b90d8fa">libnet_build_udp</a> (uint16_t sp, uint16_t dp, uint16_t len, uint16_t sum, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 89: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a0549535c9d15498e169bc5b96bc9c946">libnet_build_cdp</a> (uint8_t version, uint8_t ttl, uint16_t sum, uint16_t type, uint16_t value_s, const uint8_t *value, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 90: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#af2a31d44e931c774bfc50a8a8d0a71af">libnet_build_icmpv4_echo</a> (uint8_t type, uint8_t code, uint16_t sum, uint16_t id, uint16_t seq, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 91: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a6cff4ee3328d18a02de3ffa467b4a783">libnet_build_icmpv4_mask</a> (uint8_t type, uint8_t code, uint16_t sum, uint16_t id, uint16_t seq, uint32_t mask, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 92: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#aeb4d9c27fe201737ba139dde6c5c0f2e">libnet_build_icmpv4_unreach</a> (uint8_t type, uint8_t code, uint16_t sum, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 93: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a80e6e045aa6e2b249294112171129b28">libnet_build_icmpv4_redirect</a> (uint8_t type, uint8_t code, uint16_t sum, uint32_t gateway, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 94: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a9f4204ece5d336ef11e777c2d5e50186">libnet_build_icmpv4_timeexceed</a> (uint8_t type, uint8_t code, uint16_t sum, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 95: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a68d0c6a2b394b15e9064e404842a1989">libnet_build_icmpv4_timestamp</a> (uint8_t type, uint8_t code, uint16_t sum, uint16_t id, uint16_t seq, uint32_t otime, uint32_t rtime, uint32_t ttime, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 96: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ab25c002229189641d723847c6fd06f5a">libnet_build_icmpv6_echo</a> (uint8_t type, uint8_t code, uint16_t sum, uint16_t id, uint16_t seq, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 97: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a4e46b8ea4becc7fe4d10fc1af6a5aefa">libnet_build_icmpv6_unreach</a> (uint8_t type, uint8_t code, uint16_t sum, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 98: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a806d7200cc479b065f7a26d1057b4fcd">libnet_build_icmpv6_ndp_nsol</a> (uint8_t type, uint8_t code, uint16_t sum, struct libnet_in6_addr target, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 99: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a8351efc0261c66660b362e16a68f9001">libnet_build_icmpv6_ndp_nadv</a> (uint8_t type, uint8_t code, uint16_t sum, uint32_t flags, struct libnet_in6_addr target, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 100: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a0ac427a5e4fe8281724fd17619c0db12">libnet_build_icmpv6_ndp_opt</a> (uint8_t type, uint8_t *option, uint32_t option_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 101: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a66590b72b65d46bf15544327235edc66">libnet_build_igmp</a> (uint8_t type, uint8_t reserved, uint16_t sum, uint32_t ip, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 102: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a326cf29f24a37dc9232b8b6a56a3f12f">libnet_build_ipv4</a> (uint16_t ip_len, uint8_t tos, uint16_t id, uint16_t frag, uint8_t ttl, uint8_t prot, uint16_t sum, uint32_t src, uint32_t dst, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 103: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#af1e1c66ed14370114d61ca919d558092">libnet_build_ipv4_options</a> (const uint8_t *options, uint32_t options_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 104: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a17d44748537af9d97cbafe9c1040c7d3">libnet_autobuild_ipv4</a> (uint16_t len, uint8_t prot, uint32_t dst, libnet_t *l)</td></tr>
! 105: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ae568214e9b386ca23e6628431eda1f7e">libnet_build_ipv6</a> (uint8_t tc, uint32_t fl, uint16_t len, uint8_t nh, uint8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 106: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a16867e9f92b162ff4c00a5587fd3377d">libnet_build_ipv6_frag</a> (uint8_t nh, uint8_t reserved, uint16_t frag, uint32_t id, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 107: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a0aeda945e0b6d1ce4bee591107d8887b">libnet_build_ipv6_routing</a> (uint8_t nh, uint8_t len, uint8_t rtype, uint8_t segments, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 108: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a463971e2d708f4e14f2ed9bea7f197be">libnet_build_ipv6_destopts</a> (uint8_t nh, uint8_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 109: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#accbcb7a6342997afd1a5410c7006f748">libnet_build_ipv6_hbhopts</a> (uint8_t nh, uint8_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 110: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a9af33cad0a1f688907c675fb577514dd">libnet_autobuild_ipv6</a> (uint16_t len, uint8_t nh, struct libnet_in6_addr dst, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 111: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a8c3b2833b869c4628240bb5be8b7c864">libnet_build_isl</a> (uint8_t *dhost, uint8_t type, uint8_t user, uint8_t *shost, uint16_t len, const uint8_t *snap, uint16_t vid, uint16_t portindex, uint16_t reserved, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 112: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ad75f92207cb45587e18e898b344c7600">libnet_build_ipsec_esp_hdr</a> (uint32_t spi, uint32_t seq, uint32_t iv, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 113: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a277c0db9a61ea2d24b58b452df0edda0">libnet_build_ipsec_esp_ftr</a> (uint8_t len, uint8_t nh, int8_t *auth, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 114: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a9506a46bfe340f8284ae58656a02c574">libnet_build_ipsec_ah</a> (uint8_t nh, uint8_t len, uint16_t res, uint32_t spi, uint32_t seq, uint32_t auth, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 115: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a5b4d53861194f34da21ca87bcc158517">libnet_build_dnsv4</a> (uint16_t h_len, uint16_t id, uint16_t flags, uint16_t num_q, uint16_t num_anws_rr, uint16_t num_auth_rr, uint16_t num_addi_rr, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 116: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ad8e0469edf11477ccc3fc0b9cb031d00">libnet_build_rip</a> (uint8_t cmd, uint8_t version, uint16_t rd, uint16_t af, uint16_t rt, uint32_t addr, uint32_t mask, uint32_t next_hop, uint32_t metric, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 117: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a7bc36e79f132c1b7ff449e9df2a459b7">libnet_build_rpc_call</a> (uint32_t rm, uint32_t xid, uint32_t prog_num, uint32_t prog_vers, uint32_t procedure, uint32_t cflavor, uint32_t clength, uint8_t *cdata, uint32_t vflavor, uint32_t vlength, const uint8_t *vdata, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 118: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a5051a29044af5ac103f6604ef8d480e5">libnet_build_stp_conf</a> (uint16_t id, uint8_t version, uint8_t bpdu_type, uint8_t flags, const uint8_t *root_id, uint32_t root_pc, const uint8_t *bridge_id, uint16_t port_id, uint16_t message_age, uint16_t max_age, uint16_t hello_time, uint16_t f_delay, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 119: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a20cda717c9254f73230b95f9eb808bc1">libnet_build_stp_tcn</a> (uint16_t id, uint8_t version, uint8_t bpdu_type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 120: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#aed08f26e3bc9afd750a3b515a8d83526">libnet_build_token_ring</a> (uint8_t ac, uint8_t fc, const uint8_t *dst, const uint8_t *src, uint8_t dsap, uint8_t ssap, uint8_t cf, const uint8_t *oui, uint16_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 121: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a4280cf3a4ffdff6d11c11dcd5f69f0d7">libnet_autobuild_token_ring</a> (uint8_t ac, uint8_t fc, const uint8_t *dst, uint8_t dsap, uint8_t ssap, uint8_t cf, const uint8_t *oui, uint16_t type, libnet_t *l)</td></tr>
! 122: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a687daca40884d1125c4115ce215060f6">libnet_build_vrrp</a> (uint8_t version, uint8_t type, uint8_t vrouter_id, uint8_t priority, uint8_t ip_count, uint8_t auth_type, uint8_t advert_int, uint16_t sum, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 123: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ada1854f38dd301252fc97c93084ac4eb">libnet_build_mpls</a> (uint32_t label, uint8_t experimental, uint8_t bos, uint8_t ttl, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 124: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a8a13581c5722c0ee77c2486465c10275">libnet_build_ntp</a> (uint8_t leap_indicator, uint8_t version, uint8_t mode, uint8_t stratum, uint8_t poll, uint8_t precision, uint16_t delay_int, uint16_t delay_frac, uint16_t dispersion_int, uint16_t dispersion_frac, uint32_t reference_id, uint32_t ref_ts_int, uint32_t ref_ts_frac, uint32_t orig_ts_int, uint32_t orig_ts_frac, uint32_t rec_ts_int, uint32_t rec_ts_frac, uint32_t xmt_ts_int, uint32_t xmt_ts_frac, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 125: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a215924e3d5c0cbcc4479579e45e60b58">libnet_build_ospfv2</a> (uint16_t len, uint8_t type, uint32_t rtr_id, uint32_t area_id, uint16_t sum, uint16_t autype, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 126: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#aff42a70a3b00a91d14200798d10889f2">libnet_build_ospfv2_hello</a> (uint32_t netmask, uint16_t interval, uint8_t opts, uint8_t priority, uint dead_int, uint32_t des_rtr, uint32_t bkup_rtr, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 127: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a08a78bd747a22581c5ab036b73ca8867">libnet_build_ospfv2_dbd</a> (uint16_t dgram_len, uint8_t opts, uint8_t type, uint seqnum, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 128: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a1cfa7596a2f85b2b7226d81fa47e7d39">libnet_build_ospfv2_lsr</a> (uint type, uint lsid, uint32_t advrtr, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 129: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a65617e2355459bc9ec2db6b979bee9d4">libnet_build_ospfv2_lsu</a> (uint num, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 130: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a611d140c425ab18996909be01e02f1c6">libnet_build_ospfv2_lsa</a> (uint16_t age, uint8_t opts, uint8_t type, uint lsid, uint32_t advrtr, uint seqnum, uint16_t sum, uint16_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 131: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ad85342b88f62015f11c85e5b387af465">libnet_build_ospfv2_lsa_rtr</a> (uint16_t flags, uint16_t num, uint id, uint data, uint8_t type, uint8_t tos, uint16_t metric, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 132: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a0e067929f1e1dfe92062603c6ba12e71">libnet_build_ospfv2_lsa_net</a> (uint32_t nmask, uint rtrid, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 133: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#af3a2ccf97bfd42d3e4760ebf10d71fa5">libnet_build_ospfv2_lsa_sum</a> (uint32_t nmask, uint metric, uint tos, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 134: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ab1a6927f757475cd9734772cc93779a7">libnet_build_ospfv2_lsa_as</a> (uint32_t nmask, uint metric, uint32_t fwdaddr, uint tag, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 135: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a6b46a684b738fde7b4012e55eff31b73">libnet_build_data</a> (const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 136: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a399fd399a3cbb884ca3cd9dc7a22509f">libnet_build_dhcpv4</a> (uint8_t opcode, uint8_t htype, uint8_t hlen, uint8_t hopcount, uint32_t xid, uint16_t secs, uint16_t flags, uint32_t cip, uint32_t yip, uint32_t sip, uint32_t gip, const uint8_t *chaddr, const char *sname, const char *file, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 137: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#aeb5caf6fd933b6e909f427405fa99f96">libnet_build_bootpv4</a> (uint8_t opcode, uint8_t htype, uint8_t hlen, uint8_t hopcount, uint32_t xid, uint16_t secs, uint16_t flags, uint32_t cip, uint32_t yip, uint32_t sip, uint32_t gip, const uint8_t *chaddr, const char *sname, const char *file, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 138: <tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a223c01dcaba5f098964342ef2737fd85">libnet_getgre_length</a> (uint16_t fv)</td></tr>
! 139: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a8406f0a8d836df764bedd849ce24a14c">libnet_build_gre</a> (uint16_t fv, uint16_t type, uint16_t sum, uint16_t offset, uint32_t key, uint32_t seq, uint16_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 140: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#aa62e7006bab99d1528571bba42118350">libnet_build_egre</a> (uint16_t fv, uint16_t type, uint16_t sum, uint16_t offset, uint32_t key, uint32_t seq, uint16_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 141: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#abf78669b728f6ec879a38bc9fcf7e4d4">libnet_build_gre_sre</a> (uint16_t af, uint8_t offset, uint8_t length, uint8_t *routing, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 142: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a578594ad820ae9d82fe3f9ea470f0b27">libnet_build_gre_last_sre</a> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 143: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a9ba6e1d6e95256e67f4a8765bacb901d">libnet_build_bgp4_header</a> (uint8_t marker[LIBNET_BGP4_MARKER_SIZE], uint16_t len, uint8_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 144: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a99eadbed880ccc2cd3334fa4e32ca193">libnet_build_bgp4_open</a> (uint8_t version, uint16_t src_as, uint16_t hold_time, uint32_t bgp_id, uint8_t opt_len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 145: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ad2111145ddb5222d70025f568ab22b75">libnet_build_bgp4_update</a> (uint16_t unfeasible_rt_len, const uint8_t *withdrawn_rt, uint16_t total_path_attr_len, const uint8_t *path_attributes, uint16_t info_len, uint8_t *reachability_info, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 146: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a8bbc446c78e7201faf61e8e732919527">libnet_build_bgp4_notification</a> (uint8_t err_code, uint8_t err_subcode, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 147: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a9a182529f97b05e9a2a5bd120f2f8456">libnet_build_sebek</a> (uint32_t magic, uint16_t version, uint16_t type, uint32_t counter, uint32_t time_sec, uint32_t time_usec, uint32_t pid, uint32_t uid, uint32_t fd, uint8_t cmd[SEBEK_CMD_LENGTH], uint32_t length, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 148: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a673f627bdc332ec131135d58a1e44a9d">libnet_build_hsrp</a> (uint8_t version, uint8_t opcode, uint8_t state, uint8_t hello_time, uint8_t hold_time, uint8_t priority, uint8_t group, uint8_t reserved, uint8_t authdata[HSRP_AUTHDATA_LENGTH], uint32_t virtual_ip, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 149: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a76a5b279a29e54057b1fb3e3786ce32f">libnet_build_link</a> (const uint8_t *dst, const uint8_t *src, const uint8_t *oui, uint16_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 150: <tr><td class="memItemLeft" align="right" valign="top">libnet_ptag_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a84b5f1f2c40e2411e5792dcfc152c988">libnet_autobuild_link</a> (const uint8_t *dst, const uint8_t *oui, uint16_t type, libnet_t *l)</td></tr>
! 151: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a53375552efe95906e152152fc170cc0d">libnet_write</a> (libnet_t *l)</td></tr>
! 152: <tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ae1981c8f0923176ecf484e9cd07fea15">libnet_get_ipaddr4</a> (libnet_t *l)</td></tr>
! 153: <tr><td class="memItemLeft" align="right" valign="top">struct libnet_in6_addr </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a3d7de8968c2087df7a22140d7993e267">libnet_get_ipaddr6</a> (libnet_t *l)</td></tr>
! 154: <tr><td class="memItemLeft" align="right" valign="top">struct libnet_ether_addr * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a6531e479687de8d195bd1605422735ca">libnet_get_hwaddr</a> (libnet_t *l)</td></tr>
! 155: <tr><td class="memItemLeft" align="right" valign="top">uint8_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a0b668af5fd10b0a2879a9a0ea343dce4">libnet_hex_aton</a> (const char *s, int *len)</td></tr>
! 156: <tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a5264b060183d307688780bf862fae37c">libnet_version</a> (void)</td></tr>
! 157: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a42d0af11102be3209e3f207072946906">libnet_adv_cull_packet</a> (libnet_t *l, uint8_t **packet, uint32_t *packet_s)</td></tr>
! 158: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a5297581f7aec5f42abede6bd45cd46e9">libnet_adv_cull_header</a> (libnet_t *l, libnet_ptag_t ptag, uint8_t **header, uint32_t *header_s)</td></tr>
! 159: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a760ea88b395ac3baad0111d569132ae7">libnet_adv_write_link</a> (libnet_t *l, const uint8_t *packet, uint32_t packet_s)</td></tr>
! 160: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ae339adcfdccf212acf3f27538d22c1c5">libnet_adv_write_raw_ipv4</a> (libnet_t *l, const uint8_t *packet, uint32_t packet_s)</td></tr>
! 161: <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a1309b57e3571306d9bad13ae93600644">libnet_adv_free_packet</a> (libnet_t *l, uint8_t *packet)</td></tr>
! 162: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a20887ffe940f1d2c5bcae79a188176c6">libnet_cq_add</a> (libnet_t *l, char *label)</td></tr>
! 163: <tr><td class="memItemLeft" align="right" valign="top">libnet_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a29f60504a0fe9b7bf6f5a962063118bb">libnet_cq_remove</a> (libnet_t *l)</td></tr>
! 164: <tr><td class="memItemLeft" align="right" valign="top">libnet_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a4e972664a0d839eab039f8fb2379987a">libnet_cq_remove_by_label</a> (char *label)</td></tr>
! 165: <tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#abb1341d217de4d9c39ec484951e518b0">libnet_cq_getlabel</a> (libnet_t *l)</td></tr>
! 166: <tr><td class="memItemLeft" align="right" valign="top">libnet_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a0cd216f0e5563ee06043a8ebfa16fe57">libnet_cq_find_by_label</a> (char *label)</td></tr>
! 167: <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a565d99e292980d5033bef2d186596217">libnet_cq_destroy</a> (void)</td></tr>
! 168: <tr><td class="memItemLeft" align="right" valign="top">libnet_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a7e98a045ac6e29ca421507d9a200b5aa">libnet_cq_head</a> (void)</td></tr>
! 169: <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#aab1eb1e3ae64cde579a5a6035d5406c8">libnet_cq_last</a> (void)</td></tr>
! 170: <tr><td class="memItemLeft" align="right" valign="top">libnet_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ad312f3182e3e5367db87fc6bab32604d">libnet_cq_next</a> (void)</td></tr>
! 171: <tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#ad26ce874f56c59091f4811a7816400a8">libnet_cq_size</a> (void)</td></tr>
! 172: <tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a127764f17e4457f96fb4b976a1666efa">libnet_cq_end_loop</a> (void)</td></tr>
! 173: <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a3aa6623246e13310dc6f9f9834e7313b">libnet_diag_dump_context</a> (libnet_t *l)</td></tr>
! 174: <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a9825c6c69efd6ef24545d59177a333e6">libnet_diag_dump_pblock</a> (libnet_t *l)</td></tr>
! 175: <tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#a57fed7106abf515c5883611eded7ad88">libnet_diag_dump_pblock_type</a> (uint8_t type)</td></tr>
! 176: <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="libnet-functions_8h.html#adb2f7d417f05a058c0c2c7f76b6f66e6">libnet_diag_dump_hex</a> (const uint8_t *packet, uint32_t len, int swap, FILE *stream)</td></tr>
! 177: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2bd28c9064ea0a30e4b6a3f16b0cb1e0"></a><!-- doxytag: member="libnet-functions.h::libnet_write_raw_ipv4" ref="a2bd28c9064ea0a30e4b6a3f16b0cb1e0" args="(libnet_t *l, const uint8_t *packet, uint32_t size)" -->
! 178: int </td><td class="memItemRight" valign="bottom"><b>libnet_write_raw_ipv4</b> (libnet_t *l, const uint8_t *packet, uint32_t size)</td></tr>
! 179: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a129520392b83e646abcbf1565b7c3bad"></a><!-- doxytag: member="libnet-functions.h::libnet_write_raw_ipv6" ref="a129520392b83e646abcbf1565b7c3bad" args="(libnet_t *l, const uint8_t *packet, uint32_t size)" -->
! 180: int </td><td class="memItemRight" valign="bottom"><b>libnet_write_raw_ipv6</b> (libnet_t *l, const uint8_t *packet, uint32_t size)</td></tr>
! 181: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6e89e062ac91f948ac39186dff255835"></a><!-- doxytag: member="libnet-functions.h::libnet_write_link" ref="a6e89e062ac91f948ac39186dff255835" args="(libnet_t *l, const uint8_t *packet, uint32_t size)" -->
! 182: int </td><td class="memItemRight" valign="bottom"><b>libnet_write_link</b> (libnet_t *l, const uint8_t *packet, uint32_t size)</td></tr>
! 183: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9c939bfce1e95e6c4000543e4747bd25"></a><!-- doxytag: member="libnet-functions.h::libnet_open_raw4" ref="a9c939bfce1e95e6c4000543e4747bd25" args="(libnet_t *l)" -->
! 184: int </td><td class="memItemRight" valign="bottom"><b>libnet_open_raw4</b> (libnet_t *l)</td></tr>
! 185: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a637b6c3d06ba0c7bb81641f95d9b9817"></a><!-- doxytag: member="libnet-functions.h::libnet_close_raw4" ref="a637b6c3d06ba0c7bb81641f95d9b9817" args="(libnet_t *l)" -->
! 186: int </td><td class="memItemRight" valign="bottom"><b>libnet_close_raw4</b> (libnet_t *l)</td></tr>
! 187: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acfa541f84cd8b66fbfe88684920621dc"></a><!-- doxytag: member="libnet-functions.h::libnet_open_raw6" ref="acfa541f84cd8b66fbfe88684920621dc" args="(libnet_t *l)" -->
! 188: int </td><td class="memItemRight" valign="bottom"><b>libnet_open_raw6</b> (libnet_t *l)</td></tr>
! 189: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac26f71561c5a3069cb17681d02de15d2"></a><!-- doxytag: member="libnet-functions.h::libnet_close_raw6" ref="ac26f71561c5a3069cb17681d02de15d2" args="(libnet_t *l)" -->
! 190: int </td><td class="memItemRight" valign="bottom"><b>libnet_close_raw6</b> (libnet_t *l)</td></tr>
! 191: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a848cce024af46ad0b283ae962379ee5c"></a><!-- doxytag: member="libnet-functions.h::libnet_select_device" ref="a848cce024af46ad0b283ae962379ee5c" args="(libnet_t *l)" -->
! 192: int </td><td class="memItemRight" valign="bottom"><b>libnet_select_device</b> (libnet_t *l)</td></tr>
! 193: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad924dd4bcaaa9d9f1638232d69ab1b3c"></a><!-- doxytag: member="libnet-functions.h::libnet_open_link" ref="ad924dd4bcaaa9d9f1638232d69ab1b3c" args="(libnet_t *l)" -->
! 194: int </td><td class="memItemRight" valign="bottom"><b>libnet_open_link</b> (libnet_t *l)</td></tr>
! 195: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a14ba6b1f8e79d6c1e8d0d398aa2300a4"></a><!-- doxytag: member="libnet-functions.h::libnet_close_link" ref="a14ba6b1f8e79d6c1e8d0d398aa2300a4" args="(libnet_t *l)" -->
! 196: int </td><td class="memItemRight" valign="bottom"><b>libnet_close_link</b> (libnet_t *l)</td></tr>
! 197: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a823e9f64deecb0609a0028cd64d8de82"></a><!-- doxytag: member="libnet-functions.h::libnet_do_checksum" ref="a823e9f64deecb0609a0028cd64d8de82" args="(libnet_t *l, uint8_t *iphdr, int protocol, int h_len)" -->
! 198: int </td><td class="memItemRight" valign="bottom"><b>libnet_do_checksum</b> (libnet_t *l, uint8_t *iphdr, int protocol, int h_len)</td></tr>
! 199: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a837d23cfa79d859665d4d2765283ce6c"></a><!-- doxytag: member="libnet-functions.h::libnet_inet_checksum" ref="a837d23cfa79d859665d4d2765283ce6c" args="(libnet_t *l, uint8_t *iphdr, int protocol, int h_len, const uint8_t *beg, const uint8_t *end)" -->
! 200: int </td><td class="memItemRight" valign="bottom"><b>libnet_inet_checksum</b> (libnet_t *l, uint8_t *iphdr, int protocol, int h_len, const uint8_t *beg, const uint8_t *end)</td></tr>
! 201: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad00eb3c5589f3175d87dd5b4e24650e2"></a><!-- doxytag: member="libnet-functions.h::libnet_compute_crc" ref="ad00eb3c5589f3175d87dd5b4e24650e2" args="(uint8_t *buf, uint32_t len)" -->
! 202: uint32_t </td><td class="memItemRight" valign="bottom"><b>libnet_compute_crc</b> (uint8_t *buf, uint32_t len)</td></tr>
! 203: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a786e2c4fbb323bd79fea01135a21d384"></a><!-- doxytag: member="libnet-functions.h::libnet_ip_check" ref="a786e2c4fbb323bd79fea01135a21d384" args="(uint16_t *addr, int len)" -->
! 204: uint16_t </td><td class="memItemRight" valign="bottom"><b>libnet_ip_check</b> (uint16_t *addr, int len)</td></tr>
! 205: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8083a6f5694d6d2be7b2cde19a8ee41c"></a><!-- doxytag: member="libnet-functions.h::libnet_in_cksum" ref="a8083a6f5694d6d2be7b2cde19a8ee41c" args="(uint16_t *addr, int len)" -->
! 206: int </td><td class="memItemRight" valign="bottom"><b>libnet_in_cksum</b> (uint16_t *addr, int len)</td></tr>
! 207: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afbb0b9424f2106f2f1cc64739421aa21"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_probe" ref="afbb0b9424f2106f2f1cc64739421aa21" args="(libnet_t *l, libnet_ptag_t ptag, uint32_t b_len, uint8_t type)" -->
! 208: libnet_pblock_t * </td><td class="memItemRight" valign="bottom"><b>libnet_pblock_probe</b> (libnet_t *l, libnet_ptag_t ptag, uint32_t b_len, uint8_t type)</td></tr>
! 209: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3866e7a53060f1bc02a35022589ce374"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_new" ref="a3866e7a53060f1bc02a35022589ce374" args="(libnet_t *l, uint32_t b_len)" -->
! 210: libnet_pblock_t * </td><td class="memItemRight" valign="bottom"><b>libnet_pblock_new</b> (libnet_t *l, uint32_t b_len)</td></tr>
! 211: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad74cffce51462163ec68af50573148a8"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_swap" ref="ad74cffce51462163ec68af50573148a8" args="(libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)" -->
! 212: 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>
! 213: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0d9f18e13741c16a7b98fa5d8652995d"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_insert_before" ref="a0d9f18e13741c16a7b98fa5d8652995d" args="(libnet_t *l, libnet_ptag_t ptag1, libnet_ptag_t ptag2)" -->
! 214: 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>
! 215: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af6cfc6d31463e8067908ea5dac698de8"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_delete" ref="af6cfc6d31463e8067908ea5dac698de8" args="(libnet_t *l, libnet_pblock_t *p)" -->
! 216: void </td><td class="memItemRight" valign="bottom"><b>libnet_pblock_delete</b> (libnet_t *l, libnet_pblock_t *p)</td></tr>
! 217: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0b9272cac79f2b5eaba90058a4a50697"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_update" ref="a0b9272cac79f2b5eaba90058a4a50697" args="(libnet_t *l, libnet_pblock_t *p, uint32_t h, uint8_t type)" -->
! 218: libnet_ptag_t </td><td class="memItemRight" valign="bottom"><b>libnet_pblock_update</b> (libnet_t *l, libnet_pblock_t *p, uint32_t h, uint8_t type)</td></tr>
! 219: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6bcc33ff1096bb349c8ffb70953acded"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_find" ref="a6bcc33ff1096bb349c8ffb70953acded" args="(libnet_t *l, libnet_ptag_t ptag)" -->
! 220: libnet_pblock_t * </td><td class="memItemRight" valign="bottom"><b>libnet_pblock_find</b> (libnet_t *l, libnet_ptag_t ptag)</td></tr>
! 221: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6a53bc9534fe3e4e8bb1d516e8bfbe2e"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_append" ref="a6a53bc9534fe3e4e8bb1d516e8bfbe2e" args="(libnet_t *l, libnet_pblock_t *p, const void *buf, uint32_t len)" -->
! 222: int </td><td class="memItemRight" valign="bottom"><b>libnet_pblock_append</b> (libnet_t *l, libnet_pblock_t *p, const void *buf, uint32_t len)</td></tr>
! 223: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a40e905401d0e59f3c1fd6eb9cd78f52f"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_setflags" ref="a40e905401d0e59f3c1fd6eb9cd78f52f" args="(libnet_pblock_t *p, uint8_t flags)" -->
! 224: void </td><td class="memItemRight" valign="bottom"><b>libnet_pblock_setflags</b> (libnet_pblock_t *p, uint8_t flags)</td></tr>
! 225: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8dbb5bfe4e9b30a907cc43248652441b"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_p2p" ref="a8dbb5bfe4e9b30a907cc43248652441b" args="(uint8_t type)" -->
! 226: int </td><td class="memItemRight" valign="bottom"><b>libnet_pblock_p2p</b> (uint8_t type)</td></tr>
! 227: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afa003d857fbed4674159247c24ae7ee3"></a><!-- doxytag: member="libnet-functions.h::libnet_pblock_coalesce" ref="afa003d857fbed4674159247c24ae7ee3" args="(libnet_t *l, uint8_t **packet, uint32_t *size)" -->
! 228: int </td><td class="memItemRight" valign="bottom"><b>libnet_pblock_coalesce</b> (libnet_t *l, uint8_t **packet, uint32_t *size)</td></tr>
! 229: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad71dbbd506317e90548aa4600b5d62c4"></a><!-- doxytag: member="libnet-functions.h::libnet_check_iface" ref="ad71dbbd506317e90548aa4600b5d62c4" args="(libnet_t *l)" -->
! 230: int </td><td class="memItemRight" valign="bottom"><b>libnet_check_iface</b> (libnet_t *l)</td></tr>
! 231: <tr><td colspan="2"><h2><a name="var-members"></a>
! 232: Variables</h2></td></tr>
! 233: <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1dc04717e621f421d7edc848183f8549"></a><!-- doxytag: member="libnet-functions.h::in6addr_error" ref="a1dc04717e621f421d7edc848183f8549" args="" -->
! 234: struct libnet_in6_addr </td><td class="memItemRight" valign="bottom"><b>in6addr_error</b></td></tr>
1.1 misho 235: </table>
1.1.1.2 ! misho 236: <hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
! 237: <div class="textblock"><p>libnet exported function prototypes </p>
! 238: </div><hr/><h2>Function Documentation</h2>
! 239: <a class="anchor" id="af6b11f82cfc7982bd0b21a6d4a857d1a"></a><!-- doxytag: member="libnet-functions.h::libnet_addr2name4" ref="af6b11f82cfc7982bd0b21a6d4a857d1a" args="(uint32_t in, uint8_t use_name)" -->
! 240: <div class="memitem">
! 241: <div class="memproto">
! 242: <table class="memname">
1.1 misho 243: <tr>
1.1.1.2 ! misho 244: <td class="memname">char* libnet_addr2name4 </td>
! 245: <td>(</td>
! 246: <td class="paramtype">uint32_t </td>
! 247: <td class="paramname"><em>in</em>, </td>
1.1 misho 248: </tr>
249: <tr>
1.1.1.2 ! misho 250: <td class="paramkey"></td>
1.1 misho 251: <td></td>
1.1.1.2 ! misho 252: <td class="paramtype">uint8_t </td>
! 253: <td class="paramname"><em>use_name</em> </td>
1.1 misho 254: </tr>
255: <tr>
256: <td></td>
1.1.1.2 ! misho 257: <td>)</td>
! 258: <td></td><td></td>
1.1 misho 259: </tr>
260: </table>
1.1.1.2 ! misho 261: </div>
! 262: <div class="memdoc">
! 263: <p>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. </p>
! 264: <dl><dt><b>Parameters:</b></dt><dd>
! 265: <table class="params">
! 266: <tr><td class="paramname">in</td><td>network byte ordered IPv4 address </td></tr>
! 267: <tr><td class="paramname">use_name</td><td>LIBNET_RESOLVE or LIBNET_DONT_RESOLVE </td></tr>
! 268: </table>
! 269: </dd>
! 270: </dl>
! 271: <dl class="return"><dt><b>Returns:</b></dt><dd>a pointer to presentation format string </dd></dl>
! 272:
! 273: </div>
! 274: </div>
! 275: <a class="anchor" id="a5b7581c7b75c7ecd3e4220c72752efd4"></a><!-- doxytag: member="libnet-functions.h::libnet_addr2name6_r" ref="a5b7581c7b75c7ecd3e4220c72752efd4" args="(struct libnet_in6_addr addr, uint8_t use_name, char *host_name, int host_name_len)" -->
! 276: <div class="memitem">
! 277: <div class="memproto">
! 278: <table class="memname">
1.1 misho 279: <tr>
1.1.1.2 ! misho 280: <td class="memname">void libnet_addr2name6_r </td>
! 281: <td>(</td>
! 282: <td class="paramtype">struct libnet_in6_addr </td>
! 283: <td class="paramname"><em>addr</em>, </td>
1.1 misho 284: </tr>
285: <tr>
1.1.1.2 ! misho 286: <td class="paramkey"></td>
1.1 misho 287: <td></td>
1.1.1.2 ! misho 288: <td class="paramtype">uint8_t </td>
! 289: <td class="paramname"><em>use_name</em>, </td>
1.1 misho 290: </tr>
291: <tr>
1.1.1.2 ! misho 292: <td class="paramkey"></td>
1.1 misho 293: <td></td>
1.1.1.2 ! misho 294: <td class="paramtype">char * </td>
! 295: <td class="paramname"><em>host_name</em>, </td>
1.1 misho 296: </tr>
297: <tr>
1.1.1.2 ! misho 298: <td class="paramkey"></td>
1.1 misho 299: <td></td>
1.1.1.2 ! misho 300: <td class="paramtype">int </td>
! 301: <td class="paramname"><em>host_name_len</em> </td>
1.1 misho 302: </tr>
303: <tr>
304: <td></td>
1.1.1.2 ! misho 305: <td>)</td>
! 306: <td></td><td></td>
1.1 misho 307: </tr>
308: </table>
1.1.1.2 ! misho 309: </div>
! 310: <div class="memdoc">
! 311: <p>Should document this baby right here. </p>
! 312:
! 313: </div>
! 314: </div>
! 315: <a class="anchor" id="a5297581f7aec5f42abede6bd45cd46e9"></a><!-- doxytag: member="libnet-functions.h::libnet_adv_cull_header" ref="a5297581f7aec5f42abede6bd45cd46e9" args="(libnet_t *l, libnet_ptag_t ptag, uint8_t **header, uint32_t *header_s)" -->
! 316: <div class="memitem">
! 317: <div class="memproto">
! 318: <table class="memname">
1.1 misho 319: <tr>
1.1.1.2 ! misho 320: <td class="memname">int libnet_adv_cull_header </td>
! 321: <td>(</td>
! 322: <td class="paramtype">libnet_t * </td>
! 323: <td class="paramname"><em>l</em>, </td>
1.1 misho 324: </tr>
325: <tr>
1.1.1.2 ! misho 326: <td class="paramkey"></td>
1.1 misho 327: <td></td>
1.1.1.2 ! misho 328: <td class="paramtype">libnet_ptag_t </td>
! 329: <td class="paramname"><em>ptag</em>, </td>
1.1 misho 330: </tr>
331: <tr>
1.1.1.2 ! misho 332: <td class="paramkey"></td>
1.1 misho 333: <td></td>
1.1.1.2 ! misho 334: <td class="paramtype">uint8_t ** </td>
! 335: <td class="paramname"><em>header</em>, </td>
1.1 misho 336: </tr>
337: <tr>
1.1.1.2 ! misho 338: <td class="paramkey"></td>
1.1 misho 339: <td></td>
1.1.1.2 ! misho 340: <td class="paramtype">uint32_t * </td>
! 341: <td class="paramname"><em>header_s</em> </td>
1.1 misho 342: </tr>
343: <tr>
344: <td></td>
1.1.1.2 ! misho 345: <td>)</td>
! 346: <td></td><td></td>
1.1 misho 347: </tr>
348: </table>
1.1.1.2 ! misho 349: </div>
! 350: <div class="memdoc">
! 351: <p>[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#a36c0b24a4926a8f5d9d392836e915f2e">libnet_geterror()</a> can tell you why. </p>
! 352: <dl><dt><b>Parameters:</b></dt><dd>
! 353: <table class="params">
! 354: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 355: <tr><td class="paramname">ptag</td><td>the ptag referencing the header to pull </td></tr>
! 356: <tr><td class="paramname">header</td><td>will contain the header </td></tr>
! 357: <tr><td class="paramname">header_s</td><td>will contain the header size </td></tr>
! 358: </table>
! 359: </dd>
! 360: </dl>
! 361: <dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
! 362:
! 363: </div>
! 364: </div>
! 365: <a class="anchor" id="a42d0af11102be3209e3f207072946906"></a><!-- doxytag: member="libnet-functions.h::libnet_adv_cull_packet" ref="a42d0af11102be3209e3f207072946906" args="(libnet_t *l, uint8_t **packet, uint32_t *packet_s)" -->
! 366: <div class="memitem">
! 367: <div class="memproto">
! 368: <table class="memname">
1.1 misho 369: <tr>
1.1.1.2 ! misho 370: <td class="memname">int libnet_adv_cull_packet </td>
! 371: <td>(</td>
! 372: <td class="paramtype">libnet_t * </td>
! 373: <td class="paramname"><em>l</em>, </td>
1.1 misho 374: </tr>
375: <tr>
1.1.1.2 ! misho 376: <td class="paramkey"></td>
1.1 misho 377: <td></td>
1.1.1.2 ! misho 378: <td class="paramtype">uint8_t ** </td>
! 379: <td class="paramname"><em>packet</em>, </td>
1.1 misho 380: </tr>
381: <tr>
1.1.1.2 ! misho 382: <td class="paramkey"></td>
1.1 misho 383: <td></td>
1.1.1.2 ! misho 384: <td class="paramtype">uint32_t * </td>
! 385: <td class="paramname"><em>packet_s</em> </td>
1.1 misho 386: </tr>
387: <tr>
388: <td></td>
1.1.1.2 ! misho 389: <td>)</td>
! 390: <td></td><td></td>
1.1 misho 391: </tr>
392: </table>
1.1.1.2 ! misho 393: </div>
! 394: <div class="memdoc">
! 395: <p>[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#a1309b57e3571306d9bad13ae93600644">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#a36c0b24a4926a8f5d9d392836e915f2e">libnet_geterror()</a> can tell you why. </p>
! 396: <dl><dt><b>Parameters:</b></dt><dd>
! 397: <table class="params">
! 398: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 399: <tr><td class="paramname">packet</td><td>will contain the wire-ready packet </td></tr>
! 400: <tr><td class="paramname">packet_s</td><td>will contain the packet size </td></tr>
! 401: </table>
! 402: </dd>
! 403: </dl>
! 404: <dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
! 405:
! 406: </div>
! 407: </div>
! 408: <a class="anchor" id="a1309b57e3571306d9bad13ae93600644"></a><!-- doxytag: member="libnet-functions.h::libnet_adv_free_packet" ref="a1309b57e3571306d9bad13ae93600644" args="(libnet_t *l, uint8_t *packet)" -->
! 409: <div class="memitem">
! 410: <div class="memproto">
! 411: <table class="memname">
1.1 misho 412: <tr>
1.1.1.2 ! misho 413: <td class="memname">void libnet_adv_free_packet </td>
! 414: <td>(</td>
! 415: <td class="paramtype">libnet_t * </td>
! 416: <td class="paramname"><em>l</em>, </td>
1.1 misho 417: </tr>
418: <tr>
1.1.1.2 ! misho 419: <td class="paramkey"></td>
1.1 misho 420: <td></td>
1.1.1.2 ! misho 421: <td class="paramtype">uint8_t * </td>
! 422: <td class="paramname"><em>packet</em> </td>
1.1 misho 423: </tr>
424: <tr>
425: <td></td>
1.1.1.2 ! misho 426: <td>)</td>
! 427: <td></td><td></td>
1.1 misho 428: </tr>
429: </table>
1.1.1.2 ! misho 430: </div>
! 431: <div class="memdoc">
! 432: <p>[Advanced Interface] Frees the memory allocated when <a class="el" href="libnet-functions_8h.html#a42d0af11102be3209e3f207072946906">libnet_adv_cull_packet()</a> is called. </p>
! 433: <dl><dt><b>Parameters:</b></dt><dd>
! 434: <table class="params">
! 435: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 436: <tr><td class="paramname">packet</td><td>a pointer to the packet to free </td></tr>
1.1 misho 437: </table>
1.1.1.2 ! misho 438: </dd>
1.1 misho 439: </dl>
1.1.1.2 ! misho 440:
! 441: </div>
! 442: </div>
! 443: <a class="anchor" id="a760ea88b395ac3baad0111d569132ae7"></a><!-- doxytag: member="libnet-functions.h::libnet_adv_write_link" ref="a760ea88b395ac3baad0111d569132ae7" args="(libnet_t *l, const uint8_t *packet, uint32_t packet_s)" -->
! 444: <div class="memitem">
! 445: <div class="memproto">
! 446: <table class="memname">
1.1 misho 447: <tr>
1.1.1.2 ! misho 448: <td class="memname">int libnet_adv_write_link </td>
! 449: <td>(</td>
! 450: <td class="paramtype">libnet_t * </td>
! 451: <td class="paramname"><em>l</em>, </td>
1.1 misho 452: </tr>
453: <tr>
1.1.1.2 ! misho 454: <td class="paramkey"></td>
1.1 misho 455: <td></td>
1.1.1.2 ! misho 456: <td class="paramtype">const uint8_t * </td>
! 457: <td class="paramname"><em>packet</em>, </td>
1.1 misho 458: </tr>
459: <tr>
1.1.1.2 ! misho 460: <td class="paramkey"></td>
1.1 misho 461: <td></td>
1.1.1.2 ! misho 462: <td class="paramtype">uint32_t </td>
! 463: <td class="paramname"><em>packet_s</em> </td>
1.1 misho 464: </tr>
465: <tr>
466: <td></td>
1.1.1.2 ! misho 467: <td>)</td>
! 468: <td></td><td></td>
1.1 misho 469: </tr>
470: </table>
1.1.1.2 ! misho 471: </div>
! 472: <div class="memdoc">
! 473: <p>[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#a42d0af11102be3209e3f207072946906">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#a36c0b24a4926a8f5d9d392836e915f2e">libnet_geterror()</a> can tell you why. </p>
! 474: <dl><dt><b>Parameters:</b></dt><dd>
! 475: <table class="params">
! 476: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 477: <tr><td class="paramname">packet</td><td>a pointer to the packet to inject </td></tr>
! 478: <tr><td class="paramname">packet_s</td><td>the size of the packet </td></tr>
! 479: </table>
! 480: </dd>
! 481: </dl>
! 482: <dl class="return"><dt><b>Returns:</b></dt><dd>the number of bytes written, or -1 on failure </dd></dl>
! 483:
! 484: </div>
! 485: </div>
! 486: <a class="anchor" id="ae339adcfdccf212acf3f27538d22c1c5"></a><!-- doxytag: member="libnet-functions.h::libnet_adv_write_raw_ipv4" ref="ae339adcfdccf212acf3f27538d22c1c5" args="(libnet_t *l, const uint8_t *packet, uint32_t packet_s)" -->
! 487: <div class="memitem">
! 488: <div class="memproto">
! 489: <table class="memname">
1.1 misho 490: <tr>
1.1.1.2 ! misho 491: <td class="memname">int libnet_adv_write_raw_ipv4 </td>
! 492: <td>(</td>
! 493: <td class="paramtype">libnet_t * </td>
! 494: <td class="paramname"><em>l</em>, </td>
1.1 misho 495: </tr>
496: <tr>
1.1.1.2 ! misho 497: <td class="paramkey"></td>
1.1 misho 498: <td></td>
1.1.1.2 ! misho 499: <td class="paramtype">const uint8_t * </td>
! 500: <td class="paramname"><em>packet</em>, </td>
1.1 misho 501: </tr>
502: <tr>
1.1.1.2 ! misho 503: <td class="paramkey"></td>
1.1 misho 504: <td></td>
1.1.1.2 ! misho 505: <td class="paramtype">uint32_t </td>
! 506: <td class="paramname"><em>packet_s</em> </td>
1.1 misho 507: </tr>
508: <tr>
509: <td></td>
1.1.1.2 ! misho 510: <td>)</td>
! 511: <td></td><td></td>
! 512: </tr>
! 513: </table>
! 514: </div>
! 515: <div class="memdoc">
! 516: <p>[Advanced Interface] Writes a packet the network at the raw socket 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#a42d0af11102be3209e3f207072946906">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#a36c0b24a4926a8f5d9d392836e915f2e">libnet_geterror()</a> can tell you why. </p>
! 517: <dl><dt><b>Parameters:</b></dt><dd>
! 518: <table class="params">
! 519: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 520: <tr><td class="paramname">packet</td><td>a pointer to the packet to inject </td></tr>
! 521: <tr><td class="paramname">packet_s</td><td>the size of the packet </td></tr>
! 522: </table>
! 523: </dd>
! 524: </dl>
! 525: <dl class="return"><dt><b>Returns:</b></dt><dd>the number of bytes written, or -1 on failure </dd></dl>
! 526:
! 527: </div>
! 528: </div>
! 529: <a class="anchor" id="a11bb29bc300b46b1a59009b9e66b6dee"></a><!-- doxytag: member="libnet-functions.h::libnet_autobuild_arp" ref="a11bb29bc300b46b1a59009b9e66b6dee" args="(uint16_t op, const uint8_t *sha, const uint8_t *spa, const uint8_t *tha, uint8_t *tpa, libnet_t *l)" -->
! 530: <div class="memitem">
! 531: <div class="memproto">
! 532: <table class="memname">
! 533: <tr>
! 534: <td class="memname">libnet_ptag_t libnet_autobuild_arp </td>
! 535: <td>(</td>
! 536: <td class="paramtype">uint16_t </td>
! 537: <td class="paramname"><em>op</em>, </td>
! 538: </tr>
! 539: <tr>
! 540: <td class="paramkey"></td>
1.1 misho 541: <td></td>
1.1.1.2 ! misho 542: <td class="paramtype">const uint8_t * </td>
! 543: <td class="paramname"><em>sha</em>, </td>
1.1 misho 544: </tr>
545: <tr>
1.1.1.2 ! misho 546: <td class="paramkey"></td>
1.1 misho 547: <td></td>
1.1.1.2 ! misho 548: <td class="paramtype">const uint8_t * </td>
! 549: <td class="paramname"><em>spa</em>, </td>
! 550: </tr>
! 551: <tr>
! 552: <td class="paramkey"></td>
1.1 misho 553: <td></td>
1.1.1.2 ! misho 554: <td class="paramtype">const uint8_t * </td>
! 555: <td class="paramname"><em>tha</em>, </td>
1.1 misho 556: </tr>
557: <tr>
1.1.1.2 ! misho 558: <td class="paramkey"></td>
1.1 misho 559: <td></td>
1.1.1.2 ! misho 560: <td class="paramtype">uint8_t * </td>
! 561: <td class="paramname"><em>tpa</em>, </td>
! 562: </tr>
! 563: <tr>
! 564: <td class="paramkey"></td>
1.1 misho 565: <td></td>
1.1.1.2 ! misho 566: <td class="paramtype">libnet_t * </td>
! 567: <td class="paramname"><em>l</em> </td>
1.1 misho 568: </tr>
569: <tr>
570: <td></td>
1.1.1.2 ! misho 571: <td>)</td>
! 572: <td></td><td></td>
1.1 misho 573: </tr>
574: </table>
1.1.1.2 ! misho 575: </div>
! 576: <div class="memdoc">
! 577: <p>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. </p>
! 578: <dl><dt><b>Parameters:</b></dt><dd>
! 579: <table class="params">
! 580: <tr><td class="paramname">op</td><td>ARP operation type </td></tr>
! 581: <tr><td class="paramname">sha</td><td>sender's hardware address </td></tr>
! 582: <tr><td class="paramname">spa</td><td>sender's protocol address </td></tr>
! 583: <tr><td class="paramname">tha</td><td>target hardware address </td></tr>
! 584: <tr><td class="paramname">tpa</td><td>targer protocol address </td></tr>
! 585: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 586: </table>
! 587: </dd>
! 588: </dl>
! 589: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 590:
! 591: </div>
! 592: </div>
! 593: <a class="anchor" id="acd0747f212c04efd2a4dcb947a3db40b"></a><!-- doxytag: member="libnet-functions.h::libnet_autobuild_ethernet" ref="acd0747f212c04efd2a4dcb947a3db40b" args="(const uint8_t *dst, uint16_t type, libnet_t *l)" -->
! 594: <div class="memitem">
! 595: <div class="memproto">
! 596: <table class="memname">
1.1 misho 597: <tr>
1.1.1.2 ! misho 598: <td class="memname">libnet_ptag_t libnet_autobuild_ethernet </td>
! 599: <td>(</td>
! 600: <td class="paramtype">const uint8_t * </td>
! 601: <td class="paramname"><em>dst</em>, </td>
1.1 misho 602: </tr>
603: <tr>
1.1.1.2 ! misho 604: <td class="paramkey"></td>
1.1 misho 605: <td></td>
1.1.1.2 ! misho 606: <td class="paramtype">uint16_t </td>
! 607: <td class="paramname"><em>type</em>, </td>
1.1 misho 608: </tr>
609: <tr>
1.1.1.2 ! misho 610: <td class="paramkey"></td>
1.1 misho 611: <td></td>
1.1.1.2 ! misho 612: <td class="paramtype">libnet_t * </td>
! 613: <td class="paramname"><em>l</em> </td>
1.1 misho 614: </tr>
615: <tr>
616: <td></td>
1.1.1.2 ! misho 617: <td>)</td>
! 618: <td></td><td></td>
1.1 misho 619: </tr>
620: </table>
1.1.1.2 ! misho 621: </div>
! 622: <div class="memdoc">
! 623: <p>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. </p>
! 624: <dl><dt><b>Parameters:</b></dt><dd>
! 625: <table class="params">
! 626: <tr><td class="paramname">dst</td><td>destination ethernet address </td></tr>
! 627: <tr><td class="paramname">type</td><td>upper layer protocol type </td></tr>
! 628: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 629: </table>
! 630: </dd>
! 631: </dl>
! 632: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 633:
! 634: </div>
! 635: </div>
! 636: <a class="anchor" id="a071f9dc69d6992e2c164ed3827f79cc1"></a><!-- doxytag: member="libnet-functions.h::libnet_autobuild_fddi" ref="a071f9dc69d6992e2c164ed3827f79cc1" args="(uint8_t fc, const uint8_t *dst, uint8_t dsap, uint8_t ssap, uint8_t cf, const uint8_t *oui, uint16_t type, libnet_t *l)" -->
! 637: <div class="memitem">
! 638: <div class="memproto">
! 639: <table class="memname">
1.1 misho 640: <tr>
1.1.1.2 ! misho 641: <td class="memname">libnet_ptag_t libnet_autobuild_fddi </td>
! 642: <td>(</td>
! 643: <td class="paramtype">uint8_t </td>
! 644: <td class="paramname"><em>fc</em>, </td>
1.1 misho 645: </tr>
646: <tr>
1.1.1.2 ! misho 647: <td class="paramkey"></td>
1.1 misho 648: <td></td>
1.1.1.2 ! misho 649: <td class="paramtype">const uint8_t * </td>
! 650: <td class="paramname"><em>dst</em>, </td>
1.1 misho 651: </tr>
652: <tr>
1.1.1.2 ! misho 653: <td class="paramkey"></td>
1.1 misho 654: <td></td>
1.1.1.2 ! misho 655: <td class="paramtype">uint8_t </td>
! 656: <td class="paramname"><em>dsap</em>, </td>
1.1 misho 657: </tr>
658: <tr>
1.1.1.2 ! misho 659: <td class="paramkey"></td>
1.1 misho 660: <td></td>
1.1.1.2 ! misho 661: <td class="paramtype">uint8_t </td>
! 662: <td class="paramname"><em>ssap</em>, </td>
1.1 misho 663: </tr>
664: <tr>
1.1.1.2 ! misho 665: <td class="paramkey"></td>
1.1 misho 666: <td></td>
1.1.1.2 ! misho 667: <td class="paramtype">uint8_t </td>
! 668: <td class="paramname"><em>cf</em>, </td>
1.1 misho 669: </tr>
670: <tr>
1.1.1.2 ! misho 671: <td class="paramkey"></td>
1.1 misho 672: <td></td>
1.1.1.2 ! misho 673: <td class="paramtype">const uint8_t * </td>
! 674: <td class="paramname"><em>oui</em>, </td>
1.1 misho 675: </tr>
676: <tr>
1.1.1.2 ! misho 677: <td class="paramkey"></td>
1.1 misho 678: <td></td>
1.1.1.2 ! misho 679: <td class="paramtype">uint16_t </td>
! 680: <td class="paramname"><em>type</em>, </td>
1.1 misho 681: </tr>
682: <tr>
1.1.1.2 ! misho 683: <td class="paramkey"></td>
1.1 misho 684: <td></td>
1.1.1.2 ! misho 685: <td class="paramtype">libnet_t * </td>
! 686: <td class="paramname"><em>l</em> </td>
1.1 misho 687: </tr>
688: <tr>
689: <td></td>
1.1.1.2 ! misho 690: <td>)</td>
! 691: <td></td><td></td>
1.1 misho 692: </tr>
693: </table>
1.1.1.2 ! misho 694: </div>
! 695: <div class="memdoc">
! 696: <p>Autobuilds a Fiber Distributed Data Interface (FDDI) header. </p>
! 697: <dl><dt><b>Parameters:</b></dt><dd>
! 698: <table class="params">
! 699: <tr><td class="paramname">fc</td><td>class format and priority </td></tr>
! 700: <tr><td class="paramname">dst</td><td>destination fddi address </td></tr>
! 701: <tr><td class="paramname">dsap</td><td>destination service access point </td></tr>
! 702: <tr><td class="paramname">ssap</td><td>source service access point </td></tr>
! 703: <tr><td class="paramname">cf</td><td>cf </td></tr>
! 704: <tr><td class="paramname">oui</td><td>IEEE organizational code </td></tr>
! 705: <tr><td class="paramname">type</td><td>upper layer protocol </td></tr>
! 706: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 707: </table>
! 708: </dd>
! 709: </dl>
! 710: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 711:
! 712: </div>
! 713: </div>
! 714: <a class="anchor" id="a17d44748537af9d97cbafe9c1040c7d3"></a><!-- doxytag: member="libnet-functions.h::libnet_autobuild_ipv4" ref="a17d44748537af9d97cbafe9c1040c7d3" args="(uint16_t len, uint8_t prot, uint32_t dst, libnet_t *l)" -->
! 715: <div class="memitem">
! 716: <div class="memproto">
! 717: <table class="memname">
1.1 misho 718: <tr>
1.1.1.2 ! misho 719: <td class="memname">libnet_ptag_t libnet_autobuild_ipv4 </td>
! 720: <td>(</td>
! 721: <td class="paramtype">uint16_t </td>
! 722: <td class="paramname"><em>len</em>, </td>
1.1 misho 723: </tr>
724: <tr>
1.1.1.2 ! misho 725: <td class="paramkey"></td>
1.1 misho 726: <td></td>
1.1.1.2 ! misho 727: <td class="paramtype">uint8_t </td>
! 728: <td class="paramname"><em>prot</em>, </td>
1.1 misho 729: </tr>
730: <tr>
1.1.1.2 ! misho 731: <td class="paramkey"></td>
1.1 misho 732: <td></td>
1.1.1.2 ! misho 733: <td class="paramtype">uint32_t </td>
! 734: <td class="paramname"><em>dst</em>, </td>
1.1 misho 735: </tr>
736: <tr>
1.1.1.2 ! misho 737: <td class="paramkey"></td>
1.1 misho 738: <td></td>
1.1.1.2 ! misho 739: <td class="paramtype">libnet_t * </td>
! 740: <td class="paramname"><em>l</em> </td>
1.1 misho 741: </tr>
742: <tr>
743: <td></td>
1.1.1.2 ! misho 744: <td>)</td>
! 745: <td></td><td></td>
1.1 misho 746: </tr>
747: </table>
1.1.1.2 ! misho 748: </div>
! 749: <div class="memdoc">
! 750: <p>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#a326cf29f24a37dc9232b8b6a56a3f12f">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. </p>
! 751: <dl><dt><b>Parameters:</b></dt><dd>
! 752: <table class="params">
! 753: <tr><td class="paramname">len</td><td>total length of the IP packet including all subsequent data </td></tr>
! 754: <tr><td class="paramname">prot</td><td>upper layer protocol </td></tr>
! 755: <tr><td class="paramname">dst</td><td>destination IPv4 address (little endian) </td></tr>
! 756: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 757: </table>
! 758: </dd>
! 759: </dl>
! 760: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 761:
! 762: </div>
! 763: </div>
! 764: <a class="anchor" id="a9af33cad0a1f688907c675fb577514dd"></a><!-- doxytag: member="libnet-functions.h::libnet_autobuild_ipv6" ref="a9af33cad0a1f688907c675fb577514dd" args="(uint16_t len, uint8_t nh, struct libnet_in6_addr dst, libnet_t *l, libnet_ptag_t ptag)" -->
! 765: <div class="memitem">
! 766: <div class="memproto">
! 767: <table class="memname">
1.1 misho 768: <tr>
1.1.1.2 ! misho 769: <td class="memname">libnet_ptag_t libnet_autobuild_ipv6 </td>
! 770: <td>(</td>
! 771: <td class="paramtype">uint16_t </td>
! 772: <td class="paramname"><em>len</em>, </td>
1.1 misho 773: </tr>
774: <tr>
1.1.1.2 ! misho 775: <td class="paramkey"></td>
1.1 misho 776: <td></td>
1.1.1.2 ! misho 777: <td class="paramtype">uint8_t </td>
! 778: <td class="paramname"><em>nh</em>, </td>
1.1 misho 779: </tr>
780: <tr>
1.1.1.2 ! misho 781: <td class="paramkey"></td>
1.1 misho 782: <td></td>
1.1.1.2 ! misho 783: <td class="paramtype">struct libnet_in6_addr </td>
! 784: <td class="paramname"><em>dst</em>, </td>
1.1 misho 785: </tr>
786: <tr>
1.1.1.2 ! misho 787: <td class="paramkey"></td>
1.1 misho 788: <td></td>
1.1.1.2 ! misho 789: <td class="paramtype">libnet_t * </td>
! 790: <td class="paramname"><em>l</em>, </td>
! 791: </tr>
! 792: <tr>
! 793: <td class="paramkey"></td>
1.1 misho 794: <td></td>
1.1.1.2 ! misho 795: <td class="paramtype">libnet_ptag_t </td>
! 796: <td class="paramname"><em>ptag</em> </td>
1.1 misho 797: </tr>
798: <tr>
799: <td></td>
1.1.1.2 ! misho 800: <td>)</td>
! 801: <td></td><td></td>
1.1 misho 802: </tr>
803: </table>
1.1.1.2 ! misho 804: </div>
! 805: <div class="memdoc">
! 806: <p>Autobuilds a version 6 RFC 2460 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, nh, and dst arguments as <a class="el" href="libnet-functions_8h.html#a326cf29f24a37dc9232b8b6a56a3f12f">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. This function requires <a class="el" href="libnet-functions_8h.html#a3d7de8968c2087df7a22140d7993e267">libnet_get_ipaddr6()</a>, which is not yet implemented for Win32 platforms. </p>
! 807: <dl><dt><b>Parameters:</b></dt><dd>
! 808: <table class="params">
! 809: <tr><td class="paramname">len</td><td>length </td></tr>
! 810: <tr><td class="paramname">nh</td><td>next header </td></tr>
! 811: <tr><td class="paramname">dst</td><td>destination IPv6 address </td></tr>
! 812: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 813: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 814: </table>
! 815: </dd>
! 816: </dl>
! 817: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 818:
! 819: </div>
! 820: </div>
! 821: <a class="anchor" id="a84b5f1f2c40e2411e5792dcfc152c988"></a><!-- doxytag: member="libnet-functions.h::libnet_autobuild_link" ref="a84b5f1f2c40e2411e5792dcfc152c988" args="(const uint8_t *dst, const uint8_t *oui, uint16_t type, libnet_t *l)" -->
! 822: <div class="memitem">
! 823: <div class="memproto">
! 824: <table class="memname">
1.1 misho 825: <tr>
1.1.1.2 ! misho 826: <td class="memname">libnet_ptag_t libnet_autobuild_link </td>
! 827: <td>(</td>
! 828: <td class="paramtype">const uint8_t * </td>
! 829: <td class="paramname"><em>dst</em>, </td>
1.1 misho 830: </tr>
831: <tr>
1.1.1.2 ! misho 832: <td class="paramkey"></td>
1.1 misho 833: <td></td>
1.1.1.2 ! misho 834: <td class="paramtype">const uint8_t * </td>
! 835: <td class="paramname"><em>oui</em>, </td>
1.1 misho 836: </tr>
837: <tr>
1.1.1.2 ! misho 838: <td class="paramkey"></td>
1.1 misho 839: <td></td>
1.1.1.2 ! misho 840: <td class="paramtype">uint16_t </td>
! 841: <td class="paramname"><em>type</em>, </td>
1.1 misho 842: </tr>
843: <tr>
1.1.1.2 ! misho 844: <td class="paramkey"></td>
1.1 misho 845: <td></td>
1.1.1.2 ! misho 846: <td class="paramtype">libnet_t * </td>
! 847: <td class="paramname"><em>l</em> </td>
1.1 misho 848: </tr>
849: <tr>
850: <td></td>
1.1.1.2 ! misho 851: <td>)</td>
! 852: <td></td><td></td>
1.1 misho 853: </tr>
854: </table>
1.1.1.2 ! misho 855: </div>
! 856: <div class="memdoc">
! 857: <p>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. </p>
! 858: <dl><dt><b>Parameters:</b></dt><dd>
! 859: <table class="params">
! 860: <tr><td class="paramname">dst</td><td>the destination MAC address </td></tr>
! 861: <tr><td class="paramname">oui</td><td>Organizationally Unique Identifier (unused for Ethernet) </td></tr>
! 862: <tr><td class="paramname">type</td><td>the upper layer protocol type </td></tr>
! 863: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 864: </table>
! 865: </dd>
! 866: </dl>
! 867: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 868:
! 869: </div>
! 870: </div>
! 871: <a class="anchor" id="a4280cf3a4ffdff6d11c11dcd5f69f0d7"></a><!-- doxytag: member="libnet-functions.h::libnet_autobuild_token_ring" ref="a4280cf3a4ffdff6d11c11dcd5f69f0d7" args="(uint8_t ac, uint8_t fc, const uint8_t *dst, uint8_t dsap, uint8_t ssap, uint8_t cf, const uint8_t *oui, uint16_t type, libnet_t *l)" -->
! 872: <div class="memitem">
! 873: <div class="memproto">
! 874: <table class="memname">
1.1 misho 875: <tr>
1.1.1.2 ! misho 876: <td class="memname">libnet_ptag_t libnet_autobuild_token_ring </td>
! 877: <td>(</td>
! 878: <td class="paramtype">uint8_t </td>
! 879: <td class="paramname"><em>ac</em>, </td>
1.1 misho 880: </tr>
881: <tr>
1.1.1.2 ! misho 882: <td class="paramkey"></td>
1.1 misho 883: <td></td>
1.1.1.2 ! misho 884: <td class="paramtype">uint8_t </td>
! 885: <td class="paramname"><em>fc</em>, </td>
1.1 misho 886: </tr>
887: <tr>
1.1.1.2 ! misho 888: <td class="paramkey"></td>
1.1 misho 889: <td></td>
1.1.1.2 ! misho 890: <td class="paramtype">const uint8_t * </td>
! 891: <td class="paramname"><em>dst</em>, </td>
1.1 misho 892: </tr>
893: <tr>
1.1.1.2 ! misho 894: <td class="paramkey"></td>
1.1 misho 895: <td></td>
1.1.1.2 ! misho 896: <td class="paramtype">uint8_t </td>
! 897: <td class="paramname"><em>dsap</em>, </td>
1.1 misho 898: </tr>
899: <tr>
1.1.1.2 ! misho 900: <td class="paramkey"></td>
1.1 misho 901: <td></td>
1.1.1.2 ! misho 902: <td class="paramtype">uint8_t </td>
! 903: <td class="paramname"><em>ssap</em>, </td>
1.1 misho 904: </tr>
905: <tr>
1.1.1.2 ! misho 906: <td class="paramkey"></td>
1.1 misho 907: <td></td>
1.1.1.2 ! misho 908: <td class="paramtype">uint8_t </td>
! 909: <td class="paramname"><em>cf</em>, </td>
1.1 misho 910: </tr>
911: <tr>
1.1.1.2 ! misho 912: <td class="paramkey"></td>
1.1 misho 913: <td></td>
1.1.1.2 ! misho 914: <td class="paramtype">const uint8_t * </td>
! 915: <td class="paramname"><em>oui</em>, </td>
1.1 misho 916: </tr>
917: <tr>
1.1.1.2 ! misho 918: <td class="paramkey"></td>
1.1 misho 919: <td></td>
1.1.1.2 ! misho 920: <td class="paramtype">uint16_t </td>
! 921: <td class="paramname"><em>type</em>, </td>
1.1 misho 922: </tr>
923: <tr>
1.1.1.2 ! misho 924: <td class="paramkey"></td>
1.1 misho 925: <td></td>
1.1.1.2 ! misho 926: <td class="paramtype">libnet_t * </td>
! 927: <td class="paramname"><em>l</em> </td>
1.1 misho 928: </tr>
929: <tr>
930: <td></td>
1.1.1.2 ! misho 931: <td>)</td>
! 932: <td></td><td></td>
1.1 misho 933: </tr>
934: </table>
1.1.1.2 ! misho 935: </div>
! 936: <div class="memdoc">
! 937: <p>Auto-builds a token ring header. </p>
! 938: <dl><dt><b>Parameters:</b></dt><dd>
! 939: <table class="params">
! 940: <tr><td class="paramname">ac</td><td>access control </td></tr>
! 941: <tr><td class="paramname">fc</td><td>frame control </td></tr>
! 942: <tr><td class="paramname">dst</td><td>destination address </td></tr>
! 943: <tr><td class="paramname">dsap</td><td>destination service access point </td></tr>
! 944: <tr><td class="paramname">ssap</td><td>source service access point </td></tr>
! 945: <tr><td class="paramname">cf</td><td>control field </td></tr>
! 946: <tr><td class="paramname">oui</td><td>Organizationally Unique Identifier </td></tr>
! 947: <tr><td class="paramname">type</td><td>upper layer protocol type </td></tr>
! 948: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 949: </table>
! 950: </dd>
! 951: </dl>
! 952: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 953:
! 954: </div>
! 955: </div>
! 956: <a class="anchor" id="a0fdc98930697ff63e2938efd4082cc16"></a><!-- doxytag: member="libnet-functions.h::libnet_build_802_1q" ref="a0fdc98930697ff63e2938efd4082cc16" args="(const uint8_t *dst, const uint8_t *src, uint16_t tpi, uint8_t priority, uint8_t cfi, uint16_t vlan_id, uint16_t len_proto, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 957: <div class="memitem">
! 958: <div class="memproto">
! 959: <table class="memname">
1.1 misho 960: <tr>
1.1.1.2 ! misho 961: <td class="memname">libnet_ptag_t libnet_build_802_1q </td>
! 962: <td>(</td>
! 963: <td class="paramtype">const uint8_t * </td>
! 964: <td class="paramname"><em>dst</em>, </td>
1.1 misho 965: </tr>
966: <tr>
1.1.1.2 ! misho 967: <td class="paramkey"></td>
1.1 misho 968: <td></td>
1.1.1.2 ! misho 969: <td class="paramtype">const uint8_t * </td>
! 970: <td class="paramname"><em>src</em>, </td>
1.1 misho 971: </tr>
972: <tr>
1.1.1.2 ! misho 973: <td class="paramkey"></td>
1.1 misho 974: <td></td>
1.1.1.2 ! misho 975: <td class="paramtype">uint16_t </td>
! 976: <td class="paramname"><em>tpi</em>, </td>
1.1 misho 977: </tr>
978: <tr>
1.1.1.2 ! misho 979: <td class="paramkey"></td>
1.1 misho 980: <td></td>
1.1.1.2 ! misho 981: <td class="paramtype">uint8_t </td>
! 982: <td class="paramname"><em>priority</em>, </td>
1.1 misho 983: </tr>
984: <tr>
1.1.1.2 ! misho 985: <td class="paramkey"></td>
1.1 misho 986: <td></td>
1.1.1.2 ! misho 987: <td class="paramtype">uint8_t </td>
! 988: <td class="paramname"><em>cfi</em>, </td>
1.1 misho 989: </tr>
990: <tr>
1.1.1.2 ! misho 991: <td class="paramkey"></td>
1.1 misho 992: <td></td>
1.1.1.2 ! misho 993: <td class="paramtype">uint16_t </td>
! 994: <td class="paramname"><em>vlan_id</em>, </td>
1.1 misho 995: </tr>
996: <tr>
1.1.1.2 ! misho 997: <td class="paramkey"></td>
1.1 misho 998: <td></td>
1.1.1.2 ! misho 999: <td class="paramtype">uint16_t </td>
! 1000: <td class="paramname"><em>len_proto</em>, </td>
1.1 misho 1001: </tr>
1002: <tr>
1.1.1.2 ! misho 1003: <td class="paramkey"></td>
1.1 misho 1004: <td></td>
1.1.1.2 ! misho 1005: <td class="paramtype">const uint8_t * </td>
! 1006: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1007: </tr>
1008: <tr>
1.1.1.2 ! misho 1009: <td class="paramkey"></td>
1.1 misho 1010: <td></td>
1.1.1.2 ! misho 1011: <td class="paramtype">uint32_t </td>
! 1012: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1013: </tr>
1014: <tr>
1.1.1.2 ! misho 1015: <td class="paramkey"></td>
1.1 misho 1016: <td></td>
1.1.1.2 ! misho 1017: <td class="paramtype">libnet_t * </td>
! 1018: <td class="paramname"><em>l</em>, </td>
1.1 misho 1019: </tr>
1020: <tr>
1.1.1.2 ! misho 1021: <td class="paramkey"></td>
1.1 misho 1022: <td></td>
1.1.1.2 ! misho 1023: <td class="paramtype">libnet_ptag_t </td>
! 1024: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1025: </tr>
1026: <tr>
1027: <td></td>
1.1.1.2 ! misho 1028: <td>)</td>
! 1029: <td></td><td></td>
1.1 misho 1030: </tr>
1031: </table>
1.1.1.2 ! misho 1032: </div>
! 1033: <div class="memdoc">
! 1034: <h2><a class="anchor" id="PBF"></a>
! 1035: Packet Builder Functions</h2>
! 1036: <p>The core of libnet is the platform-independent packet-building functionality. These functions enable an application programmer to build protocol headers (and data) in a simple and consistent manner without having to worry (too much) about low-level network odds and ends. Each libnet_build() function builds a piece of a packet (generally a protocol header). While it is perfectly possible to build an entire, ready-to-transmit packet with a single call to a libnet_build() function, generally more than one builder-class function call is required to construct a full packet. A complete wire-ready packet generally consists of more than one piece. Every function that builds a protocol header takes a series of arguments roughly corresponding to the header values as they appear on the wire. This process is intuitive but often makes for functions with huge prototypes and large stack frames. One important thing to note is that you must call these functions in order, corresponding to how they should appear on the wire (from the highest protocol layer on down). This building process is intuitive; it approximates what happens in an operating system kernel. In other words, to build a Network Time Protocol (NTP) packet by using the link-layer interface, the application programmer would call the libnet_build() functions in the following order: 1. <a class="el" href="libnet-functions_8h.html#a8a13581c5722c0ee77c2486465c10275">libnet_build_ntp()</a> 2. <a class="el" href="libnet-functions_8h.html#a1dee17aa5276df3587ee276b1b90d8fa">libnet_build_udp()</a> 3. <a class="el" href="libnet-functions_8h.html#a326cf29f24a37dc9232b8b6a56a3f12f">libnet_build_ipv4()</a> 4. <a class="el" href="libnet-functions_8h.html#ac0e53234dfc5205142b0f53c69ab46ae">libnet_build_ethernet()</a> This ordering is essential for libnet 1.1.x to properly link together the packet internally (previous libnet versions did not have the requirement).</p>
! 1037: <h3><a class="anchor" id="TPI"></a>
! 1038: The Payload Interface</h3>
! 1039: <p>The payload interface specifies an optional way to include data directly after the protocol header in question. You can use this function for a variety of purposes, including the following:</p>
! 1040: <ul>
! 1041: <li>Including additional or arbitrary protocol header information that is not available from a libnet interface</li>
! 1042: <li>Including a packet payload (data segment)</li>
! 1043: <li>Building another protocol header that is not available from a libnet interface To employ the interface, the application programmer should construct the i payload data and pass a const uint8_t * to this data and its size to the desired libnet_build() function. Libnet handles the rest.</li>
! 1044: </ul>
! 1045: <p>It is important to note that some functions (notably the IPv6 builders) do use the payload interface to specify variable length but ostensibly non-optional data. See the individual libnet_build_ipv6*() functions for more information.</p>
! 1046: <h3><a class="anchor" id="PT"></a>
! 1047: Protocol Tags and Packet Builder Return Values</h3>
! 1048: <p>Libnet uses the protocol tag (ptag) to identify individual pieces of a packet after being created. A new ptag results every time a libnet_build() function with an empty (0) ptag argument completes successfully. This new ptag now refers to the packet piece just created. The application programmer's responsibility is to save this value if he or she plans to modify this particular portion later on in the program. If the application programmer needs to modify some portion of that particular packet piece again, he or she calls the same libnet_build() function specifying the saved ptag argument. Libnet then searches for that packet piece and modifies it rather than creating a new one. Upon failure for any reason, libnet_build() functions return -1; <a class="el" href="libnet-functions_8h.html#a36c0b24a4926a8f5d9d392836e915f2e">libnet_geterror()</a> tells you why. 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. </p>
! 1049: <dl><dt><b>Parameters:</b></dt><dd>
! 1050: <table class="params">
! 1051: <tr><td class="paramname">dst</td><td>pointer to a six byte source ethernet address </td></tr>
! 1052: <tr><td class="paramname">src</td><td>pointer to a six byte destination ethernet address </td></tr>
! 1053: <tr><td class="paramname">tpi</td><td>tag protocol identifier </td></tr>
! 1054: <tr><td class="paramname">priority</td><td>priority </td></tr>
! 1055: <tr><td class="paramname">cfi</td><td>canonical format indicator </td></tr>
! 1056: <tr><td class="paramname">vlan_id</td><td>vlan identifier </td></tr>
! 1057: <tr><td class="paramname">len_proto</td><td>length (802.3) protocol (Ethernet II) </td></tr>
! 1058: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1059: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1060: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1061: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1062: </table>
! 1063: </dd>
! 1064: </dl>
! 1065: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1066:
! 1067: </div>
! 1068: </div>
! 1069: <a class="anchor" id="a9c6bae7032a3e32b70f9480f9a30a1ad"></a><!-- doxytag: member="libnet-functions.h::libnet_build_802_1x" ref="a9c6bae7032a3e32b70f9480f9a30a1ad" args="(uint8_t eap_ver, uint8_t eap_type, uint16_t length, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1070: <div class="memitem">
! 1071: <div class="memproto">
! 1072: <table class="memname">
1.1 misho 1073: <tr>
1.1.1.2 ! misho 1074: <td class="memname">libnet_ptag_t libnet_build_802_1x </td>
! 1075: <td>(</td>
! 1076: <td class="paramtype">uint8_t </td>
! 1077: <td class="paramname"><em>eap_ver</em>, </td>
1.1 misho 1078: </tr>
1079: <tr>
1.1.1.2 ! misho 1080: <td class="paramkey"></td>
1.1 misho 1081: <td></td>
1.1.1.2 ! misho 1082: <td class="paramtype">uint8_t </td>
! 1083: <td class="paramname"><em>eap_type</em>, </td>
1.1 misho 1084: </tr>
1085: <tr>
1.1.1.2 ! misho 1086: <td class="paramkey"></td>
1.1 misho 1087: <td></td>
1.1.1.2 ! misho 1088: <td class="paramtype">uint16_t </td>
! 1089: <td class="paramname"><em>length</em>, </td>
1.1 misho 1090: </tr>
1091: <tr>
1.1.1.2 ! misho 1092: <td class="paramkey"></td>
1.1 misho 1093: <td></td>
1.1.1.2 ! misho 1094: <td class="paramtype">const uint8_t * </td>
! 1095: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1096: </tr>
1097: <tr>
1.1.1.2 ! misho 1098: <td class="paramkey"></td>
1.1 misho 1099: <td></td>
1.1.1.2 ! misho 1100: <td class="paramtype">uint32_t </td>
! 1101: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1102: </tr>
1103: <tr>
1.1.1.2 ! misho 1104: <td class="paramkey"></td>
1.1 misho 1105: <td></td>
1.1.1.2 ! misho 1106: <td class="paramtype">libnet_t * </td>
! 1107: <td class="paramname"><em>l</em>, </td>
1.1 misho 1108: </tr>
1109: <tr>
1.1.1.2 ! misho 1110: <td class="paramkey"></td>
1.1 misho 1111: <td></td>
1.1.1.2 ! misho 1112: <td class="paramtype">libnet_ptag_t </td>
! 1113: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1114: </tr>
1115: <tr>
1116: <td></td>
1.1.1.2 ! misho 1117: <td>)</td>
! 1118: <td></td><td></td>
1.1 misho 1119: </tr>
1120: </table>
1.1.1.2 ! misho 1121: </div>
! 1122: <div class="memdoc">
! 1123: <p>Builds an IEEE 802.1x extended authentication protocol header. </p>
! 1124: <dl><dt><b>Parameters:</b></dt><dd>
! 1125: <table class="params">
! 1126: <tr><td class="paramname">eap_ver</td><td>the EAP version </td></tr>
! 1127: <tr><td class="paramname">eap_type</td><td>the EAP type </td></tr>
! 1128: <tr><td class="paramname">length</td><td>frame length </td></tr>
! 1129: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1130: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1131: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1132: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1133: </table>
! 1134: </dd>
! 1135: </dl>
! 1136: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1137:
! 1138: </div>
! 1139: </div>
! 1140: <a class="anchor" id="a83c65a0bc641803572115f9f290f39fa"></a><!-- doxytag: member="libnet-functions.h::libnet_build_802_2" ref="a83c65a0bc641803572115f9f290f39fa" args="(uint8_t dsap, uint8_t ssap, uint8_t control, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1141: <div class="memitem">
! 1142: <div class="memproto">
! 1143: <table class="memname">
1.1 misho 1144: <tr>
1.1.1.2 ! misho 1145: <td class="memname">libnet_ptag_t libnet_build_802_2 </td>
! 1146: <td>(</td>
! 1147: <td class="paramtype">uint8_t </td>
! 1148: <td class="paramname"><em>dsap</em>, </td>
1.1 misho 1149: </tr>
1150: <tr>
1.1.1.2 ! misho 1151: <td class="paramkey"></td>
1.1 misho 1152: <td></td>
1.1.1.2 ! misho 1153: <td class="paramtype">uint8_t </td>
! 1154: <td class="paramname"><em>ssap</em>, </td>
1.1 misho 1155: </tr>
1156: <tr>
1.1.1.2 ! misho 1157: <td class="paramkey"></td>
1.1 misho 1158: <td></td>
1.1.1.2 ! misho 1159: <td class="paramtype">uint8_t </td>
! 1160: <td class="paramname"><em>control</em>, </td>
1.1 misho 1161: </tr>
1162: <tr>
1.1.1.2 ! misho 1163: <td class="paramkey"></td>
1.1 misho 1164: <td></td>
1.1.1.2 ! misho 1165: <td class="paramtype">const uint8_t * </td>
! 1166: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1167: </tr>
1168: <tr>
1.1.1.2 ! misho 1169: <td class="paramkey"></td>
1.1 misho 1170: <td></td>
1.1.1.2 ! misho 1171: <td class="paramtype">uint32_t </td>
! 1172: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1173: </tr>
1174: <tr>
1.1.1.2 ! misho 1175: <td class="paramkey"></td>
1.1 misho 1176: <td></td>
1.1.1.2 ! misho 1177: <td class="paramtype">libnet_t * </td>
! 1178: <td class="paramname"><em>l</em>, </td>
1.1 misho 1179: </tr>
1180: <tr>
1.1.1.2 ! misho 1181: <td class="paramkey"></td>
1.1 misho 1182: <td></td>
1.1.1.2 ! misho 1183: <td class="paramtype">libnet_ptag_t </td>
! 1184: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1185: </tr>
1186: <tr>
1187: <td></td>
1.1.1.2 ! misho 1188: <td>)</td>
! 1189: <td></td><td></td>
1.1 misho 1190: </tr>
1191: </table>
1.1.1.2 ! misho 1192: </div>
! 1193: <div class="memdoc">
! 1194: <p>Builds an IEEE 802.2 LLC header. </p>
! 1195: <dl><dt><b>Parameters:</b></dt><dd>
! 1196: <table class="params">
! 1197: <tr><td class="paramname">dsap</td><td>destination service access point </td></tr>
! 1198: <tr><td class="paramname">ssap</td><td>source service access point </td></tr>
! 1199: <tr><td class="paramname">control</td><td>control field </td></tr>
! 1200: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1201: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1202: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1203: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1204: </table>
! 1205: </dd>
! 1206: </dl>
! 1207: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1208:
! 1209: </div>
! 1210: </div>
! 1211: <a class="anchor" id="a0780d8317f3bd7a5e4a2ed10abdbe39b"></a><!-- doxytag: member="libnet-functions.h::libnet_build_802_2snap" ref="a0780d8317f3bd7a5e4a2ed10abdbe39b" args="(uint8_t dsap, uint8_t ssap, uint8_t control, uint8_t *oui, uint16_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1212: <div class="memitem">
! 1213: <div class="memproto">
! 1214: <table class="memname">
1.1 misho 1215: <tr>
1.1.1.2 ! misho 1216: <td class="memname">libnet_ptag_t libnet_build_802_2snap </td>
! 1217: <td>(</td>
! 1218: <td class="paramtype">uint8_t </td>
! 1219: <td class="paramname"><em>dsap</em>, </td>
1.1 misho 1220: </tr>
1221: <tr>
1.1.1.2 ! misho 1222: <td class="paramkey"></td>
1.1 misho 1223: <td></td>
1.1.1.2 ! misho 1224: <td class="paramtype">uint8_t </td>
! 1225: <td class="paramname"><em>ssap</em>, </td>
1.1 misho 1226: </tr>
1227: <tr>
1.1.1.2 ! misho 1228: <td class="paramkey"></td>
1.1 misho 1229: <td></td>
1.1.1.2 ! misho 1230: <td class="paramtype">uint8_t </td>
! 1231: <td class="paramname"><em>control</em>, </td>
1.1 misho 1232: </tr>
1233: <tr>
1.1.1.2 ! misho 1234: <td class="paramkey"></td>
1.1 misho 1235: <td></td>
1.1.1.2 ! misho 1236: <td class="paramtype">uint8_t * </td>
! 1237: <td class="paramname"><em>oui</em>, </td>
1.1 misho 1238: </tr>
1239: <tr>
1.1.1.2 ! misho 1240: <td class="paramkey"></td>
1.1 misho 1241: <td></td>
1.1.1.2 ! misho 1242: <td class="paramtype">uint16_t </td>
! 1243: <td class="paramname"><em>type</em>, </td>
1.1 misho 1244: </tr>
1245: <tr>
1.1.1.2 ! misho 1246: <td class="paramkey"></td>
1.1 misho 1247: <td></td>
1.1.1.2 ! misho 1248: <td class="paramtype">const uint8_t * </td>
! 1249: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1250: </tr>
1251: <tr>
1.1.1.2 ! misho 1252: <td class="paramkey"></td>
1.1 misho 1253: <td></td>
1.1.1.2 ! misho 1254: <td class="paramtype">uint32_t </td>
! 1255: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1256: </tr>
1257: <tr>
1.1.1.2 ! misho 1258: <td class="paramkey"></td>
1.1 misho 1259: <td></td>
1.1.1.2 ! misho 1260: <td class="paramtype">libnet_t * </td>
! 1261: <td class="paramname"><em>l</em>, </td>
1.1 misho 1262: </tr>
1263: <tr>
1.1.1.2 ! misho 1264: <td class="paramkey"></td>
1.1 misho 1265: <td></td>
1.1.1.2 ! misho 1266: <td class="paramtype">libnet_ptag_t </td>
! 1267: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1268: </tr>
1269: <tr>
1270: <td></td>
1.1.1.2 ! misho 1271: <td>)</td>
! 1272: <td></td><td></td>
1.1 misho 1273: </tr>
1274: </table>
1.1.1.2 ! misho 1275: </div>
! 1276: <div class="memdoc">
! 1277: <p>Builds an IEEE 802.2 LLC SNAP header. </p>
! 1278: <dl><dt><b>Parameters:</b></dt><dd>
! 1279: <table class="params">
! 1280: <tr><td class="paramname">dsap</td><td>destination service access point </td></tr>
! 1281: <tr><td class="paramname">ssap</td><td>source service access point </td></tr>
! 1282: <tr><td class="paramname">control</td><td>control field </td></tr>
! 1283: <tr><td class="paramname">oui</td><td>Organizationally Unique Identifier </td></tr>
! 1284: <tr><td class="paramname">type</td><td>upper layer protocol </td></tr>
! 1285: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1286: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1287: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1288: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1289: </table>
! 1290: </dd>
! 1291: </dl>
! 1292: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1293:
! 1294: </div>
! 1295: </div>
! 1296: <a class="anchor" id="a5a200d8b8b3b2a64921db960e8b0da60"></a><!-- doxytag: member="libnet-functions.h::libnet_build_802_3" ref="a5a200d8b8b3b2a64921db960e8b0da60" args="(const uint8_t *dst, const uint8_t *src, uint16_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1297: <div class="memitem">
! 1298: <div class="memproto">
! 1299: <table class="memname">
1.1 misho 1300: <tr>
1.1.1.2 ! misho 1301: <td class="memname">libnet_ptag_t libnet_build_802_3 </td>
! 1302: <td>(</td>
! 1303: <td class="paramtype">const uint8_t * </td>
! 1304: <td class="paramname"><em>dst</em>, </td>
1.1 misho 1305: </tr>
1306: <tr>
1.1.1.2 ! misho 1307: <td class="paramkey"></td>
1.1 misho 1308: <td></td>
1.1.1.2 ! misho 1309: <td class="paramtype">const uint8_t * </td>
! 1310: <td class="paramname"><em>src</em>, </td>
1.1 misho 1311: </tr>
1312: <tr>
1.1.1.2 ! misho 1313: <td class="paramkey"></td>
1.1 misho 1314: <td></td>
1.1.1.2 ! misho 1315: <td class="paramtype">uint16_t </td>
! 1316: <td class="paramname"><em>len</em>, </td>
1.1 misho 1317: </tr>
1318: <tr>
1.1.1.2 ! misho 1319: <td class="paramkey"></td>
1.1 misho 1320: <td></td>
1.1.1.2 ! misho 1321: <td class="paramtype">const uint8_t * </td>
! 1322: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1323: </tr>
1324: <tr>
1.1.1.2 ! misho 1325: <td class="paramkey"></td>
1.1 misho 1326: <td></td>
1.1.1.2 ! misho 1327: <td class="paramtype">uint32_t </td>
! 1328: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1329: </tr>
1330: <tr>
1.1.1.2 ! misho 1331: <td class="paramkey"></td>
1.1 misho 1332: <td></td>
1.1.1.2 ! misho 1333: <td class="paramtype">libnet_t * </td>
! 1334: <td class="paramname"><em>l</em>, </td>
1.1 misho 1335: </tr>
1336: <tr>
1.1.1.2 ! misho 1337: <td class="paramkey"></td>
1.1 misho 1338: <td></td>
1.1.1.2 ! misho 1339: <td class="paramtype">libnet_ptag_t </td>
! 1340: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1341: </tr>
1342: <tr>
1343: <td></td>
1.1.1.2 ! misho 1344: <td>)</td>
! 1345: <td></td><td></td>
1.1 misho 1346: </tr>
1347: </table>
1.1.1.2 ! misho 1348: </div>
! 1349: <div class="memdoc">
! 1350: <p>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. </p>
! 1351: <dl><dt><b>Parameters:</b></dt><dd>
! 1352: <table class="params">
! 1353: <tr><td class="paramname">dst</td><td>destination ethernet address </td></tr>
! 1354: <tr><td class="paramname">src</td><td>source ethernet address </td></tr>
! 1355: <tr><td class="paramname">len</td><td>frame length sans header </td></tr>
! 1356: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1357: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1358: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1359: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1360: </table>
! 1361: </dd>
! 1362: </dl>
! 1363: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1364:
! 1365: </div>
! 1366: </div>
! 1367: <a class="anchor" id="ac81464e42636bc0b9e4800bcf135da57"></a><!-- doxytag: member="libnet-functions.h::libnet_build_arp" ref="ac81464e42636bc0b9e4800bcf135da57" args="(uint16_t hrd, uint16_t pro, uint8_t hln, uint8_t pln, uint16_t op, const uint8_t *sha, const uint8_t *spa, const uint8_t *tha, const uint8_t *tpa, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1368: <div class="memitem">
! 1369: <div class="memproto">
! 1370: <table class="memname">
1.1 misho 1371: <tr>
1.1.1.2 ! misho 1372: <td class="memname">libnet_ptag_t libnet_build_arp </td>
! 1373: <td>(</td>
! 1374: <td class="paramtype">uint16_t </td>
! 1375: <td class="paramname"><em>hrd</em>, </td>
1.1 misho 1376: </tr>
1377: <tr>
1.1.1.2 ! misho 1378: <td class="paramkey"></td>
1.1 misho 1379: <td></td>
1.1.1.2 ! misho 1380: <td class="paramtype">uint16_t </td>
! 1381: <td class="paramname"><em>pro</em>, </td>
1.1 misho 1382: </tr>
1383: <tr>
1.1.1.2 ! misho 1384: <td class="paramkey"></td>
1.1 misho 1385: <td></td>
1.1.1.2 ! misho 1386: <td class="paramtype">uint8_t </td>
! 1387: <td class="paramname"><em>hln</em>, </td>
1.1 misho 1388: </tr>
1389: <tr>
1.1.1.2 ! misho 1390: <td class="paramkey"></td>
1.1 misho 1391: <td></td>
1.1.1.2 ! misho 1392: <td class="paramtype">uint8_t </td>
! 1393: <td class="paramname"><em>pln</em>, </td>
1.1 misho 1394: </tr>
1395: <tr>
1.1.1.2 ! misho 1396: <td class="paramkey"></td>
1.1 misho 1397: <td></td>
1.1.1.2 ! misho 1398: <td class="paramtype">uint16_t </td>
! 1399: <td class="paramname"><em>op</em>, </td>
1.1 misho 1400: </tr>
1401: <tr>
1.1.1.2 ! misho 1402: <td class="paramkey"></td>
1.1 misho 1403: <td></td>
1.1.1.2 ! misho 1404: <td class="paramtype">const uint8_t * </td>
! 1405: <td class="paramname"><em>sha</em>, </td>
1.1 misho 1406: </tr>
1407: <tr>
1.1.1.2 ! misho 1408: <td class="paramkey"></td>
1.1 misho 1409: <td></td>
1.1.1.2 ! misho 1410: <td class="paramtype">const uint8_t * </td>
! 1411: <td class="paramname"><em>spa</em>, </td>
1.1 misho 1412: </tr>
1413: <tr>
1.1.1.2 ! misho 1414: <td class="paramkey"></td>
1.1 misho 1415: <td></td>
1.1.1.2 ! misho 1416: <td class="paramtype">const uint8_t * </td>
! 1417: <td class="paramname"><em>tha</em>, </td>
1.1 misho 1418: </tr>
1419: <tr>
1.1.1.2 ! misho 1420: <td class="paramkey"></td>
1.1 misho 1421: <td></td>
1.1.1.2 ! misho 1422: <td class="paramtype">const uint8_t * </td>
! 1423: <td class="paramname"><em>tpa</em>, </td>
1.1 misho 1424: </tr>
1425: <tr>
1.1.1.2 ! misho 1426: <td class="paramkey"></td>
1.1 misho 1427: <td></td>
1.1.1.2 ! misho 1428: <td class="paramtype">const uint8_t * </td>
! 1429: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1430: </tr>
1431: <tr>
1.1.1.2 ! misho 1432: <td class="paramkey"></td>
1.1 misho 1433: <td></td>
1.1.1.2 ! misho 1434: <td class="paramtype">uint32_t </td>
! 1435: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1436: </tr>
1437: <tr>
1.1.1.2 ! misho 1438: <td class="paramkey"></td>
1.1 misho 1439: <td></td>
1.1.1.2 ! misho 1440: <td class="paramtype">libnet_t * </td>
! 1441: <td class="paramname"><em>l</em>, </td>
1.1 misho 1442: </tr>
1443: <tr>
1.1.1.2 ! misho 1444: <td class="paramkey"></td>
1.1 misho 1445: <td></td>
1.1.1.2 ! misho 1446: <td class="paramtype">libnet_ptag_t </td>
! 1447: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1448: </tr>
1449: <tr>
1450: <td></td>
1.1.1.2 ! misho 1451: <td>)</td>
! 1452: <td></td><td></td>
1.1 misho 1453: </tr>
1454: </table>
1.1.1.2 ! misho 1455: </div>
! 1456: <div class="memdoc">
! 1457: <p>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. </p>
! 1458: <dl><dt><b>Parameters:</b></dt><dd>
! 1459: <table class="params">
! 1460: <tr><td class="paramname">hrd</td><td>hardware address format </td></tr>
! 1461: <tr><td class="paramname">pro</td><td>protocol address format </td></tr>
! 1462: <tr><td class="paramname">hln</td><td>hardware address length </td></tr>
! 1463: <tr><td class="paramname">pln</td><td>protocol address length </td></tr>
! 1464: <tr><td class="paramname">op</td><td>ARP operation type </td></tr>
! 1465: <tr><td class="paramname">sha</td><td>sender's hardware address </td></tr>
! 1466: <tr><td class="paramname">spa</td><td>sender's protocol address </td></tr>
! 1467: <tr><td class="paramname">tha</td><td>target hardware address </td></tr>
! 1468: <tr><td class="paramname">tpa</td><td>targer protocol address </td></tr>
! 1469: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1470: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1471: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1472: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1473: </table>
! 1474: </dd>
! 1475: </dl>
! 1476: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1477:
! 1478: </div>
! 1479: </div>
! 1480: <a class="anchor" id="a9ba6e1d6e95256e67f4a8765bacb901d"></a><!-- doxytag: member="libnet-functions.h::libnet_build_bgp4_header" ref="a9ba6e1d6e95256e67f4a8765bacb901d" args="(uint8_t marker[LIBNET_BGP4_MARKER_SIZE], uint16_t len, uint8_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1481: <div class="memitem">
! 1482: <div class="memproto">
! 1483: <table class="memname">
1.1 misho 1484: <tr>
1.1.1.2 ! misho 1485: <td class="memname">libnet_ptag_t libnet_build_bgp4_header </td>
! 1486: <td>(</td>
! 1487: <td class="paramtype">uint8_t </td>
! 1488: <td class="paramname"><em>marker</em>[LIBNET_BGP4_MARKER_SIZE], </td>
1.1 misho 1489: </tr>
1490: <tr>
1.1.1.2 ! misho 1491: <td class="paramkey"></td>
1.1 misho 1492: <td></td>
1.1.1.2 ! misho 1493: <td class="paramtype">uint16_t </td>
! 1494: <td class="paramname"><em>len</em>, </td>
1.1 misho 1495: </tr>
1496: <tr>
1.1.1.2 ! misho 1497: <td class="paramkey"></td>
1.1 misho 1498: <td></td>
1.1.1.2 ! misho 1499: <td class="paramtype">uint8_t </td>
! 1500: <td class="paramname"><em>type</em>, </td>
1.1 misho 1501: </tr>
1502: <tr>
1.1.1.2 ! misho 1503: <td class="paramkey"></td>
1.1 misho 1504: <td></td>
1.1.1.2 ! misho 1505: <td class="paramtype">const uint8_t * </td>
! 1506: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1507: </tr>
1508: <tr>
1.1.1.2 ! misho 1509: <td class="paramkey"></td>
1.1 misho 1510: <td></td>
1.1.1.2 ! misho 1511: <td class="paramtype">uint32_t </td>
! 1512: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1513: </tr>
1514: <tr>
1.1.1.2 ! misho 1515: <td class="paramkey"></td>
1.1 misho 1516: <td></td>
1.1.1.2 ! misho 1517: <td class="paramtype">libnet_t * </td>
! 1518: <td class="paramname"><em>l</em>, </td>
1.1 misho 1519: </tr>
1520: <tr>
1.1.1.2 ! misho 1521: <td class="paramkey"></td>
1.1 misho 1522: <td></td>
1.1.1.2 ! misho 1523: <td class="paramtype">libnet_ptag_t </td>
! 1524: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1525: </tr>
1526: <tr>
1527: <td></td>
1.1.1.2 ! misho 1528: <td>)</td>
! 1529: <td></td><td></td>
1.1 misho 1530: </tr>
1531: </table>
1.1.1.2 ! misho 1532: </div>
! 1533: <div class="memdoc">
! 1534: <p>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. </p>
! 1535: <dl><dt><b>Parameters:</b></dt><dd>
! 1536: <table class="params">
! 1537: <tr><td class="paramname">marker</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>
! 1538: <tr><td class="paramname">len</td><td>total length of the BGP message, including the header </td></tr>
! 1539: <tr><td class="paramname">type</td><td>type code of the message (OPEN, UPDATE, NOTIFICATION or KEEPALIVE) </td></tr>
! 1540: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1541: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1542: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1543: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1544: </table>
! 1545: </dd>
! 1546: </dl>
! 1547: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1548:
! 1549: </div>
! 1550: </div>
! 1551: <a class="anchor" id="a8bbc446c78e7201faf61e8e732919527"></a><!-- doxytag: member="libnet-functions.h::libnet_build_bgp4_notification" ref="a8bbc446c78e7201faf61e8e732919527" args="(uint8_t err_code, uint8_t err_subcode, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1552: <div class="memitem">
! 1553: <div class="memproto">
! 1554: <table class="memname">
1.1 misho 1555: <tr>
1.1.1.2 ! misho 1556: <td class="memname">libnet_ptag_t libnet_build_bgp4_notification </td>
! 1557: <td>(</td>
! 1558: <td class="paramtype">uint8_t </td>
! 1559: <td class="paramname"><em>err_code</em>, </td>
1.1 misho 1560: </tr>
1561: <tr>
1.1.1.2 ! misho 1562: <td class="paramkey"></td>
1.1 misho 1563: <td></td>
1.1.1.2 ! misho 1564: <td class="paramtype">uint8_t </td>
! 1565: <td class="paramname"><em>err_subcode</em>, </td>
1.1 misho 1566: </tr>
1567: <tr>
1.1.1.2 ! misho 1568: <td class="paramkey"></td>
1.1 misho 1569: <td></td>
1.1.1.2 ! misho 1570: <td class="paramtype">const uint8_t * </td>
! 1571: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1572: </tr>
1573: <tr>
1.1.1.2 ! misho 1574: <td class="paramkey"></td>
1.1 misho 1575: <td></td>
1.1.1.2 ! misho 1576: <td class="paramtype">uint32_t </td>
! 1577: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1578: </tr>
1579: <tr>
1.1.1.2 ! misho 1580: <td class="paramkey"></td>
1.1 misho 1581: <td></td>
1.1.1.2 ! misho 1582: <td class="paramtype">libnet_t * </td>
! 1583: <td class="paramname"><em>l</em>, </td>
1.1 misho 1584: </tr>
1585: <tr>
1.1.1.2 ! misho 1586: <td class="paramkey"></td>
1.1 misho 1587: <td></td>
1.1.1.2 ! misho 1588: <td class="paramtype">libnet_ptag_t </td>
! 1589: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1590: </tr>
1591: <tr>
1592: <td></td>
1.1.1.2 ! misho 1593: <td>)</td>
! 1594: <td></td><td></td>
1.1 misho 1595: </tr>
1596: </table>
1.1.1.2 ! misho 1597: </div>
! 1598: <div class="memdoc">
! 1599: <p>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. </p>
! 1600: <dl><dt><b>Parameters:</b></dt><dd>
! 1601: <table class="params">
! 1602: <tr><td class="paramname">err_code</td><td>type of notification </td></tr>
! 1603: <tr><td class="paramname">err_subcode</td><td>more specific information about the reported error. </td></tr>
! 1604: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1605: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1606: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1607: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1608: </table>
! 1609: </dd>
! 1610: </dl>
! 1611: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1612:
! 1613: </div>
! 1614: </div>
! 1615: <a class="anchor" id="a99eadbed880ccc2cd3334fa4e32ca193"></a><!-- doxytag: member="libnet-functions.h::libnet_build_bgp4_open" ref="a99eadbed880ccc2cd3334fa4e32ca193" args="(uint8_t version, uint16_t src_as, uint16_t hold_time, uint32_t bgp_id, uint8_t opt_len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1616: <div class="memitem">
! 1617: <div class="memproto">
! 1618: <table class="memname">
1.1 misho 1619: <tr>
1.1.1.2 ! misho 1620: <td class="memname">libnet_ptag_t libnet_build_bgp4_open </td>
! 1621: <td>(</td>
! 1622: <td class="paramtype">uint8_t </td>
! 1623: <td class="paramname"><em>version</em>, </td>
1.1 misho 1624: </tr>
1625: <tr>
1.1.1.2 ! misho 1626: <td class="paramkey"></td>
1.1 misho 1627: <td></td>
1.1.1.2 ! misho 1628: <td class="paramtype">uint16_t </td>
! 1629: <td class="paramname"><em>src_as</em>, </td>
1.1 misho 1630: </tr>
1631: <tr>
1.1.1.2 ! misho 1632: <td class="paramkey"></td>
1.1 misho 1633: <td></td>
1.1.1.2 ! misho 1634: <td class="paramtype">uint16_t </td>
! 1635: <td class="paramname"><em>hold_time</em>, </td>
1.1 misho 1636: </tr>
1637: <tr>
1.1.1.2 ! misho 1638: <td class="paramkey"></td>
1.1 misho 1639: <td></td>
1.1.1.2 ! misho 1640: <td class="paramtype">uint32_t </td>
! 1641: <td class="paramname"><em>bgp_id</em>, </td>
1.1 misho 1642: </tr>
1643: <tr>
1.1.1.2 ! misho 1644: <td class="paramkey"></td>
1.1 misho 1645: <td></td>
1.1.1.2 ! misho 1646: <td class="paramtype">uint8_t </td>
! 1647: <td class="paramname"><em>opt_len</em>, </td>
1.1 misho 1648: </tr>
1649: <tr>
1.1.1.2 ! misho 1650: <td class="paramkey"></td>
1.1 misho 1651: <td></td>
1.1.1.2 ! misho 1652: <td class="paramtype">const uint8_t * </td>
! 1653: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1654: </tr>
1655: <tr>
1.1.1.2 ! misho 1656: <td class="paramkey"></td>
1.1 misho 1657: <td></td>
1.1.1.2 ! misho 1658: <td class="paramtype">uint32_t </td>
! 1659: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1660: </tr>
1661: <tr>
1.1.1.2 ! misho 1662: <td class="paramkey"></td>
1.1 misho 1663: <td></td>
1.1.1.2 ! misho 1664: <td class="paramtype">libnet_t * </td>
! 1665: <td class="paramname"><em>l</em>, </td>
1.1 misho 1666: </tr>
1667: <tr>
1.1.1.2 ! misho 1668: <td class="paramkey"></td>
1.1 misho 1669: <td></td>
1.1.1.2 ! misho 1670: <td class="paramtype">libnet_ptag_t </td>
! 1671: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1672: </tr>
1673: <tr>
1674: <td></td>
1.1.1.2 ! misho 1675: <td>)</td>
! 1676: <td></td><td></td>
1.1 misho 1677: </tr>
1678: </table>
1.1.1.2 ! misho 1679: </div>
! 1680: <div class="memdoc">
! 1681: <p>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). </p>
! 1682: <dl><dt><b>Parameters:</b></dt><dd>
! 1683: <table class="params">
! 1684: <tr><td class="paramname">version</td><td>protocol version (should be set to 4) </td></tr>
! 1685: <tr><td class="paramname">src_as</td><td>Autonomous System of the sender </td></tr>
! 1686: <tr><td class="paramname">hold_time</td><td>used to compute the maximum allowed time between the receipt of KEEPALIVE, and/or UPDATE messages by the sender </td></tr>
! 1687: <tr><td class="paramname">bgp_id</td><td>BGP identifier of the sender </td></tr>
! 1688: <tr><td class="paramname">opt_len</td><td>total length of the optional parameters field in bytes </td></tr>
! 1689: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1690: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1691: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1692: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1693: </table>
! 1694: </dd>
! 1695: </dl>
! 1696: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1697:
! 1698: </div>
! 1699: </div>
! 1700: <a class="anchor" id="ad2111145ddb5222d70025f568ab22b75"></a><!-- doxytag: member="libnet-functions.h::libnet_build_bgp4_update" ref="ad2111145ddb5222d70025f568ab22b75" args="(uint16_t unfeasible_rt_len, const uint8_t *withdrawn_rt, uint16_t total_path_attr_len, const uint8_t *path_attributes, uint16_t info_len, uint8_t *reachability_info, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1701: <div class="memitem">
! 1702: <div class="memproto">
! 1703: <table class="memname">
1.1 misho 1704: <tr>
1.1.1.2 ! misho 1705: <td class="memname">libnet_ptag_t libnet_build_bgp4_update </td>
! 1706: <td>(</td>
! 1707: <td class="paramtype">uint16_t </td>
! 1708: <td class="paramname"><em>unfeasible_rt_len</em>, </td>
1.1 misho 1709: </tr>
1710: <tr>
1.1.1.2 ! misho 1711: <td class="paramkey"></td>
1.1 misho 1712: <td></td>
1.1.1.2 ! misho 1713: <td class="paramtype">const uint8_t * </td>
! 1714: <td class="paramname"><em>withdrawn_rt</em>, </td>
1.1 misho 1715: </tr>
1716: <tr>
1.1.1.2 ! misho 1717: <td class="paramkey"></td>
1.1 misho 1718: <td></td>
1.1.1.2 ! misho 1719: <td class="paramtype">uint16_t </td>
! 1720: <td class="paramname"><em>total_path_attr_len</em>, </td>
1.1 misho 1721: </tr>
1722: <tr>
1.1.1.2 ! misho 1723: <td class="paramkey"></td>
1.1 misho 1724: <td></td>
1.1.1.2 ! misho 1725: <td class="paramtype">const uint8_t * </td>
! 1726: <td class="paramname"><em>path_attributes</em>, </td>
1.1 misho 1727: </tr>
1728: <tr>
1.1.1.2 ! misho 1729: <td class="paramkey"></td>
1.1 misho 1730: <td></td>
1.1.1.2 ! misho 1731: <td class="paramtype">uint16_t </td>
! 1732: <td class="paramname"><em>info_len</em>, </td>
1.1 misho 1733: </tr>
1734: <tr>
1.1.1.2 ! misho 1735: <td class="paramkey"></td>
1.1 misho 1736: <td></td>
1.1.1.2 ! misho 1737: <td class="paramtype">uint8_t * </td>
! 1738: <td class="paramname"><em>reachability_info</em>, </td>
1.1 misho 1739: </tr>
1740: <tr>
1.1.1.2 ! misho 1741: <td class="paramkey"></td>
1.1 misho 1742: <td></td>
1.1.1.2 ! misho 1743: <td class="paramtype">const uint8_t * </td>
! 1744: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1745: </tr>
1746: <tr>
1.1.1.2 ! misho 1747: <td class="paramkey"></td>
1.1 misho 1748: <td></td>
1.1.1.2 ! misho 1749: <td class="paramtype">uint32_t </td>
! 1750: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1751: </tr>
1752: <tr>
1.1.1.2 ! misho 1753: <td class="paramkey"></td>
1.1 misho 1754: <td></td>
1.1.1.2 ! misho 1755: <td class="paramtype">libnet_t * </td>
! 1756: <td class="paramname"><em>l</em>, </td>
1.1 misho 1757: </tr>
1758: <tr>
1.1.1.2 ! misho 1759: <td class="paramkey"></td>
1.1 misho 1760: <td></td>
1.1.1.2 ! misho 1761: <td class="paramtype">libnet_ptag_t </td>
! 1762: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1763: </tr>
1764: <tr>
1765: <td></td>
1.1.1.2 ! misho 1766: <td>)</td>
! 1767: <td></td><td></td>
1.1 misho 1768: </tr>
1769: </table>
1.1.1.2 ! misho 1770: </div>
! 1771: <div class="memdoc">
! 1772: <p>Builds an RFC 1771 Border Gateway Protocol 4 (BGP-4) update header. Update messages are used to transfer routing information between BGP peers. </p>
! 1773: <dl><dt><b>Parameters:</b></dt><dd>
! 1774: <table class="params">
! 1775: <tr><td class="paramname">unfeasible_rt_len</td><td>indicates the length of the (next) "withdrawn routes" field in bytes </td></tr>
! 1776: <tr><td class="paramname">withdrawn_rt</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>
! 1777: <tr><td class="paramname">total_path_attr_len</td><td>indicates the length of the (next) "path attributes" field in bytes </td></tr>
! 1778: <tr><td class="paramname">path_attributes</td><td>each attribute is a 3-tuple <type (2 bytes), length, value> </td></tr>
! 1779: <tr><td class="paramname">info_len</td><td>indicates the length of the (next) "network layer reachability information" field in bytes (needed for internal memory size calculation) </td></tr>
! 1780: <tr><td class="paramname">reachability_info</td><td>2-tuples <length (1 byte), prefix (variable)>. </td></tr>
! 1781: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1782: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1783: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1784: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1785: </table>
! 1786: </dd>
! 1787: </dl>
! 1788: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1789:
! 1790: </div>
! 1791: </div>
! 1792: <a class="anchor" id="aeb5caf6fd933b6e909f427405fa99f96"></a><!-- doxytag: member="libnet-functions.h::libnet_build_bootpv4" ref="aeb5caf6fd933b6e909f427405fa99f96" args="(uint8_t opcode, uint8_t htype, uint8_t hlen, uint8_t hopcount, uint32_t xid, uint16_t secs, uint16_t flags, uint32_t cip, uint32_t yip, uint32_t sip, uint32_t gip, const uint8_t *chaddr, const char *sname, const char *file, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1793: <div class="memitem">
! 1794: <div class="memproto">
! 1795: <table class="memname">
1.1 misho 1796: <tr>
1.1.1.2 ! misho 1797: <td class="memname">libnet_ptag_t libnet_build_bootpv4 </td>
! 1798: <td>(</td>
! 1799: <td class="paramtype">uint8_t </td>
! 1800: <td class="paramname"><em>opcode</em>, </td>
1.1 misho 1801: </tr>
1802: <tr>
1.1.1.2 ! misho 1803: <td class="paramkey"></td>
1.1 misho 1804: <td></td>
1.1.1.2 ! misho 1805: <td class="paramtype">uint8_t </td>
! 1806: <td class="paramname"><em>htype</em>, </td>
1.1 misho 1807: </tr>
1808: <tr>
1.1.1.2 ! misho 1809: <td class="paramkey"></td>
1.1 misho 1810: <td></td>
1.1.1.2 ! misho 1811: <td class="paramtype">uint8_t </td>
! 1812: <td class="paramname"><em>hlen</em>, </td>
1.1 misho 1813: </tr>
1814: <tr>
1.1.1.2 ! misho 1815: <td class="paramkey"></td>
1.1 misho 1816: <td></td>
1.1.1.2 ! misho 1817: <td class="paramtype">uint8_t </td>
! 1818: <td class="paramname"><em>hopcount</em>, </td>
1.1 misho 1819: </tr>
1820: <tr>
1.1.1.2 ! misho 1821: <td class="paramkey"></td>
1.1 misho 1822: <td></td>
1.1.1.2 ! misho 1823: <td class="paramtype">uint32_t </td>
! 1824: <td class="paramname"><em>xid</em>, </td>
1.1 misho 1825: </tr>
1826: <tr>
1.1.1.2 ! misho 1827: <td class="paramkey"></td>
1.1 misho 1828: <td></td>
1.1.1.2 ! misho 1829: <td class="paramtype">uint16_t </td>
! 1830: <td class="paramname"><em>secs</em>, </td>
1.1 misho 1831: </tr>
1832: <tr>
1.1.1.2 ! misho 1833: <td class="paramkey"></td>
1.1 misho 1834: <td></td>
1.1.1.2 ! misho 1835: <td class="paramtype">uint16_t </td>
! 1836: <td class="paramname"><em>flags</em>, </td>
1.1 misho 1837: </tr>
1838: <tr>
1.1.1.2 ! misho 1839: <td class="paramkey"></td>
1.1 misho 1840: <td></td>
1.1.1.2 ! misho 1841: <td class="paramtype">uint32_t </td>
! 1842: <td class="paramname"><em>cip</em>, </td>
1.1 misho 1843: </tr>
1844: <tr>
1.1.1.2 ! misho 1845: <td class="paramkey"></td>
1.1 misho 1846: <td></td>
1.1.1.2 ! misho 1847: <td class="paramtype">uint32_t </td>
! 1848: <td class="paramname"><em>yip</em>, </td>
1.1 misho 1849: </tr>
1850: <tr>
1.1.1.2 ! misho 1851: <td class="paramkey"></td>
1.1 misho 1852: <td></td>
1.1.1.2 ! misho 1853: <td class="paramtype">uint32_t </td>
! 1854: <td class="paramname"><em>sip</em>, </td>
1.1 misho 1855: </tr>
1856: <tr>
1.1.1.2 ! misho 1857: <td class="paramkey"></td>
1.1 misho 1858: <td></td>
1.1.1.2 ! misho 1859: <td class="paramtype">uint32_t </td>
! 1860: <td class="paramname"><em>gip</em>, </td>
1.1 misho 1861: </tr>
1862: <tr>
1.1.1.2 ! misho 1863: <td class="paramkey"></td>
1.1 misho 1864: <td></td>
1.1.1.2 ! misho 1865: <td class="paramtype">const uint8_t * </td>
! 1866: <td class="paramname"><em>chaddr</em>, </td>
1.1 misho 1867: </tr>
1868: <tr>
1.1.1.2 ! misho 1869: <td class="paramkey"></td>
1.1 misho 1870: <td></td>
1.1.1.2 ! misho 1871: <td class="paramtype">const char * </td>
! 1872: <td class="paramname"><em>sname</em>, </td>
1.1 misho 1873: </tr>
1874: <tr>
1.1.1.2 ! misho 1875: <td class="paramkey"></td>
1.1 misho 1876: <td></td>
1.1.1.2 ! misho 1877: <td class="paramtype">const char * </td>
! 1878: <td class="paramname"><em>file</em>, </td>
1.1 misho 1879: </tr>
1880: <tr>
1.1.1.2 ! misho 1881: <td class="paramkey"></td>
1.1 misho 1882: <td></td>
1.1.1.2 ! misho 1883: <td class="paramtype">const uint8_t * </td>
! 1884: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1885: </tr>
1886: <tr>
1.1.1.2 ! misho 1887: <td class="paramkey"></td>
1.1 misho 1888: <td></td>
1.1.1.2 ! misho 1889: <td class="paramtype">uint32_t </td>
! 1890: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1891: </tr>
1892: <tr>
1.1.1.2 ! misho 1893: <td class="paramkey"></td>
1.1 misho 1894: <td></td>
1.1.1.2 ! misho 1895: <td class="paramtype">libnet_t * </td>
! 1896: <td class="paramname"><em>l</em>, </td>
1.1 misho 1897: </tr>
1898: <tr>
1.1.1.2 ! misho 1899: <td class="paramkey"></td>
1.1 misho 1900: <td></td>
1.1.1.2 ! misho 1901: <td class="paramtype">libnet_ptag_t </td>
! 1902: <td class="paramname"><em>ptag</em> </td>
1.1 misho 1903: </tr>
1904: <tr>
1905: <td></td>
1.1.1.2 ! misho 1906: <td>)</td>
! 1907: <td></td><td></td>
1.1 misho 1908: </tr>
1909: </table>
1.1.1.2 ! misho 1910: </div>
! 1911: <div class="memdoc">
! 1912: <dl><dt><b>Parameters:</b></dt><dd>
! 1913: <table class="params">
! 1914: <tr><td class="paramname">opcode</td><td></td></tr>
! 1915: <tr><td class="paramname">htype</td><td></td></tr>
! 1916: <tr><td class="paramname">hlen</td><td></td></tr>
! 1917: <tr><td class="paramname">hopcount</td><td></td></tr>
! 1918: <tr><td class="paramname">xid</td><td></td></tr>
! 1919: <tr><td class="paramname">secs</td><td></td></tr>
! 1920: <tr><td class="paramname">flags</td><td></td></tr>
! 1921: <tr><td class="paramname">cip</td><td></td></tr>
! 1922: <tr><td class="paramname">yip</td><td></td></tr>
! 1923: <tr><td class="paramname">sip</td><td></td></tr>
! 1924: <tr><td class="paramname">gip</td><td></td></tr>
! 1925: <tr><td class="paramname">chaddr</td><td>client hardware address, length is hlen </td></tr>
! 1926: <tr><td class="paramname">sname</td><td>server host name, a null terminated string </td></tr>
! 1927: <tr><td class="paramname">file</td><td>boot file name, a null terminated string </td></tr>
! 1928: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 1929: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 1930: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 1931: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 1932: </table>
! 1933: </dd>
! 1934: </dl>
! 1935: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 1936:
! 1937: </div>
! 1938: </div>
! 1939: <a class="anchor" id="a0549535c9d15498e169bc5b96bc9c946"></a><!-- doxytag: member="libnet-functions.h::libnet_build_cdp" ref="a0549535c9d15498e169bc5b96bc9c946" args="(uint8_t version, uint8_t ttl, uint16_t sum, uint16_t type, uint16_t value_s, const uint8_t *value, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 1940: <div class="memitem">
! 1941: <div class="memproto">
! 1942: <table class="memname">
1.1 misho 1943: <tr>
1.1.1.2 ! misho 1944: <td class="memname">libnet_ptag_t libnet_build_cdp </td>
! 1945: <td>(</td>
! 1946: <td class="paramtype">uint8_t </td>
! 1947: <td class="paramname"><em>version</em>, </td>
1.1 misho 1948: </tr>
1949: <tr>
1.1.1.2 ! misho 1950: <td class="paramkey"></td>
1.1 misho 1951: <td></td>
1.1.1.2 ! misho 1952: <td class="paramtype">uint8_t </td>
! 1953: <td class="paramname"><em>ttl</em>, </td>
1.1 misho 1954: </tr>
1955: <tr>
1.1.1.2 ! misho 1956: <td class="paramkey"></td>
1.1 misho 1957: <td></td>
1.1.1.2 ! misho 1958: <td class="paramtype">uint16_t </td>
! 1959: <td class="paramname"><em>sum</em>, </td>
1.1 misho 1960: </tr>
1961: <tr>
1.1.1.2 ! misho 1962: <td class="paramkey"></td>
1.1 misho 1963: <td></td>
1.1.1.2 ! misho 1964: <td class="paramtype">uint16_t </td>
! 1965: <td class="paramname"><em>type</em>, </td>
1.1 misho 1966: </tr>
1967: <tr>
1.1.1.2 ! misho 1968: <td class="paramkey"></td>
1.1 misho 1969: <td></td>
1.1.1.2 ! misho 1970: <td class="paramtype">uint16_t </td>
! 1971: <td class="paramname"><em>value_s</em>, </td>
1.1 misho 1972: </tr>
1973: <tr>
1.1.1.2 ! misho 1974: <td class="paramkey"></td>
1.1 misho 1975: <td></td>
1.1.1.2 ! misho 1976: <td class="paramtype">const uint8_t * </td>
! 1977: <td class="paramname"><em>value</em>, </td>
1.1 misho 1978: </tr>
1979: <tr>
1.1.1.2 ! misho 1980: <td class="paramkey"></td>
1.1 misho 1981: <td></td>
1.1.1.2 ! misho 1982: <td class="paramtype">const uint8_t * </td>
! 1983: <td class="paramname"><em>payload</em>, </td>
1.1 misho 1984: </tr>
1985: <tr>
1.1.1.2 ! misho 1986: <td class="paramkey"></td>
1.1 misho 1987: <td></td>
1.1.1.2 ! misho 1988: <td class="paramtype">uint32_t </td>
! 1989: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 1990: </tr>
1991: <tr>
1.1.1.2 ! misho 1992: <td class="paramkey"></td>
1.1 misho 1993: <td></td>
1.1.1.2 ! misho 1994: <td class="paramtype">libnet_t * </td>
! 1995: <td class="paramname"><em>l</em>, </td>
1.1 misho 1996: </tr>
1997: <tr>
1.1.1.2 ! misho 1998: <td class="paramkey"></td>
1.1 misho 1999: <td></td>
1.1.1.2 ! misho 2000: <td class="paramtype">libnet_ptag_t </td>
! 2001: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2002: </tr>
2003: <tr>
2004: <td></td>
1.1.1.2 ! misho 2005: <td>)</td>
! 2006: <td></td><td></td>
1.1 misho 2007: </tr>
2008: </table>
1.1.1.2 ! misho 2009: </div>
! 2010: <div class="memdoc">
! 2011: <p>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#a6b46a684b738fde7b4012e55eff31b73">libnet_build_data()</a> to construct them. </p>
! 2012: <dl><dt><b>Parameters:</b></dt><dd>
! 2013: <table class="params">
! 2014: <tr><td class="paramname">version</td><td>CDP version </td></tr>
! 2015: <tr><td class="paramname">ttl</td><td>time to live (time information should be cached by recipient) </td></tr>
! 2016: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 2017: <tr><td class="paramname">type</td><td>type of data contained in value </td></tr>
! 2018: <tr><td class="paramname">value_s</td><td>length of value argument </td></tr>
! 2019: <tr><td class="paramname">value</td><td>the CDP information string </td></tr>
! 2020: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 2021: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 2022: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2023: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2024: </table>
! 2025: </dd>
! 2026: </dl>
! 2027: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2028:
! 2029: </div>
! 2030: </div>
! 2031: <a class="anchor" id="a6b46a684b738fde7b4012e55eff31b73"></a><!-- doxytag: member="libnet-functions.h::libnet_build_data" ref="a6b46a684b738fde7b4012e55eff31b73" args="(const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 2032: <div class="memitem">
! 2033: <div class="memproto">
! 2034: <table class="memname">
1.1 misho 2035: <tr>
1.1.1.2 ! misho 2036: <td class="memname">libnet_ptag_t libnet_build_data </td>
! 2037: <td>(</td>
! 2038: <td class="paramtype">const uint8_t * </td>
! 2039: <td class="paramname"><em>payload</em>, </td>
1.1 misho 2040: </tr>
2041: <tr>
1.1.1.2 ! misho 2042: <td class="paramkey"></td>
1.1 misho 2043: <td></td>
1.1.1.2 ! misho 2044: <td class="paramtype">uint32_t </td>
! 2045: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 2046: </tr>
2047: <tr>
1.1.1.2 ! misho 2048: <td class="paramkey"></td>
1.1 misho 2049: <td></td>
1.1.1.2 ! misho 2050: <td class="paramtype">libnet_t * </td>
! 2051: <td class="paramname"><em>l</em>, </td>
1.1 misho 2052: </tr>
2053: <tr>
1.1.1.2 ! misho 2054: <td class="paramkey"></td>
1.1 misho 2055: <td></td>
1.1.1.2 ! misho 2056: <td class="paramtype">libnet_ptag_t </td>
! 2057: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2058: </tr>
2059: <tr>
2060: <td></td>
1.1.1.2 ! misho 2061: <td>)</td>
! 2062: <td></td><td></td>
1.1 misho 2063: </tr>
2064: </table>
1.1.1.2 ! misho 2065: </div>
! 2066: <div class="memdoc">
! 2067: <p>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. This won't work for TCP or IP payload, they have special types (this is probably a bug). </p>
! 2068: <dl><dt><b>Parameters:</b></dt><dd>
! 2069: <table class="params">
! 2070: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 2071: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 2072: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2073: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2074: </table>
! 2075: </dd>
! 2076: </dl>
! 2077: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2078:
! 2079: </div>
! 2080: </div>
! 2081: <a class="anchor" id="a399fd399a3cbb884ca3cd9dc7a22509f"></a><!-- doxytag: member="libnet-functions.h::libnet_build_dhcpv4" ref="a399fd399a3cbb884ca3cd9dc7a22509f" args="(uint8_t opcode, uint8_t htype, uint8_t hlen, uint8_t hopcount, uint32_t xid, uint16_t secs, uint16_t flags, uint32_t cip, uint32_t yip, uint32_t sip, uint32_t gip, const uint8_t *chaddr, const char *sname, const char *file, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 2082: <div class="memitem">
! 2083: <div class="memproto">
! 2084: <table class="memname">
1.1 misho 2085: <tr>
1.1.1.2 ! misho 2086: <td class="memname">libnet_ptag_t libnet_build_dhcpv4 </td>
! 2087: <td>(</td>
! 2088: <td class="paramtype">uint8_t </td>
! 2089: <td class="paramname"><em>opcode</em>, </td>
1.1 misho 2090: </tr>
2091: <tr>
1.1.1.2 ! misho 2092: <td class="paramkey"></td>
1.1 misho 2093: <td></td>
1.1.1.2 ! misho 2094: <td class="paramtype">uint8_t </td>
! 2095: <td class="paramname"><em>htype</em>, </td>
1.1 misho 2096: </tr>
2097: <tr>
1.1.1.2 ! misho 2098: <td class="paramkey"></td>
1.1 misho 2099: <td></td>
1.1.1.2 ! misho 2100: <td class="paramtype">uint8_t </td>
! 2101: <td class="paramname"><em>hlen</em>, </td>
1.1 misho 2102: </tr>
2103: <tr>
1.1.1.2 ! misho 2104: <td class="paramkey"></td>
1.1 misho 2105: <td></td>
1.1.1.2 ! misho 2106: <td class="paramtype">uint8_t </td>
! 2107: <td class="paramname"><em>hopcount</em>, </td>
1.1 misho 2108: </tr>
2109: <tr>
1.1.1.2 ! misho 2110: <td class="paramkey"></td>
1.1 misho 2111: <td></td>
1.1.1.2 ! misho 2112: <td class="paramtype">uint32_t </td>
! 2113: <td class="paramname"><em>xid</em>, </td>
1.1 misho 2114: </tr>
2115: <tr>
1.1.1.2 ! misho 2116: <td class="paramkey"></td>
1.1 misho 2117: <td></td>
1.1.1.2 ! misho 2118: <td class="paramtype">uint16_t </td>
! 2119: <td class="paramname"><em>secs</em>, </td>
1.1 misho 2120: </tr>
2121: <tr>
1.1.1.2 ! misho 2122: <td class="paramkey"></td>
1.1 misho 2123: <td></td>
1.1.1.2 ! misho 2124: <td class="paramtype">uint16_t </td>
! 2125: <td class="paramname"><em>flags</em>, </td>
1.1 misho 2126: </tr>
2127: <tr>
1.1.1.2 ! misho 2128: <td class="paramkey"></td>
1.1 misho 2129: <td></td>
1.1.1.2 ! misho 2130: <td class="paramtype">uint32_t </td>
! 2131: <td class="paramname"><em>cip</em>, </td>
1.1 misho 2132: </tr>
2133: <tr>
1.1.1.2 ! misho 2134: <td class="paramkey"></td>
1.1 misho 2135: <td></td>
1.1.1.2 ! misho 2136: <td class="paramtype">uint32_t </td>
! 2137: <td class="paramname"><em>yip</em>, </td>
1.1 misho 2138: </tr>
2139: <tr>
1.1.1.2 ! misho 2140: <td class="paramkey"></td>
1.1 misho 2141: <td></td>
1.1.1.2 ! misho 2142: <td class="paramtype">uint32_t </td>
! 2143: <td class="paramname"><em>sip</em>, </td>
1.1 misho 2144: </tr>
2145: <tr>
1.1.1.2 ! misho 2146: <td class="paramkey"></td>
1.1 misho 2147: <td></td>
1.1.1.2 ! misho 2148: <td class="paramtype">uint32_t </td>
! 2149: <td class="paramname"><em>gip</em>, </td>
1.1 misho 2150: </tr>
2151: <tr>
1.1.1.2 ! misho 2152: <td class="paramkey"></td>
1.1 misho 2153: <td></td>
1.1.1.2 ! misho 2154: <td class="paramtype">const uint8_t * </td>
! 2155: <td class="paramname"><em>chaddr</em>, </td>
1.1 misho 2156: </tr>
2157: <tr>
1.1.1.2 ! misho 2158: <td class="paramkey"></td>
1.1 misho 2159: <td></td>
1.1.1.2 ! misho 2160: <td class="paramtype">const char * </td>
! 2161: <td class="paramname"><em>sname</em>, </td>
1.1 misho 2162: </tr>
2163: <tr>
1.1.1.2 ! misho 2164: <td class="paramkey"></td>
1.1 misho 2165: <td></td>
1.1.1.2 ! misho 2166: <td class="paramtype">const char * </td>
! 2167: <td class="paramname"><em>file</em>, </td>
1.1 misho 2168: </tr>
2169: <tr>
1.1.1.2 ! misho 2170: <td class="paramkey"></td>
1.1 misho 2171: <td></td>
1.1.1.2 ! misho 2172: <td class="paramtype">const uint8_t * </td>
! 2173: <td class="paramname"><em>payload</em>, </td>
1.1 misho 2174: </tr>
2175: <tr>
1.1.1.2 ! misho 2176: <td class="paramkey"></td>
1.1 misho 2177: <td></td>
1.1.1.2 ! misho 2178: <td class="paramtype">uint32_t </td>
! 2179: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 2180: </tr>
2181: <tr>
1.1.1.2 ! misho 2182: <td class="paramkey"></td>
1.1 misho 2183: <td></td>
1.1.1.2 ! misho 2184: <td class="paramtype">libnet_t * </td>
! 2185: <td class="paramname"><em>l</em>, </td>
1.1 misho 2186: </tr>
2187: <tr>
1.1.1.2 ! misho 2188: <td class="paramkey"></td>
1.1 misho 2189: <td></td>
1.1.1.2 ! misho 2190: <td class="paramtype">libnet_ptag_t </td>
! 2191: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2192: </tr>
2193: <tr>
2194: <td></td>
1.1.1.2 ! misho 2195: <td>)</td>
! 2196: <td></td><td></td>
1.1 misho 2197: </tr>
2198: </table>
1.1.1.2 ! misho 2199: </div>
! 2200: <div class="memdoc">
! 2201: <dl><dt><b>Parameters:</b></dt><dd>
! 2202: <table class="params">
! 2203: <tr><td class="paramname">opcode</td><td></td></tr>
! 2204: <tr><td class="paramname">htype</td><td></td></tr>
! 2205: <tr><td class="paramname">hlen</td><td></td></tr>
! 2206: <tr><td class="paramname">hopcount</td><td></td></tr>
! 2207: <tr><td class="paramname">xid</td><td></td></tr>
! 2208: <tr><td class="paramname">secs</td><td></td></tr>
! 2209: <tr><td class="paramname">flags</td><td></td></tr>
! 2210: <tr><td class="paramname">cip</td><td></td></tr>
! 2211: <tr><td class="paramname">yip</td><td></td></tr>
! 2212: <tr><td class="paramname">sip</td><td></td></tr>
! 2213: <tr><td class="paramname">gip</td><td></td></tr>
! 2214: <tr><td class="paramname">chaddr</td><td>client hardware address, length is hlen </td></tr>
! 2215: <tr><td class="paramname">sname</td><td>server host name, a null terminated string </td></tr>
! 2216: <tr><td class="paramname">file</td><td>boot file name, a null terminated string </td></tr>
! 2217: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 2218: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 2219: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2220: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2221: </table>
! 2222: </dd>
! 2223: </dl>
! 2224: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2225:
! 2226: </div>
! 2227: </div>
! 2228: <a class="anchor" id="a5b4d53861194f34da21ca87bcc158517"></a><!-- doxytag: member="libnet-functions.h::libnet_build_dnsv4" ref="a5b4d53861194f34da21ca87bcc158517" args="(uint16_t h_len, uint16_t id, uint16_t flags, uint16_t num_q, uint16_t num_anws_rr, uint16_t num_auth_rr, uint16_t num_addi_rr, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 2229: <div class="memitem">
! 2230: <div class="memproto">
! 2231: <table class="memname">
1.1 misho 2232: <tr>
1.1.1.2 ! misho 2233: <td class="memname">libnet_ptag_t libnet_build_dnsv4 </td>
! 2234: <td>(</td>
! 2235: <td class="paramtype">uint16_t </td>
! 2236: <td class="paramname"><em>h_len</em>, </td>
1.1 misho 2237: </tr>
2238: <tr>
1.1.1.2 ! misho 2239: <td class="paramkey"></td>
1.1 misho 2240: <td></td>
1.1.1.2 ! misho 2241: <td class="paramtype">uint16_t </td>
! 2242: <td class="paramname"><em>id</em>, </td>
1.1 misho 2243: </tr>
2244: <tr>
1.1.1.2 ! misho 2245: <td class="paramkey"></td>
1.1 misho 2246: <td></td>
1.1.1.2 ! misho 2247: <td class="paramtype">uint16_t </td>
! 2248: <td class="paramname"><em>flags</em>, </td>
1.1 misho 2249: </tr>
2250: <tr>
1.1.1.2 ! misho 2251: <td class="paramkey"></td>
1.1 misho 2252: <td></td>
1.1.1.2 ! misho 2253: <td class="paramtype">uint16_t </td>
! 2254: <td class="paramname"><em>num_q</em>, </td>
1.1 misho 2255: </tr>
2256: <tr>
1.1.1.2 ! misho 2257: <td class="paramkey"></td>
1.1 misho 2258: <td></td>
1.1.1.2 ! misho 2259: <td class="paramtype">uint16_t </td>
! 2260: <td class="paramname"><em>num_anws_rr</em>, </td>
1.1 misho 2261: </tr>
2262: <tr>
1.1.1.2 ! misho 2263: <td class="paramkey"></td>
1.1 misho 2264: <td></td>
1.1.1.2 ! misho 2265: <td class="paramtype">uint16_t </td>
! 2266: <td class="paramname"><em>num_auth_rr</em>, </td>
1.1 misho 2267: </tr>
2268: <tr>
1.1.1.2 ! misho 2269: <td class="paramkey"></td>
1.1 misho 2270: <td></td>
1.1.1.2 ! misho 2271: <td class="paramtype">uint16_t </td>
! 2272: <td class="paramname"><em>num_addi_rr</em>, </td>
1.1 misho 2273: </tr>
2274: <tr>
1.1.1.2 ! misho 2275: <td class="paramkey"></td>
1.1 misho 2276: <td></td>
1.1.1.2 ! misho 2277: <td class="paramtype">const uint8_t * </td>
! 2278: <td class="paramname"><em>payload</em>, </td>
1.1 misho 2279: </tr>
2280: <tr>
1.1.1.2 ! misho 2281: <td class="paramkey"></td>
1.1 misho 2282: <td></td>
1.1.1.2 ! misho 2283: <td class="paramtype">uint32_t </td>
! 2284: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 2285: </tr>
2286: <tr>
1.1.1.2 ! misho 2287: <td class="paramkey"></td>
1.1 misho 2288: <td></td>
1.1.1.2 ! misho 2289: <td class="paramtype">libnet_t * </td>
! 2290: <td class="paramname"><em>l</em>, </td>
1.1 misho 2291: </tr>
2292: <tr>
1.1.1.2 ! misho 2293: <td class="paramkey"></td>
1.1 misho 2294: <td></td>
1.1.1.2 ! misho 2295: <td class="paramtype">libnet_ptag_t </td>
! 2296: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2297: </tr>
2298: <tr>
2299: <td></td>
1.1.1.2 ! misho 2300: <td>)</td>
! 2301: <td></td><td></td>
1.1 misho 2302: </tr>
2303: </table>
1.1.1.2 ! misho 2304: </div>
! 2305: <div class="memdoc">
! 2306: <p>Builds an RFC 1035 version 4 DNS header. Additional DNS payload information should be specified using the payload interface. </p>
! 2307: <dl><dt><b>Parameters:</b></dt><dd>
! 2308: <table class="params">
! 2309: <tr><td class="paramname">h_len</td><td></td></tr>
! 2310: <tr><td class="paramname">id</td><td>DNS packet id </td></tr>
! 2311: <tr><td class="paramname">flags</td><td>control flags </td></tr>
! 2312: <tr><td class="paramname">num_q</td><td>number of questions </td></tr>
! 2313: <tr><td class="paramname">num_anws_rr</td><td>number of answer resource records </td></tr>
! 2314: <tr><td class="paramname">num_auth_rr</td><td>number of authority resource records </td></tr>
! 2315: <tr><td class="paramname">num_addi_rr</td><td>number of additional resource records </td></tr>
! 2316: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 2317: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 2318: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2319: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2320: </table>
! 2321: </dd>
! 2322: </dl>
! 2323: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2324:
! 2325: </div>
! 2326: </div>
! 2327: <a class="anchor" id="aa62e7006bab99d1528571bba42118350"></a><!-- doxytag: member="libnet-functions.h::libnet_build_egre" ref="aa62e7006bab99d1528571bba42118350" args="(uint16_t fv, uint16_t type, uint16_t sum, uint16_t offset, uint32_t key, uint32_t seq, uint16_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 2328: <div class="memitem">
! 2329: <div class="memproto">
! 2330: <table class="memname">
1.1 misho 2331: <tr>
1.1.1.2 ! misho 2332: <td class="memname">libnet_ptag_t libnet_build_egre </td>
! 2333: <td>(</td>
! 2334: <td class="paramtype">uint16_t </td>
! 2335: <td class="paramname"><em>fv</em>, </td>
1.1 misho 2336: </tr>
2337: <tr>
1.1.1.2 ! misho 2338: <td class="paramkey"></td>
1.1 misho 2339: <td></td>
1.1.1.2 ! misho 2340: <td class="paramtype">uint16_t </td>
! 2341: <td class="paramname"><em>type</em>, </td>
1.1 misho 2342: </tr>
2343: <tr>
1.1.1.2 ! misho 2344: <td class="paramkey"></td>
1.1 misho 2345: <td></td>
1.1.1.2 ! misho 2346: <td class="paramtype">uint16_t </td>
! 2347: <td class="paramname"><em>sum</em>, </td>
1.1 misho 2348: </tr>
2349: <tr>
1.1.1.2 ! misho 2350: <td class="paramkey"></td>
1.1 misho 2351: <td></td>
1.1.1.2 ! misho 2352: <td class="paramtype">uint16_t </td>
! 2353: <td class="paramname"><em>offset</em>, </td>
1.1 misho 2354: </tr>
2355: <tr>
1.1.1.2 ! misho 2356: <td class="paramkey"></td>
1.1 misho 2357: <td></td>
1.1.1.2 ! misho 2358: <td class="paramtype">uint32_t </td>
! 2359: <td class="paramname"><em>key</em>, </td>
1.1 misho 2360: </tr>
2361: <tr>
1.1.1.2 ! misho 2362: <td class="paramkey"></td>
1.1 misho 2363: <td></td>
1.1.1.2 ! misho 2364: <td class="paramtype">uint32_t </td>
! 2365: <td class="paramname"><em>seq</em>, </td>
1.1 misho 2366: </tr>
2367: <tr>
1.1.1.2 ! misho 2368: <td class="paramkey"></td>
1.1 misho 2369: <td></td>
1.1.1.2 ! misho 2370: <td class="paramtype">uint16_t </td>
! 2371: <td class="paramname"><em>len</em>, </td>
1.1 misho 2372: </tr>
2373: <tr>
1.1.1.2 ! misho 2374: <td class="paramkey"></td>
1.1 misho 2375: <td></td>
1.1.1.2 ! misho 2376: <td class="paramtype">const uint8_t * </td>
! 2377: <td class="paramname"><em>payload</em>, </td>
1.1 misho 2378: </tr>
2379: <tr>
1.1.1.2 ! misho 2380: <td class="paramkey"></td>
1.1 misho 2381: <td></td>
1.1.1.2 ! misho 2382: <td class="paramtype">uint32_t </td>
! 2383: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 2384: </tr>
2385: <tr>
1.1.1.2 ! misho 2386: <td class="paramkey"></td>
1.1 misho 2387: <td></td>
1.1.1.2 ! misho 2388: <td class="paramtype">libnet_t * </td>
! 2389: <td class="paramname"><em>l</em>, </td>
1.1 misho 2390: </tr>
2391: <tr>
1.1.1.2 ! misho 2392: <td class="paramkey"></td>
1.1 misho 2393: <td></td>
1.1.1.2 ! misho 2394: <td class="paramtype">libnet_ptag_t </td>
! 2395: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2396: </tr>
2397: <tr>
2398: <td></td>
1.1.1.2 ! misho 2399: <td>)</td>
! 2400: <td></td><td></td>
1.1 misho 2401: </tr>
2402: </table>
1.1.1.2 ! misho 2403: </div>
! 2404: <div class="memdoc">
! 2405: <p>Generic Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any protocol. Hence, the IP part of the packet is usually referred as "delivery
! 2406: 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. </p>
! 2407: <dl><dt><b>Parameters:</b></dt><dd>
! 2408: <table class="params">
! 2409: <tr><td class="paramname">fv</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>
! 2410: <tr><td class="paramname">type</td><td>which protocol is encapsulated (PPP, IP, ...) </td></tr>
! 2411: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill). </td></tr>
! 2412: <tr><td class="paramname">offset</td><td>byte offset from the start of the routing field to the first byte of the SRE </td></tr>
! 2413: <tr><td class="paramname">key</td><td>inserted by the encapsulator to authenticate the source </td></tr>
! 2414: <tr><td class="paramname">seq</td><td>sequence number used by the receiver to sort the packets </td></tr>
! 2415: <tr><td class="paramname">len</td><td>size of the GRE packet </td></tr>
! 2416: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 2417: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 2418: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2419: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2420: </table>
! 2421: </dd>
! 2422: </dl>
! 2423: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2424:
! 2425: </div>
! 2426: </div>
! 2427: <a class="anchor" id="ac0e53234dfc5205142b0f53c69ab46ae"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ethernet" ref="ac0e53234dfc5205142b0f53c69ab46ae" args="(const uint8_t *dst, const uint8_t *src, uint16_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 2428: <div class="memitem">
! 2429: <div class="memproto">
! 2430: <table class="memname">
1.1 misho 2431: <tr>
1.1.1.2 ! misho 2432: <td class="memname">libnet_ptag_t libnet_build_ethernet </td>
! 2433: <td>(</td>
! 2434: <td class="paramtype">const uint8_t * </td>
! 2435: <td class="paramname"><em>dst</em>, </td>
1.1 misho 2436: </tr>
2437: <tr>
1.1.1.2 ! misho 2438: <td class="paramkey"></td>
1.1 misho 2439: <td></td>
1.1.1.2 ! misho 2440: <td class="paramtype">const uint8_t * </td>
! 2441: <td class="paramname"><em>src</em>, </td>
1.1 misho 2442: </tr>
2443: <tr>
1.1.1.2 ! misho 2444: <td class="paramkey"></td>
1.1 misho 2445: <td></td>
1.1.1.2 ! misho 2446: <td class="paramtype">uint16_t </td>
! 2447: <td class="paramname"><em>type</em>, </td>
1.1 misho 2448: </tr>
2449: <tr>
1.1.1.2 ! misho 2450: <td class="paramkey"></td>
1.1 misho 2451: <td></td>
1.1.1.2 ! misho 2452: <td class="paramtype">const uint8_t * </td>
! 2453: <td class="paramname"><em>payload</em>, </td>
1.1 misho 2454: </tr>
2455: <tr>
1.1.1.2 ! misho 2456: <td class="paramkey"></td>
1.1 misho 2457: <td></td>
1.1.1.2 ! misho 2458: <td class="paramtype">uint32_t </td>
! 2459: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 2460: </tr>
2461: <tr>
1.1.1.2 ! misho 2462: <td class="paramkey"></td>
1.1 misho 2463: <td></td>
1.1.1.2 ! misho 2464: <td class="paramtype">libnet_t * </td>
! 2465: <td class="paramname"><em>l</em>, </td>
1.1 misho 2466: </tr>
2467: <tr>
1.1.1.2 ! misho 2468: <td class="paramkey"></td>
1.1 misho 2469: <td></td>
1.1.1.2 ! misho 2470: <td class="paramtype">libnet_ptag_t </td>
! 2471: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2472: </tr>
2473: <tr>
2474: <td></td>
1.1.1.2 ! misho 2475: <td>)</td>
! 2476: <td></td><td></td>
1.1 misho 2477: </tr>
2478: </table>
1.1.1.2 ! misho 2479: </div>
! 2480: <div class="memdoc">
! 2481: <p>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. </p>
! 2482: <dl><dt><b>Parameters:</b></dt><dd>
! 2483: <table class="params">
! 2484: <tr><td class="paramname">dst</td><td>destination ethernet address </td></tr>
! 2485: <tr><td class="paramname">src</td><td>source ethernet address </td></tr>
! 2486: <tr><td class="paramname">type</td><td>upper layer protocol type </td></tr>
! 2487: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 2488: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 2489: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2490: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2491: </table>
! 2492: </dd>
! 2493: </dl>
! 2494: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2495:
! 2496: </div>
! 2497: </div>
! 2498: <a class="anchor" id="af313dd4a88c8bb42f023637aec5d7abf"></a><!-- doxytag: member="libnet-functions.h::libnet_build_fddi" ref="af313dd4a88c8bb42f023637aec5d7abf" args="(uint8_t fc, const uint8_t *dst, const uint8_t *src, uint8_t dsap, uint8_t ssap, uint8_t cf, const uint8_t *oui, uint16_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 2499: <div class="memitem">
! 2500: <div class="memproto">
! 2501: <table class="memname">
1.1 misho 2502: <tr>
1.1.1.2 ! misho 2503: <td class="memname">libnet_ptag_t libnet_build_fddi </td>
! 2504: <td>(</td>
! 2505: <td class="paramtype">uint8_t </td>
! 2506: <td class="paramname"><em>fc</em>, </td>
1.1 misho 2507: </tr>
2508: <tr>
1.1.1.2 ! misho 2509: <td class="paramkey"></td>
1.1 misho 2510: <td></td>
1.1.1.2 ! misho 2511: <td class="paramtype">const uint8_t * </td>
! 2512: <td class="paramname"><em>dst</em>, </td>
1.1 misho 2513: </tr>
2514: <tr>
1.1.1.2 ! misho 2515: <td class="paramkey"></td>
1.1 misho 2516: <td></td>
1.1.1.2 ! misho 2517: <td class="paramtype">const uint8_t * </td>
! 2518: <td class="paramname"><em>src</em>, </td>
1.1 misho 2519: </tr>
2520: <tr>
1.1.1.2 ! misho 2521: <td class="paramkey"></td>
1.1 misho 2522: <td></td>
1.1.1.2 ! misho 2523: <td class="paramtype">uint8_t </td>
! 2524: <td class="paramname"><em>dsap</em>, </td>
1.1 misho 2525: </tr>
2526: <tr>
1.1.1.2 ! misho 2527: <td class="paramkey"></td>
1.1 misho 2528: <td></td>
1.1.1.2 ! misho 2529: <td class="paramtype">uint8_t </td>
! 2530: <td class="paramname"><em>ssap</em>, </td>
1.1 misho 2531: </tr>
2532: <tr>
1.1.1.2 ! misho 2533: <td class="paramkey"></td>
1.1 misho 2534: <td></td>
1.1.1.2 ! misho 2535: <td class="paramtype">uint8_t </td>
! 2536: <td class="paramname"><em>cf</em>, </td>
1.1 misho 2537: </tr>
2538: <tr>
1.1.1.2 ! misho 2539: <td class="paramkey"></td>
1.1 misho 2540: <td></td>
1.1.1.2 ! misho 2541: <td class="paramtype">const uint8_t * </td>
! 2542: <td class="paramname"><em>oui</em>, </td>
1.1 misho 2543: </tr>
2544: <tr>
1.1.1.2 ! misho 2545: <td class="paramkey"></td>
1.1 misho 2546: <td></td>
1.1.1.2 ! misho 2547: <td class="paramtype">uint16_t </td>
! 2548: <td class="paramname"><em>type</em>, </td>
1.1 misho 2549: </tr>
2550: <tr>
1.1.1.2 ! misho 2551: <td class="paramkey"></td>
1.1 misho 2552: <td></td>
1.1.1.2 ! misho 2553: <td class="paramtype">const uint8_t * </td>
! 2554: <td class="paramname"><em>payload</em>, </td>
1.1 misho 2555: </tr>
2556: <tr>
1.1.1.2 ! misho 2557: <td class="paramkey"></td>
1.1 misho 2558: <td></td>
1.1.1.2 ! misho 2559: <td class="paramtype">uint32_t </td>
! 2560: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 2561: </tr>
2562: <tr>
1.1.1.2 ! misho 2563: <td class="paramkey"></td>
1.1 misho 2564: <td></td>
1.1.1.2 ! misho 2565: <td class="paramtype">libnet_t * </td>
! 2566: <td class="paramname"><em>l</em>, </td>
1.1 misho 2567: </tr>
2568: <tr>
1.1.1.2 ! misho 2569: <td class="paramkey"></td>
1.1 misho 2570: <td></td>
1.1.1.2 ! misho 2571: <td class="paramtype">libnet_ptag_t </td>
! 2572: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2573: </tr>
2574: <tr>
2575: <td></td>
1.1.1.2 ! misho 2576: <td>)</td>
! 2577: <td></td><td></td>
1.1 misho 2578: </tr>
2579: </table>
1.1.1.2 ! misho 2580: </div>
! 2581: <div class="memdoc">
! 2582: <p>Builds a Fiber Distributed Data Interface (FDDI) header. </p>
! 2583: <dl><dt><b>Parameters:</b></dt><dd>
! 2584: <table class="params">
! 2585: <tr><td class="paramname">fc</td><td>class format and priority </td></tr>
! 2586: <tr><td class="paramname">dst</td><td>destination fddi address </td></tr>
! 2587: <tr><td class="paramname">src</td><td>source fddi address </td></tr>
! 2588: <tr><td class="paramname">dsap</td><td>destination service access point </td></tr>
! 2589: <tr><td class="paramname">ssap</td><td>source service access point </td></tr>
! 2590: <tr><td class="paramname">cf</td><td>cf </td></tr>
! 2591: <tr><td class="paramname">oui</td><td>3 byte IEEE organizational code </td></tr>
! 2592: <tr><td class="paramname">type</td><td>upper layer protocol </td></tr>
! 2593: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 2594: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 2595: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2596: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2597: </table>
! 2598: </dd>
! 2599: </dl>
! 2600: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2601:
! 2602: </div>
! 2603: </div>
! 2604: <a class="anchor" id="a8406f0a8d836df764bedd849ce24a14c"></a><!-- doxytag: member="libnet-functions.h::libnet_build_gre" ref="a8406f0a8d836df764bedd849ce24a14c" args="(uint16_t fv, uint16_t type, uint16_t sum, uint16_t offset, uint32_t key, uint32_t seq, uint16_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 2605: <div class="memitem">
! 2606: <div class="memproto">
! 2607: <table class="memname">
1.1 misho 2608: <tr>
1.1.1.2 ! misho 2609: <td class="memname">libnet_ptag_t libnet_build_gre </td>
! 2610: <td>(</td>
! 2611: <td class="paramtype">uint16_t </td>
! 2612: <td class="paramname"><em>fv</em>, </td>
1.1 misho 2613: </tr>
2614: <tr>
1.1.1.2 ! misho 2615: <td class="paramkey"></td>
1.1 misho 2616: <td></td>
1.1.1.2 ! misho 2617: <td class="paramtype">uint16_t </td>
! 2618: <td class="paramname"><em>type</em>, </td>
1.1 misho 2619: </tr>
2620: <tr>
1.1.1.2 ! misho 2621: <td class="paramkey"></td>
1.1 misho 2622: <td></td>
1.1.1.2 ! misho 2623: <td class="paramtype">uint16_t </td>
! 2624: <td class="paramname"><em>sum</em>, </td>
1.1 misho 2625: </tr>
2626: <tr>
1.1.1.2 ! misho 2627: <td class="paramkey"></td>
1.1 misho 2628: <td></td>
1.1.1.2 ! misho 2629: <td class="paramtype">uint16_t </td>
! 2630: <td class="paramname"><em>offset</em>, </td>
1.1 misho 2631: </tr>
2632: <tr>
1.1.1.2 ! misho 2633: <td class="paramkey"></td>
1.1 misho 2634: <td></td>
1.1.1.2 ! misho 2635: <td class="paramtype">uint32_t </td>
! 2636: <td class="paramname"><em>key</em>, </td>
1.1 misho 2637: </tr>
2638: <tr>
1.1.1.2 ! misho 2639: <td class="paramkey"></td>
1.1 misho 2640: <td></td>
1.1.1.2 ! misho 2641: <td class="paramtype">uint32_t </td>
! 2642: <td class="paramname"><em>seq</em>, </td>
1.1 misho 2643: </tr>
2644: <tr>
1.1.1.2 ! misho 2645: <td class="paramkey"></td>
1.1 misho 2646: <td></td>
1.1.1.2 ! misho 2647: <td class="paramtype">uint16_t </td>
! 2648: <td class="paramname"><em>len</em>, </td>
1.1 misho 2649: </tr>
2650: <tr>
1.1.1.2 ! misho 2651: <td class="paramkey"></td>
1.1 misho 2652: <td></td>
1.1.1.2 ! misho 2653: <td class="paramtype">const uint8_t * </td>
! 2654: <td class="paramname"><em>payload</em>, </td>
1.1 misho 2655: </tr>
2656: <tr>
1.1.1.2 ! misho 2657: <td class="paramkey"></td>
1.1 misho 2658: <td></td>
1.1.1.2 ! misho 2659: <td class="paramtype">uint32_t </td>
! 2660: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 2661: </tr>
2662: <tr>
1.1.1.2 ! misho 2663: <td class="paramkey"></td>
1.1 misho 2664: <td></td>
1.1.1.2 ! misho 2665: <td class="paramtype">libnet_t * </td>
! 2666: <td class="paramname"><em>l</em>, </td>
1.1 misho 2667: </tr>
2668: <tr>
1.1.1.2 ! misho 2669: <td class="paramkey"></td>
1.1 misho 2670: <td></td>
1.1.1.2 ! misho 2671: <td class="paramtype">libnet_ptag_t </td>
! 2672: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2673: </tr>
2674: <tr>
2675: <td></td>
1.1.1.2 ! misho 2676: <td>)</td>
! 2677: <td></td><td></td>
1.1 misho 2678: </tr>
2679: </table>
1.1.1.2 ! misho 2680: </div>
! 2681: <div class="memdoc">
! 2682: <p>Generic Routing Encapsulation (GRE - RFC 1701) is used to encapsulate any protocol. Hence, the IP part of the packet is usually referred as "delivery
! 2683: 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. </p>
! 2684: <dl><dt><b>Parameters:</b></dt><dd>
! 2685: <table class="params">
! 2686: <tr><td class="paramname">fv</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>
! 2687: <tr><td class="paramname">type</td><td>which protocol is encapsulated (PPP, IP, ...) </td></tr>
! 2688: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill). </td></tr>
! 2689: <tr><td class="paramname">offset</td><td>byte offset from the start of the routing field to the first byte of the SRE </td></tr>
! 2690: <tr><td class="paramname">key</td><td>inserted by the encapsulator to authenticate the source </td></tr>
! 2691: <tr><td class="paramname">seq</td><td>sequence number used by the receiver to sort the packets </td></tr>
! 2692: <tr><td class="paramname">len</td><td>size of the GRE packet </td></tr>
! 2693: <tr><td class="paramname">payload</td><td></td></tr>
! 2694: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 2695: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2696: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2697: </table>
! 2698: </dd>
! 2699: </dl>
! 2700: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2701:
! 2702: </div>
! 2703: </div>
! 2704: <a class="anchor" id="a578594ad820ae9d82fe3f9ea470f0b27"></a><!-- doxytag: member="libnet-functions.h::libnet_build_gre_last_sre" ref="a578594ad820ae9d82fe3f9ea470f0b27" args="(libnet_t *l, libnet_ptag_t ptag)" -->
! 2705: <div class="memitem">
! 2706: <div class="memproto">
! 2707: <table class="memname">
1.1 misho 2708: <tr>
1.1.1.2 ! misho 2709: <td class="memname">libnet_ptag_t libnet_build_gre_last_sre </td>
! 2710: <td>(</td>
! 2711: <td class="paramtype">libnet_t * </td>
! 2712: <td class="paramname"><em>l</em>, </td>
1.1 misho 2713: </tr>
2714: <tr>
1.1.1.2 ! misho 2715: <td class="paramkey"></td>
1.1 misho 2716: <td></td>
1.1.1.2 ! misho 2717: <td class="paramtype">libnet_ptag_t </td>
! 2718: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2719: </tr>
2720: <tr>
2721: <td></td>
1.1.1.2 ! misho 2722: <td>)</td>
! 2723: <td></td><td></td>
1.1 misho 2724: </tr>
2725: </table>
1.1.1.2 ! misho 2726: </div>
! 2727: <div class="memdoc">
! 2728: <dl><dt><b>Parameters:</b></dt><dd>
! 2729: <table class="params">
! 2730: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2731: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2732: </table>
! 2733: </dd>
! 2734: </dl>
! 2735: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2736:
! 2737: </div>
! 2738: </div>
! 2739: <a class="anchor" id="abf78669b728f6ec879a38bc9fcf7e4d4"></a><!-- doxytag: member="libnet-functions.h::libnet_build_gre_sre" ref="abf78669b728f6ec879a38bc9fcf7e4d4" args="(uint16_t af, uint8_t offset, uint8_t length, uint8_t *routing, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 2740: <div class="memitem">
! 2741: <div class="memproto">
! 2742: <table class="memname">
1.1 misho 2743: <tr>
1.1.1.2 ! misho 2744: <td class="memname">libnet_ptag_t libnet_build_gre_sre </td>
! 2745: <td>(</td>
! 2746: <td class="paramtype">uint16_t </td>
! 2747: <td class="paramname"><em>af</em>, </td>
1.1 misho 2748: </tr>
2749: <tr>
1.1.1.2 ! misho 2750: <td class="paramkey"></td>
1.1 misho 2751: <td></td>
1.1.1.2 ! misho 2752: <td class="paramtype">uint8_t </td>
! 2753: <td class="paramname"><em>offset</em>, </td>
1.1 misho 2754: </tr>
2755: <tr>
1.1.1.2 ! misho 2756: <td class="paramkey"></td>
1.1 misho 2757: <td></td>
1.1.1.2 ! misho 2758: <td class="paramtype">uint8_t </td>
! 2759: <td class="paramname"><em>length</em>, </td>
1.1 misho 2760: </tr>
2761: <tr>
1.1.1.2 ! misho 2762: <td class="paramkey"></td>
1.1 misho 2763: <td></td>
1.1.1.2 ! misho 2764: <td class="paramtype">uint8_t * </td>
! 2765: <td class="paramname"><em>routing</em>, </td>
1.1 misho 2766: </tr>
2767: <tr>
1.1.1.2 ! misho 2768: <td class="paramkey"></td>
1.1 misho 2769: <td></td>
1.1.1.2 ! misho 2770: <td class="paramtype">const uint8_t * </td>
! 2771: <td class="paramname"><em>payload</em>, </td>
1.1 misho 2772: </tr>
2773: <tr>
1.1.1.2 ! misho 2774: <td class="paramkey"></td>
1.1 misho 2775: <td></td>
1.1.1.2 ! misho 2776: <td class="paramtype">uint32_t </td>
! 2777: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 2778: </tr>
2779: <tr>
1.1.1.2 ! misho 2780: <td class="paramkey"></td>
1.1 misho 2781: <td></td>
1.1.1.2 ! misho 2782: <td class="paramtype">libnet_t * </td>
! 2783: <td class="paramname"><em>l</em>, </td>
1.1 misho 2784: </tr>
2785: <tr>
1.1.1.2 ! misho 2786: <td class="paramkey"></td>
1.1 misho 2787: <td></td>
1.1.1.2 ! misho 2788: <td class="paramtype">libnet_ptag_t </td>
! 2789: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2790: </tr>
2791: <tr>
2792: <td></td>
1.1.1.2 ! misho 2793: <td>)</td>
! 2794: <td></td><td></td>
1.1 misho 2795: </tr>
2796: </table>
1.1.1.2 ! misho 2797: </div>
! 2798: <div class="memdoc">
! 2799: <dl><dt><b>Parameters:</b></dt><dd>
! 2800: <table class="params">
! 2801: <tr><td class="paramname">af</td><td></td></tr>
! 2802: <tr><td class="paramname">offset</td><td></td></tr>
! 2803: <tr><td class="paramname">length</td><td></td></tr>
! 2804: <tr><td class="paramname">routing</td><td></td></tr>
! 2805: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 2806: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 2807: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2808: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2809: </table>
! 2810: </dd>
! 2811: </dl>
! 2812: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2813:
! 2814: </div>
! 2815: </div>
! 2816: <a class="anchor" id="a673f627bdc332ec131135d58a1e44a9d"></a><!-- doxytag: member="libnet-functions.h::libnet_build_hsrp" ref="a673f627bdc332ec131135d58a1e44a9d" args="(uint8_t version, uint8_t opcode, uint8_t state, uint8_t hello_time, uint8_t hold_time, uint8_t priority, uint8_t group, uint8_t reserved, uint8_t authdata[HSRP_AUTHDATA_LENGTH], uint32_t virtual_ip, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 2817: <div class="memitem">
! 2818: <div class="memproto">
! 2819: <table class="memname">
1.1 misho 2820: <tr>
1.1.1.2 ! misho 2821: <td class="memname">libnet_ptag_t libnet_build_hsrp </td>
! 2822: <td>(</td>
! 2823: <td class="paramtype">uint8_t </td>
! 2824: <td class="paramname"><em>version</em>, </td>
1.1 misho 2825: </tr>
2826: <tr>
1.1.1.2 ! misho 2827: <td class="paramkey"></td>
1.1 misho 2828: <td></td>
1.1.1.2 ! misho 2829: <td class="paramtype">uint8_t </td>
! 2830: <td class="paramname"><em>opcode</em>, </td>
1.1 misho 2831: </tr>
2832: <tr>
1.1.1.2 ! misho 2833: <td class="paramkey"></td>
1.1 misho 2834: <td></td>
1.1.1.2 ! misho 2835: <td class="paramtype">uint8_t </td>
! 2836: <td class="paramname"><em>state</em>, </td>
1.1 misho 2837: </tr>
2838: <tr>
1.1.1.2 ! misho 2839: <td class="paramkey"></td>
1.1 misho 2840: <td></td>
1.1.1.2 ! misho 2841: <td class="paramtype">uint8_t </td>
! 2842: <td class="paramname"><em>hello_time</em>, </td>
1.1 misho 2843: </tr>
2844: <tr>
1.1.1.2 ! misho 2845: <td class="paramkey"></td>
1.1 misho 2846: <td></td>
1.1.1.2 ! misho 2847: <td class="paramtype">uint8_t </td>
! 2848: <td class="paramname"><em>hold_time</em>, </td>
1.1 misho 2849: </tr>
2850: <tr>
1.1.1.2 ! misho 2851: <td class="paramkey"></td>
1.1 misho 2852: <td></td>
1.1.1.2 ! misho 2853: <td class="paramtype">uint8_t </td>
! 2854: <td class="paramname"><em>priority</em>, </td>
1.1 misho 2855: </tr>
2856: <tr>
1.1.1.2 ! misho 2857: <td class="paramkey"></td>
1.1 misho 2858: <td></td>
1.1.1.2 ! misho 2859: <td class="paramtype">uint8_t </td>
! 2860: <td class="paramname"><em>group</em>, </td>
1.1 misho 2861: </tr>
2862: <tr>
1.1.1.2 ! misho 2863: <td class="paramkey"></td>
1.1 misho 2864: <td></td>
1.1.1.2 ! misho 2865: <td class="paramtype">uint8_t </td>
! 2866: <td class="paramname"><em>reserved</em>, </td>
1.1 misho 2867: </tr>
2868: <tr>
1.1.1.2 ! misho 2869: <td class="paramkey"></td>
1.1 misho 2870: <td></td>
1.1.1.2 ! misho 2871: <td class="paramtype">uint8_t </td>
! 2872: <td class="paramname"><em>authdata</em>[HSRP_AUTHDATA_LENGTH], </td>
1.1 misho 2873: </tr>
2874: <tr>
1.1.1.2 ! misho 2875: <td class="paramkey"></td>
1.1 misho 2876: <td></td>
1.1.1.2 ! misho 2877: <td class="paramtype">uint32_t </td>
! 2878: <td class="paramname"><em>virtual_ip</em>, </td>
1.1 misho 2879: </tr>
2880: <tr>
1.1.1.2 ! misho 2881: <td class="paramkey"></td>
! 2882: <td></td>
! 2883: <td class="paramtype">const uint8_t * </td>
! 2884: <td class="paramname"><em>payload</em>, </td>
1.1 misho 2885: </tr>
2886: <tr>
1.1.1.2 ! misho 2887: <td class="paramkey"></td>
1.1 misho 2888: <td></td>
1.1.1.2 ! misho 2889: <td class="paramtype">uint32_t </td>
! 2890: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 2891: </tr>
2892: <tr>
1.1.1.2 ! misho 2893: <td class="paramkey"></td>
1.1 misho 2894: <td></td>
1.1.1.2 ! misho 2895: <td class="paramtype">libnet_t * </td>
! 2896: <td class="paramname"><em>l</em>, </td>
1.1 misho 2897: </tr>
2898: <tr>
1.1.1.2 ! misho 2899: <td class="paramkey"></td>
1.1 misho 2900: <td></td>
1.1.1.2 ! misho 2901: <td class="paramtype">libnet_ptag_t </td>
! 2902: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2903: </tr>
2904: <tr>
2905: <td></td>
1.1.1.2 ! misho 2906: <td>)</td>
! 2907: <td></td><td></td>
! 2908: </tr>
! 2909: </table>
! 2910: </div>
! 2911: <div class="memdoc">
! 2912: <p>Builds a HSRP header. HSRP is a Cisco propietary protocol defined in RFC 2281 </p>
! 2913: <dl><dt><b>Parameters:</b></dt><dd>
! 2914: <table class="params">
! 2915: <tr><td class="paramname">version</td><td>version of the HSRP messages </td></tr>
! 2916: <tr><td class="paramname">opcode</td><td>type of message </td></tr>
! 2917: <tr><td class="paramname">state</td><td>current state of the router </td></tr>
! 2918: <tr><td class="paramname">hello_time</td><td>period in seconds between hello messages </td></tr>
! 2919: <tr><td class="paramname">hold_time</td><td>seconds that the current hello message is valid </td></tr>
! 2920: <tr><td class="paramname">priority</td><td>priority for the election proccess </td></tr>
! 2921: <tr><td class="paramname">group</td><td>standby group </td></tr>
! 2922: <tr><td class="paramname">reserved</td><td>reserved field </td></tr>
! 2923: <tr><td class="paramname">authdata</td><td>password </td></tr>
! 2924: <tr><td class="paramname">virtual_ip</td><td>virtual ip address </td></tr>
! 2925: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 2926: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 2927: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 2928: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 2929: </table>
! 2930: </dd>
! 2931: </dl>
! 2932: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 2933:
! 2934: </div>
! 2935: </div>
! 2936: <a class="anchor" id="af2a31d44e931c774bfc50a8a8d0a71af"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv4_echo" ref="af2a31d44e931c774bfc50a8a8d0a71af" args="(uint8_t type, uint8_t code, uint16_t sum, uint16_t id, uint16_t seq, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 2937: <div class="memitem">
! 2938: <div class="memproto">
! 2939: <table class="memname">
! 2940: <tr>
! 2941: <td class="memname">libnet_ptag_t libnet_build_icmpv4_echo </td>
! 2942: <td>(</td>
! 2943: <td class="paramtype">uint8_t </td>
! 2944: <td class="paramname"><em>type</em>, </td>
1.1 misho 2945: </tr>
2946: <tr>
1.1.1.2 ! misho 2947: <td class="paramkey"></td>
1.1 misho 2948: <td></td>
1.1.1.2 ! misho 2949: <td class="paramtype">uint8_t </td>
! 2950: <td class="paramname"><em>code</em>, </td>
1.1 misho 2951: </tr>
2952: <tr>
1.1.1.2 ! misho 2953: <td class="paramkey"></td>
1.1 misho 2954: <td></td>
1.1.1.2 ! misho 2955: <td class="paramtype">uint16_t </td>
! 2956: <td class="paramname"><em>sum</em>, </td>
1.1 misho 2957: </tr>
2958: <tr>
1.1.1.2 ! misho 2959: <td class="paramkey"></td>
1.1 misho 2960: <td></td>
1.1.1.2 ! misho 2961: <td class="paramtype">uint16_t </td>
! 2962: <td class="paramname"><em>id</em>, </td>
! 2963: </tr>
! 2964: <tr>
! 2965: <td class="paramkey"></td>
1.1 misho 2966: <td></td>
1.1.1.2 ! misho 2967: <td class="paramtype">uint16_t </td>
! 2968: <td class="paramname"><em>seq</em>, </td>
1.1 misho 2969: </tr>
2970: <tr>
1.1.1.2 ! misho 2971: <td class="paramkey"></td>
1.1 misho 2972: <td></td>
1.1.1.2 ! misho 2973: <td class="paramtype">const uint8_t * </td>
! 2974: <td class="paramname"><em>payload</em>, </td>
! 2975: </tr>
! 2976: <tr>
! 2977: <td class="paramkey"></td>
1.1 misho 2978: <td></td>
1.1.1.2 ! misho 2979: <td class="paramtype">uint32_t </td>
! 2980: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 2981: </tr>
2982: <tr>
1.1.1.2 ! misho 2983: <td class="paramkey"></td>
1.1 misho 2984: <td></td>
1.1.1.2 ! misho 2985: <td class="paramtype">libnet_t * </td>
! 2986: <td class="paramname"><em>l</em>, </td>
! 2987: </tr>
! 2988: <tr>
! 2989: <td class="paramkey"></td>
1.1 misho 2990: <td></td>
1.1.1.2 ! misho 2991: <td class="paramtype">libnet_ptag_t </td>
! 2992: <td class="paramname"><em>ptag</em> </td>
1.1 misho 2993: </tr>
2994: <tr>
2995: <td></td>
1.1.1.2 ! misho 2996: <td>)</td>
! 2997: <td></td><td></td>
1.1 misho 2998: </tr>
2999: </table>
1.1.1.2 ! misho 3000: </div>
! 3001: <div class="memdoc">
! 3002: <p>Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) echo request/reply header </p>
! 3003: <dl><dt><b>Parameters:</b></dt><dd>
! 3004: <table class="params">
! 3005: <tr><td class="paramname">type</td><td>type of ICMP packet (should be ICMP_ECHOREPLY or ICMP_ECHO) </td></tr>
! 3006: <tr><td class="paramname">code</td><td>code of ICMP packet (should be 0) </td></tr>
! 3007: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3008: <tr><td class="paramname">id</td><td>identification number </td></tr>
! 3009: <tr><td class="paramname">seq</td><td>packet sequence number </td></tr>
! 3010: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3011: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3012: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3013: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3014: </table>
! 3015: </dd>
! 3016: </dl>
! 3017: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3018:
! 3019: </div>
! 3020: </div>
! 3021: <a class="anchor" id="a6cff4ee3328d18a02de3ffa467b4a783"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv4_mask" ref="a6cff4ee3328d18a02de3ffa467b4a783" args="(uint8_t type, uint8_t code, uint16_t sum, uint16_t id, uint16_t seq, uint32_t mask, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3022: <div class="memitem">
! 3023: <div class="memproto">
! 3024: <table class="memname">
1.1 misho 3025: <tr>
1.1.1.2 ! misho 3026: <td class="memname">libnet_ptag_t libnet_build_icmpv4_mask </td>
! 3027: <td>(</td>
! 3028: <td class="paramtype">uint8_t </td>
! 3029: <td class="paramname"><em>type</em>, </td>
1.1 misho 3030: </tr>
3031: <tr>
1.1.1.2 ! misho 3032: <td class="paramkey"></td>
1.1 misho 3033: <td></td>
1.1.1.2 ! misho 3034: <td class="paramtype">uint8_t </td>
! 3035: <td class="paramname"><em>code</em>, </td>
1.1 misho 3036: </tr>
3037: <tr>
1.1.1.2 ! misho 3038: <td class="paramkey"></td>
1.1 misho 3039: <td></td>
1.1.1.2 ! misho 3040: <td class="paramtype">uint16_t </td>
! 3041: <td class="paramname"><em>sum</em>, </td>
1.1 misho 3042: </tr>
3043: <tr>
1.1.1.2 ! misho 3044: <td class="paramkey"></td>
1.1 misho 3045: <td></td>
1.1.1.2 ! misho 3046: <td class="paramtype">uint16_t </td>
! 3047: <td class="paramname"><em>id</em>, </td>
1.1 misho 3048: </tr>
3049: <tr>
1.1.1.2 ! misho 3050: <td class="paramkey"></td>
1.1 misho 3051: <td></td>
1.1.1.2 ! misho 3052: <td class="paramtype">uint16_t </td>
! 3053: <td class="paramname"><em>seq</em>, </td>
1.1 misho 3054: </tr>
3055: <tr>
1.1.1.2 ! misho 3056: <td class="paramkey"></td>
1.1 misho 3057: <td></td>
1.1.1.2 ! misho 3058: <td class="paramtype">uint32_t </td>
! 3059: <td class="paramname"><em>mask</em>, </td>
1.1 misho 3060: </tr>
3061: <tr>
1.1.1.2 ! misho 3062: <td class="paramkey"></td>
1.1 misho 3063: <td></td>
1.1.1.2 ! misho 3064: <td class="paramtype">const uint8_t * </td>
! 3065: <td class="paramname"><em>payload</em>, </td>
1.1 misho 3066: </tr>
3067: <tr>
1.1.1.2 ! misho 3068: <td class="paramkey"></td>
1.1 misho 3069: <td></td>
1.1.1.2 ! misho 3070: <td class="paramtype">uint32_t </td>
! 3071: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3072: </tr>
3073: <tr>
1.1.1.2 ! misho 3074: <td class="paramkey"></td>
1.1 misho 3075: <td></td>
1.1.1.2 ! misho 3076: <td class="paramtype">libnet_t * </td>
! 3077: <td class="paramname"><em>l</em>, </td>
1.1 misho 3078: </tr>
3079: <tr>
1.1.1.2 ! misho 3080: <td class="paramkey"></td>
1.1 misho 3081: <td></td>
1.1.1.2 ! misho 3082: <td class="paramtype">libnet_ptag_t </td>
! 3083: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3084: </tr>
3085: <tr>
3086: <td></td>
1.1.1.2 ! misho 3087: <td>)</td>
! 3088: <td></td><td></td>
1.1 misho 3089: </tr>
1.1.1.2 ! misho 3090: </table>
! 3091: </div>
! 3092: <div class="memdoc">
! 3093: <p>Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) IP netmask request/reply header. </p>
! 3094: <dl><dt><b>Parameters:</b></dt><dd>
! 3095: <table class="params">
! 3096: <tr><td class="paramname">type</td><td>type of ICMP packet (should be ICMP_MASKREQ or ICMP_MASKREPLY) </td></tr>
! 3097: <tr><td class="paramname">code</td><td>code of ICMP packet (should be 0) </td></tr>
! 3098: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3099: <tr><td class="paramname">id</td><td>identification number </td></tr>
! 3100: <tr><td class="paramname">seq</td><td>packet sequence number </td></tr>
! 3101: <tr><td class="paramname">mask</td><td>subnet mask </td></tr>
! 3102: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3103: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3104: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3105: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3106: </table>
! 3107: </dd>
! 3108: </dl>
! 3109: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3110:
! 3111: </div>
! 3112: </div>
! 3113: <a class="anchor" id="a80e6e045aa6e2b249294112171129b28"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv4_redirect" ref="a80e6e045aa6e2b249294112171129b28" args="(uint8_t type, uint8_t code, uint16_t sum, uint32_t gateway, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3114: <div class="memitem">
! 3115: <div class="memproto">
! 3116: <table class="memname">
1.1 misho 3117: <tr>
1.1.1.2 ! misho 3118: <td class="memname">libnet_ptag_t libnet_build_icmpv4_redirect </td>
! 3119: <td>(</td>
! 3120: <td class="paramtype">uint8_t </td>
! 3121: <td class="paramname"><em>type</em>, </td>
1.1 misho 3122: </tr>
3123: <tr>
1.1.1.2 ! misho 3124: <td class="paramkey"></td>
1.1 misho 3125: <td></td>
1.1.1.2 ! misho 3126: <td class="paramtype">uint8_t </td>
! 3127: <td class="paramname"><em>code</em>, </td>
1.1 misho 3128: </tr>
3129: <tr>
1.1.1.2 ! misho 3130: <td class="paramkey"></td>
1.1 misho 3131: <td></td>
1.1.1.2 ! misho 3132: <td class="paramtype">uint16_t </td>
! 3133: <td class="paramname"><em>sum</em>, </td>
1.1 misho 3134: </tr>
3135: <tr>
1.1.1.2 ! misho 3136: <td class="paramkey"></td>
1.1 misho 3137: <td></td>
1.1.1.2 ! misho 3138: <td class="paramtype">uint32_t </td>
! 3139: <td class="paramname"><em>gateway</em>, </td>
1.1 misho 3140: </tr>
3141: <tr>
1.1.1.2 ! misho 3142: <td class="paramkey"></td>
1.1 misho 3143: <td></td>
1.1.1.2 ! misho 3144: <td class="paramtype">const uint8_t * </td>
! 3145: <td class="paramname"><em>payload</em>, </td>
! 3146: </tr>
! 3147: <tr>
! 3148: <td class="paramkey"></td>
1.1 misho 3149: <td></td>
1.1.1.2 ! misho 3150: <td class="paramtype">uint32_t </td>
! 3151: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3152: </tr>
3153: <tr>
1.1.1.2 ! misho 3154: <td class="paramkey"></td>
1.1 misho 3155: <td></td>
1.1.1.2 ! misho 3156: <td class="paramtype">libnet_t * </td>
! 3157: <td class="paramname"><em>l</em>, </td>
! 3158: </tr>
! 3159: <tr>
! 3160: <td class="paramkey"></td>
1.1 misho 3161: <td></td>
1.1.1.2 ! misho 3162: <td class="paramtype">libnet_ptag_t </td>
! 3163: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3164: </tr>
3165: <tr>
3166: <td></td>
1.1.1.2 ! misho 3167: <td>)</td>
! 3168: <td></td><td></td>
1.1 misho 3169: </tr>
3170: </table>
1.1.1.2 ! misho 3171: </div>
! 3172: <div class="memdoc">
! 3173: <p>Builds an IP version 4 RFC 792 Internet Message Control Protocol (ICMP) redirect header. The IP header that caused the error message should be built by a previous call to <a class="el" href="libnet-functions_8h.html#a326cf29f24a37dc9232b8b6a56a3f12f">libnet_build_ipv4()</a>. </p>
! 3174: <dl><dt><b>Parameters:</b></dt><dd>
! 3175: <table class="params">
! 3176: <tr><td class="paramname">type</td><td>type of ICMP packet (should be ICMP_REDIRECT) </td></tr>
! 3177: <tr><td class="paramname">code</td><td>code of ICMP packet (should be one of the four redirect codes) </td></tr>
! 3178: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3179: <tr><td class="paramname">gateway</td><td></td></tr>
! 3180: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3181: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3182: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3183: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3184: </table>
! 3185: </dd>
! 3186: </dl>
! 3187: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3188:
! 3189: </div>
! 3190: </div>
! 3191: <a class="anchor" id="a9f4204ece5d336ef11e777c2d5e50186"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv4_timeexceed" ref="a9f4204ece5d336ef11e777c2d5e50186" args="(uint8_t type, uint8_t code, uint16_t sum, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3192: <div class="memitem">
! 3193: <div class="memproto">
! 3194: <table class="memname">
1.1 misho 3195: <tr>
1.1.1.2 ! misho 3196: <td class="memname">libnet_ptag_t libnet_build_icmpv4_timeexceed </td>
! 3197: <td>(</td>
! 3198: <td class="paramtype">uint8_t </td>
! 3199: <td class="paramname"><em>type</em>, </td>
1.1 misho 3200: </tr>
3201: <tr>
1.1.1.2 ! misho 3202: <td class="paramkey"></td>
1.1 misho 3203: <td></td>
1.1.1.2 ! misho 3204: <td class="paramtype">uint8_t </td>
! 3205: <td class="paramname"><em>code</em>, </td>
1.1 misho 3206: </tr>
3207: <tr>
1.1.1.2 ! misho 3208: <td class="paramkey"></td>
1.1 misho 3209: <td></td>
1.1.1.2 ! misho 3210: <td class="paramtype">uint16_t </td>
! 3211: <td class="paramname"><em>sum</em>, </td>
1.1 misho 3212: </tr>
3213: <tr>
1.1.1.2 ! misho 3214: <td class="paramkey"></td>
1.1 misho 3215: <td></td>
1.1.1.2 ! misho 3216: <td class="paramtype">const uint8_t * </td>
! 3217: <td class="paramname"><em>payload</em>, </td>
1.1 misho 3218: </tr>
3219: <tr>
1.1.1.2 ! misho 3220: <td class="paramkey"></td>
1.1 misho 3221: <td></td>
1.1.1.2 ! misho 3222: <td class="paramtype">uint32_t </td>
! 3223: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3224: </tr>
3225: <tr>
1.1.1.2 ! misho 3226: <td class="paramkey"></td>
1.1 misho 3227: <td></td>
1.1.1.2 ! misho 3228: <td class="paramtype">libnet_t * </td>
! 3229: <td class="paramname"><em>l</em>, </td>
1.1 misho 3230: </tr>
3231: <tr>
1.1.1.2 ! misho 3232: <td class="paramkey"></td>
1.1 misho 3233: <td></td>
1.1.1.2 ! misho 3234: <td class="paramtype">libnet_ptag_t </td>
! 3235: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3236: </tr>
3237: <tr>
3238: <td></td>
1.1.1.2 ! misho 3239: <td>)</td>
! 3240: <td></td><td></td>
1.1 misho 3241: </tr>
1.1.1.2 ! misho 3242: </table>
! 3243: </div>
! 3244: <div class="memdoc">
! 3245: <p>Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) time exceeded header. The IP header that caused the error message should be built by a previous call to <a class="el" href="libnet-functions_8h.html#a326cf29f24a37dc9232b8b6a56a3f12f">libnet_build_ipv4()</a>. </p>
! 3246: <dl><dt><b>Parameters:</b></dt><dd>
! 3247: <table class="params">
! 3248: <tr><td class="paramname">type</td><td>type of ICMP packet (should be ICMP_TIMXCEED) </td></tr>
! 3249: <tr><td class="paramname">code</td><td>code of ICMP packet (ICMP_TIMXCEED_INTRANS / ICMP_TIMXCEED_REASS) </td></tr>
! 3250: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3251: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3252: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3253: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3254: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3255: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3256: </table>
! 3257: </dd>
! 3258: </dl>
! 3259: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3260:
! 3261: </div>
! 3262: </div>
! 3263: <a class="anchor" id="a68d0c6a2b394b15e9064e404842a1989"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv4_timestamp" ref="a68d0c6a2b394b15e9064e404842a1989" args="(uint8_t type, uint8_t code, uint16_t sum, uint16_t id, uint16_t seq, uint32_t otime, uint32_t rtime, uint32_t ttime, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3264: <div class="memitem">
! 3265: <div class="memproto">
! 3266: <table class="memname">
1.1 misho 3267: <tr>
1.1.1.2 ! misho 3268: <td class="memname">libnet_ptag_t libnet_build_icmpv4_timestamp </td>
! 3269: <td>(</td>
! 3270: <td class="paramtype">uint8_t </td>
! 3271: <td class="paramname"><em>type</em>, </td>
1.1 misho 3272: </tr>
3273: <tr>
1.1.1.2 ! misho 3274: <td class="paramkey"></td>
1.1 misho 3275: <td></td>
1.1.1.2 ! misho 3276: <td class="paramtype">uint8_t </td>
! 3277: <td class="paramname"><em>code</em>, </td>
1.1 misho 3278: </tr>
3279: <tr>
1.1.1.2 ! misho 3280: <td class="paramkey"></td>
1.1 misho 3281: <td></td>
1.1.1.2 ! misho 3282: <td class="paramtype">uint16_t </td>
! 3283: <td class="paramname"><em>sum</em>, </td>
1.1 misho 3284: </tr>
3285: <tr>
1.1.1.2 ! misho 3286: <td class="paramkey"></td>
1.1 misho 3287: <td></td>
1.1.1.2 ! misho 3288: <td class="paramtype">uint16_t </td>
! 3289: <td class="paramname"><em>id</em>, </td>
1.1 misho 3290: </tr>
3291: <tr>
1.1.1.2 ! misho 3292: <td class="paramkey"></td>
1.1 misho 3293: <td></td>
1.1.1.2 ! misho 3294: <td class="paramtype">uint16_t </td>
! 3295: <td class="paramname"><em>seq</em>, </td>
1.1 misho 3296: </tr>
3297: <tr>
1.1.1.2 ! misho 3298: <td class="paramkey"></td>
1.1 misho 3299: <td></td>
1.1.1.2 ! misho 3300: <td class="paramtype">uint32_t </td>
! 3301: <td class="paramname"><em>otime</em>, </td>
1.1 misho 3302: </tr>
3303: <tr>
1.1.1.2 ! misho 3304: <td class="paramkey"></td>
1.1 misho 3305: <td></td>
1.1.1.2 ! misho 3306: <td class="paramtype">uint32_t </td>
! 3307: <td class="paramname"><em>rtime</em>, </td>
1.1 misho 3308: </tr>
3309: <tr>
1.1.1.2 ! misho 3310: <td class="paramkey"></td>
1.1 misho 3311: <td></td>
1.1.1.2 ! misho 3312: <td class="paramtype">uint32_t </td>
! 3313: <td class="paramname"><em>ttime</em>, </td>
1.1 misho 3314: </tr>
3315: <tr>
1.1.1.2 ! misho 3316: <td class="paramkey"></td>
1.1 misho 3317: <td></td>
1.1.1.2 ! misho 3318: <td class="paramtype">const uint8_t * </td>
! 3319: <td class="paramname"><em>payload</em>, </td>
1.1 misho 3320: </tr>
3321: <tr>
1.1.1.2 ! misho 3322: <td class="paramkey"></td>
1.1 misho 3323: <td></td>
1.1.1.2 ! misho 3324: <td class="paramtype">uint32_t </td>
! 3325: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3326: </tr>
3327: <tr>
1.1.1.2 ! misho 3328: <td class="paramkey"></td>
1.1 misho 3329: <td></td>
1.1.1.2 ! misho 3330: <td class="paramtype">libnet_t * </td>
! 3331: <td class="paramname"><em>l</em>, </td>
1.1 misho 3332: </tr>
3333: <tr>
1.1.1.2 ! misho 3334: <td class="paramkey"></td>
1.1 misho 3335: <td></td>
1.1.1.2 ! misho 3336: <td class="paramtype">libnet_ptag_t </td>
! 3337: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3338: </tr>
3339: <tr>
3340: <td></td>
1.1.1.2 ! misho 3341: <td>)</td>
! 3342: <td></td><td></td>
1.1 misho 3343: </tr>
1.1.1.2 ! misho 3344: </table>
! 3345: </div>
! 3346: <div class="memdoc">
! 3347: <p>Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) timestamp request/reply header. </p>
! 3348: <dl><dt><b>Parameters:</b></dt><dd>
! 3349: <table class="params">
! 3350: <tr><td class="paramname">type</td><td>type of ICMP packet (should be ICMP_TSTAMP or ICMP_TSTAMPREPLY) </td></tr>
! 3351: <tr><td class="paramname">code</td><td>code of ICMP packet (should be 0) </td></tr>
! 3352: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3353: <tr><td class="paramname">id</td><td>identification number </td></tr>
! 3354: <tr><td class="paramname">seq</td><td>sequence number </td></tr>
! 3355: <tr><td class="paramname">otime</td><td>originate timestamp </td></tr>
! 3356: <tr><td class="paramname">rtime</td><td>receive timestamp </td></tr>
! 3357: <tr><td class="paramname">ttime</td><td>transmit timestamp </td></tr>
! 3358: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3359: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3360: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3361: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3362: </table>
! 3363: </dd>
! 3364: </dl>
! 3365: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3366:
! 3367: </div>
! 3368: </div>
! 3369: <a class="anchor" id="aeb4d9c27fe201737ba139dde6c5c0f2e"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv4_unreach" ref="aeb4d9c27fe201737ba139dde6c5c0f2e" args="(uint8_t type, uint8_t code, uint16_t sum, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3370: <div class="memitem">
! 3371: <div class="memproto">
! 3372: <table class="memname">
1.1 misho 3373: <tr>
1.1.1.2 ! misho 3374: <td class="memname">libnet_ptag_t libnet_build_icmpv4_unreach </td>
! 3375: <td>(</td>
! 3376: <td class="paramtype">uint8_t </td>
! 3377: <td class="paramname"><em>type</em>, </td>
1.1 misho 3378: </tr>
3379: <tr>
1.1.1.2 ! misho 3380: <td class="paramkey"></td>
1.1 misho 3381: <td></td>
1.1.1.2 ! misho 3382: <td class="paramtype">uint8_t </td>
! 3383: <td class="paramname"><em>code</em>, </td>
1.1 misho 3384: </tr>
3385: <tr>
1.1.1.2 ! misho 3386: <td class="paramkey"></td>
1.1 misho 3387: <td></td>
1.1.1.2 ! misho 3388: <td class="paramtype">uint16_t </td>
! 3389: <td class="paramname"><em>sum</em>, </td>
1.1 misho 3390: </tr>
3391: <tr>
1.1.1.2 ! misho 3392: <td class="paramkey"></td>
1.1 misho 3393: <td></td>
1.1.1.2 ! misho 3394: <td class="paramtype">const uint8_t * </td>
! 3395: <td class="paramname"><em>payload</em>, </td>
1.1 misho 3396: </tr>
3397: <tr>
1.1.1.2 ! misho 3398: <td class="paramkey"></td>
1.1 misho 3399: <td></td>
1.1.1.2 ! misho 3400: <td class="paramtype">uint32_t </td>
! 3401: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3402: </tr>
3403: <tr>
1.1.1.2 ! misho 3404: <td class="paramkey"></td>
1.1 misho 3405: <td></td>
1.1.1.2 ! misho 3406: <td class="paramtype">libnet_t * </td>
! 3407: <td class="paramname"><em>l</em>, </td>
1.1 misho 3408: </tr>
3409: <tr>
1.1.1.2 ! misho 3410: <td class="paramkey"></td>
1.1 misho 3411: <td></td>
1.1.1.2 ! misho 3412: <td class="paramtype">libnet_ptag_t </td>
! 3413: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3414: </tr>
3415: <tr>
3416: <td></td>
1.1.1.2 ! misho 3417: <td>)</td>
! 3418: <td></td><td></td>
1.1 misho 3419: </tr>
3420: </table>
1.1.1.2 ! misho 3421: </div>
! 3422: <div class="memdoc">
! 3423: <p>Builds an IP version 4 RFC 792 Internet Control Message Protocol (ICMP) unreachable header. The IP header that caused the error message should be built by a previous call to <a class="el" href="libnet-functions_8h.html#a326cf29f24a37dc9232b8b6a56a3f12f">libnet_build_ipv4()</a>. </p>
! 3424: <dl><dt><b>Parameters:</b></dt><dd>
! 3425: <table class="params">
! 3426: <tr><td class="paramname">type</td><td>type of ICMP packet (should be ICMP_UNREACH) </td></tr>
! 3427: <tr><td class="paramname">code</td><td>code of ICMP packet (should be one of the 16 unreachable codes) </td></tr>
! 3428: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3429: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3430: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3431: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3432: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3433: </table>
! 3434: </dd>
! 3435: </dl>
! 3436: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3437:
! 3438: </div>
! 3439: </div>
! 3440: <a class="anchor" id="ab25c002229189641d723847c6fd06f5a"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv6_echo" ref="ab25c002229189641d723847c6fd06f5a" args="(uint8_t type, uint8_t code, uint16_t sum, uint16_t id, uint16_t seq, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3441: <div class="memitem">
! 3442: <div class="memproto">
! 3443: <table class="memname">
1.1 misho 3444: <tr>
1.1.1.2 ! misho 3445: <td class="memname">libnet_ptag_t libnet_build_icmpv6_echo </td>
! 3446: <td>(</td>
! 3447: <td class="paramtype">uint8_t </td>
! 3448: <td class="paramname"><em>type</em>, </td>
1.1 misho 3449: </tr>
3450: <tr>
1.1.1.2 ! misho 3451: <td class="paramkey"></td>
1.1 misho 3452: <td></td>
1.1.1.2 ! misho 3453: <td class="paramtype">uint8_t </td>
! 3454: <td class="paramname"><em>code</em>, </td>
1.1 misho 3455: </tr>
3456: <tr>
1.1.1.2 ! misho 3457: <td class="paramkey"></td>
1.1 misho 3458: <td></td>
1.1.1.2 ! misho 3459: <td class="paramtype">uint16_t </td>
! 3460: <td class="paramname"><em>sum</em>, </td>
1.1 misho 3461: </tr>
3462: <tr>
1.1.1.2 ! misho 3463: <td class="paramkey"></td>
1.1 misho 3464: <td></td>
1.1.1.2 ! misho 3465: <td class="paramtype">uint16_t </td>
! 3466: <td class="paramname"><em>id</em>, </td>
1.1 misho 3467: </tr>
3468: <tr>
1.1.1.2 ! misho 3469: <td class="paramkey"></td>
1.1 misho 3470: <td></td>
1.1.1.2 ! misho 3471: <td class="paramtype">uint16_t </td>
! 3472: <td class="paramname"><em>seq</em>, </td>
1.1 misho 3473: </tr>
3474: <tr>
1.1.1.2 ! misho 3475: <td class="paramkey"></td>
1.1 misho 3476: <td></td>
1.1.1.2 ! misho 3477: <td class="paramtype">uint8_t * </td>
! 3478: <td class="paramname"><em>payload</em>, </td>
1.1 misho 3479: </tr>
3480: <tr>
1.1.1.2 ! misho 3481: <td class="paramkey"></td>
1.1 misho 3482: <td></td>
1.1.1.2 ! misho 3483: <td class="paramtype">uint32_t </td>
! 3484: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3485: </tr>
3486: <tr>
1.1.1.2 ! misho 3487: <td class="paramkey"></td>
1.1 misho 3488: <td></td>
1.1.1.2 ! misho 3489: <td class="paramtype">libnet_t * </td>
! 3490: <td class="paramname"><em>l</em>, </td>
1.1 misho 3491: </tr>
3492: <tr>
1.1.1.2 ! misho 3493: <td class="paramkey"></td>
1.1 misho 3494: <td></td>
1.1.1.2 ! misho 3495: <td class="paramtype">libnet_ptag_t </td>
! 3496: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3497: </tr>
3498: <tr>
3499: <td></td>
1.1.1.2 ! misho 3500: <td>)</td>
! 3501: <td></td><td></td>
1.1 misho 3502: </tr>
1.1.1.2 ! misho 3503: </table>
! 3504: </div>
! 3505: <div class="memdoc">
! 3506: <p>Builds an IP version 6 RFC 4443 Internet Control Message Protocol (ICMP) echo or echo reply header. </p>
! 3507: <dl><dt><b>Parameters:</b></dt><dd>
! 3508: <table class="params">
! 3509: <tr><td class="paramname">type</td><td>type of ICMP packet (should be ICMP6_ECHO_REQUEST or ICMP6_ECHO_REPLY) </td></tr>
! 3510: <tr><td class="paramname">code</td><td>code of ICMP packet (should be zero) </td></tr>
! 3511: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3512: <tr><td class="paramname">id</td><td>echo id number </td></tr>
! 3513: <tr><td class="paramname">seq</td><td>echo sequence number </td></tr>
! 3514: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3515: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3516: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3517: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3518: </table>
! 3519: </dd>
! 3520: </dl>
! 3521: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3522:
! 3523: </div>
! 3524: </div>
! 3525: <a class="anchor" id="a8351efc0261c66660b362e16a68f9001"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv6_ndp_nadv" ref="a8351efc0261c66660b362e16a68f9001" args="(uint8_t type, uint8_t code, uint16_t sum, uint32_t flags, struct libnet_in6_addr target, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3526: <div class="memitem">
! 3527: <div class="memproto">
! 3528: <table class="memname">
1.1 misho 3529: <tr>
1.1.1.2 ! misho 3530: <td class="memname">libnet_ptag_t libnet_build_icmpv6_ndp_nadv </td>
! 3531: <td>(</td>
! 3532: <td class="paramtype">uint8_t </td>
! 3533: <td class="paramname"><em>type</em>, </td>
1.1 misho 3534: </tr>
3535: <tr>
1.1.1.2 ! misho 3536: <td class="paramkey"></td>
1.1 misho 3537: <td></td>
1.1.1.2 ! misho 3538: <td class="paramtype">uint8_t </td>
! 3539: <td class="paramname"><em>code</em>, </td>
1.1 misho 3540: </tr>
3541: <tr>
1.1.1.2 ! misho 3542: <td class="paramkey"></td>
1.1 misho 3543: <td></td>
1.1.1.2 ! misho 3544: <td class="paramtype">uint16_t </td>
! 3545: <td class="paramname"><em>sum</em>, </td>
1.1 misho 3546: </tr>
3547: <tr>
1.1.1.2 ! misho 3548: <td class="paramkey"></td>
1.1 misho 3549: <td></td>
1.1.1.2 ! misho 3550: <td class="paramtype">uint32_t </td>
! 3551: <td class="paramname"><em>flags</em>, </td>
! 3552: </tr>
! 3553: <tr>
! 3554: <td class="paramkey"></td>
1.1 misho 3555: <td></td>
1.1.1.2 ! misho 3556: <td class="paramtype">struct libnet_in6_addr </td>
! 3557: <td class="paramname"><em>target</em>, </td>
1.1 misho 3558: </tr>
3559: <tr>
1.1.1.2 ! misho 3560: <td class="paramkey"></td>
1.1 misho 3561: <td></td>
1.1.1.2 ! misho 3562: <td class="paramtype">uint8_t * </td>
! 3563: <td class="paramname"><em>payload</em>, </td>
! 3564: </tr>
! 3565: <tr>
! 3566: <td class="paramkey"></td>
1.1 misho 3567: <td></td>
1.1.1.2 ! misho 3568: <td class="paramtype">uint32_t </td>
! 3569: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3570: </tr>
3571: <tr>
1.1.1.2 ! misho 3572: <td class="paramkey"></td>
1.1 misho 3573: <td></td>
1.1.1.2 ! misho 3574: <td class="paramtype">libnet_t * </td>
! 3575: <td class="paramname"><em>l</em>, </td>
! 3576: </tr>
! 3577: <tr>
! 3578: <td class="paramkey"></td>
1.1 misho 3579: <td></td>
1.1.1.2 ! misho 3580: <td class="paramtype">libnet_ptag_t </td>
! 3581: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3582: </tr>
3583: <tr>
3584: <td></td>
1.1.1.2 ! misho 3585: <td>)</td>
! 3586: <td></td><td></td>
1.1 misho 3587: </tr>
3588: </table>
1.1.1.2 ! misho 3589: </div>
! 3590: <div class="memdoc">
! 3591: <p>Builds an IP version 6 RFC 2461 Internet Control Message Protocol (ICMP) NDP neighbour advertisement header. Could be used with <a class="el" href="libnet-functions_8h.html#a0ac427a5e4fe8281724fd17619c0db12">libnet_build_icmpv6_ndp_opt()</a> and ND_OPT_TARGET_LINKADDR. </p>
! 3592: <dl><dt><b>Parameters:</b></dt><dd>
! 3593: <table class="params">
! 3594: <tr><td class="paramname">type</td><td>type of ICMP packet (should be ND_NEIGHBOR_ADVERT) </td></tr>
! 3595: <tr><td class="paramname">code</td><td>code of ICMP packet (should be zero) </td></tr>
! 3596: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3597: <tr><td class="paramname">flags</td><td>should be a bitwise or of any applicable ND_NA_FLAG_* flags </td></tr>
! 3598: <tr><td class="paramname">target</td><td>target ipv6 address </td></tr>
! 3599: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3600: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3601: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3602: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3603: </table>
! 3604: </dd>
! 3605: </dl>
! 3606: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3607:
! 3608: </div>
! 3609: </div>
! 3610: <a class="anchor" id="a806d7200cc479b065f7a26d1057b4fcd"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv6_ndp_nsol" ref="a806d7200cc479b065f7a26d1057b4fcd" args="(uint8_t type, uint8_t code, uint16_t sum, struct libnet_in6_addr target, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3611: <div class="memitem">
! 3612: <div class="memproto">
! 3613: <table class="memname">
1.1 misho 3614: <tr>
1.1.1.2 ! misho 3615: <td class="memname">libnet_ptag_t libnet_build_icmpv6_ndp_nsol </td>
! 3616: <td>(</td>
! 3617: <td class="paramtype">uint8_t </td>
! 3618: <td class="paramname"><em>type</em>, </td>
1.1 misho 3619: </tr>
3620: <tr>
1.1.1.2 ! misho 3621: <td class="paramkey"></td>
1.1 misho 3622: <td></td>
1.1.1.2 ! misho 3623: <td class="paramtype">uint8_t </td>
! 3624: <td class="paramname"><em>code</em>, </td>
1.1 misho 3625: </tr>
3626: <tr>
1.1.1.2 ! misho 3627: <td class="paramkey"></td>
1.1 misho 3628: <td></td>
1.1.1.2 ! misho 3629: <td class="paramtype">uint16_t </td>
! 3630: <td class="paramname"><em>sum</em>, </td>
1.1 misho 3631: </tr>
3632: <tr>
1.1.1.2 ! misho 3633: <td class="paramkey"></td>
1.1 misho 3634: <td></td>
1.1.1.2 ! misho 3635: <td class="paramtype">struct libnet_in6_addr </td>
! 3636: <td class="paramname"><em>target</em>, </td>
1.1 misho 3637: </tr>
3638: <tr>
1.1.1.2 ! misho 3639: <td class="paramkey"></td>
1.1 misho 3640: <td></td>
1.1.1.2 ! misho 3641: <td class="paramtype">uint8_t * </td>
! 3642: <td class="paramname"><em>payload</em>, </td>
1.1 misho 3643: </tr>
3644: <tr>
1.1.1.2 ! misho 3645: <td class="paramkey"></td>
1.1 misho 3646: <td></td>
1.1.1.2 ! misho 3647: <td class="paramtype">uint32_t </td>
! 3648: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3649: </tr>
3650: <tr>
1.1.1.2 ! misho 3651: <td class="paramkey"></td>
1.1 misho 3652: <td></td>
1.1.1.2 ! misho 3653: <td class="paramtype">libnet_t * </td>
! 3654: <td class="paramname"><em>l</em>, </td>
1.1 misho 3655: </tr>
3656: <tr>
1.1.1.2 ! misho 3657: <td class="paramkey"></td>
1.1 misho 3658: <td></td>
1.1.1.2 ! misho 3659: <td class="paramtype">libnet_ptag_t </td>
! 3660: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3661: </tr>
3662: <tr>
3663: <td></td>
1.1.1.2 ! misho 3664: <td>)</td>
! 3665: <td></td><td></td>
1.1 misho 3666: </tr>
3667: </table>
1.1.1.2 ! misho 3668: </div>
! 3669: <div class="memdoc">
! 3670: <p>Builds an IP version 6 RFC 2461 Internet Control Message Protocol (ICMP) NDP neighbour solicitation header. Could be used with <a class="el" href="libnet-functions_8h.html#a0ac427a5e4fe8281724fd17619c0db12">libnet_build_icmpv6_ndp_opt()</a> and ICMPV6_NDP_OPT_SLLA. </p>
! 3671: <dl><dt><b>Parameters:</b></dt><dd>
! 3672: <table class="params">
! 3673: <tr><td class="paramname">type</td><td>type of ICMP packet (should be ND_NEIGHBOR_SOLICIT) </td></tr>
! 3674: <tr><td class="paramname">code</td><td>code of ICMP packet (should be zero) </td></tr>
! 3675: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3676: <tr><td class="paramname">target</td><td>target ipv6 address </td></tr>
! 3677: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3678: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3679: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3680: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3681: </table>
! 3682: </dd>
! 3683: </dl>
! 3684: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3685:
! 3686: </div>
! 3687: </div>
! 3688: <a class="anchor" id="a0ac427a5e4fe8281724fd17619c0db12"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv6_ndp_opt" ref="a0ac427a5e4fe8281724fd17619c0db12" args="(uint8_t type, uint8_t *option, uint32_t option_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3689: <div class="memitem">
! 3690: <div class="memproto">
! 3691: <table class="memname">
1.1 misho 3692: <tr>
1.1.1.2 ! misho 3693: <td class="memname">libnet_ptag_t libnet_build_icmpv6_ndp_opt </td>
! 3694: <td>(</td>
! 3695: <td class="paramtype">uint8_t </td>
! 3696: <td class="paramname"><em>type</em>, </td>
1.1 misho 3697: </tr>
3698: <tr>
1.1.1.2 ! misho 3699: <td class="paramkey"></td>
1.1 misho 3700: <td></td>
1.1.1.2 ! misho 3701: <td class="paramtype">uint8_t * </td>
! 3702: <td class="paramname"><em>option</em>, </td>
1.1 misho 3703: </tr>
3704: <tr>
1.1.1.2 ! misho 3705: <td class="paramkey"></td>
1.1 misho 3706: <td></td>
1.1.1.2 ! misho 3707: <td class="paramtype">uint32_t </td>
! 3708: <td class="paramname"><em>option_s</em>, </td>
1.1 misho 3709: </tr>
3710: <tr>
1.1.1.2 ! misho 3711: <td class="paramkey"></td>
1.1 misho 3712: <td></td>
1.1.1.2 ! misho 3713: <td class="paramtype">libnet_t * </td>
! 3714: <td class="paramname"><em>l</em>, </td>
1.1 misho 3715: </tr>
3716: <tr>
1.1.1.2 ! misho 3717: <td class="paramkey"></td>
1.1 misho 3718: <td></td>
1.1.1.2 ! misho 3719: <td class="paramtype">libnet_ptag_t </td>
! 3720: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3721: </tr>
3722: <tr>
3723: <td></td>
1.1.1.2 ! misho 3724: <td>)</td>
! 3725: <td></td><td></td>
! 3726: </tr>
! 3727: </table>
! 3728: </div>
! 3729: <div class="memdoc">
! 3730: <p>Builds ICMPv6 NDP options. </p>
! 3731: <dl><dt><b>Parameters:</b></dt><dd>
! 3732: <table class="params">
! 3733: <tr><td class="paramname">type</td><td>one of ND_OPT_* types </td></tr>
! 3734: <tr><td class="paramname">option</td><td>option data </td></tr>
! 3735: <tr><td class="paramname">option_s</td><td>size of option data (will be padded out to an 8-byte boundary) </td></tr>
! 3736: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3737: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3738: </table>
! 3739: </dd>
! 3740: </dl>
! 3741: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3742:
! 3743: </div>
! 3744: </div>
! 3745: <a class="anchor" id="a4e46b8ea4becc7fe4d10fc1af6a5aefa"></a><!-- doxytag: member="libnet-functions.h::libnet_build_icmpv6_unreach" ref="a4e46b8ea4becc7fe4d10fc1af6a5aefa" args="(uint8_t type, uint8_t code, uint16_t sum, uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3746: <div class="memitem">
! 3747: <div class="memproto">
! 3748: <table class="memname">
! 3749: <tr>
! 3750: <td class="memname">libnet_ptag_t libnet_build_icmpv6_unreach </td>
! 3751: <td>(</td>
! 3752: <td class="paramtype">uint8_t </td>
! 3753: <td class="paramname"><em>type</em>, </td>
1.1 misho 3754: </tr>
3755: <tr>
1.1.1.2 ! misho 3756: <td class="paramkey"></td>
1.1 misho 3757: <td></td>
1.1.1.2 ! misho 3758: <td class="paramtype">uint8_t </td>
! 3759: <td class="paramname"><em>code</em>, </td>
1.1 misho 3760: </tr>
3761: <tr>
1.1.1.2 ! misho 3762: <td class="paramkey"></td>
1.1 misho 3763: <td></td>
1.1.1.2 ! misho 3764: <td class="paramtype">uint16_t </td>
! 3765: <td class="paramname"><em>sum</em>, </td>
1.1 misho 3766: </tr>
3767: <tr>
1.1.1.2 ! misho 3768: <td class="paramkey"></td>
1.1 misho 3769: <td></td>
1.1.1.2 ! misho 3770: <td class="paramtype">uint8_t * </td>
! 3771: <td class="paramname"><em>payload</em>, </td>
! 3772: </tr>
! 3773: <tr>
! 3774: <td class="paramkey"></td>
1.1 misho 3775: <td></td>
1.1.1.2 ! misho 3776: <td class="paramtype">uint32_t </td>
! 3777: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3778: </tr>
3779: <tr>
1.1.1.2 ! misho 3780: <td class="paramkey"></td>
1.1 misho 3781: <td></td>
1.1.1.2 ! misho 3782: <td class="paramtype">libnet_t * </td>
! 3783: <td class="paramname"><em>l</em>, </td>
! 3784: </tr>
! 3785: <tr>
! 3786: <td class="paramkey"></td>
1.1 misho 3787: <td></td>
1.1.1.2 ! misho 3788: <td class="paramtype">libnet_ptag_t </td>
! 3789: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3790: </tr>
3791: <tr>
3792: <td></td>
1.1.1.2 ! misho 3793: <td>)</td>
! 3794: <td></td><td></td>
1.1 misho 3795: </tr>
3796: </table>
1.1.1.2 ! misho 3797: </div>
! 3798: <div class="memdoc">
! 3799: <p>Builds an IP version 6 RFC 4443 Internet Control Message Protocol (ICMP) unreachable header. The IP header that caused the error message should be built by a previous call to <a class="el" href="libnet-functions_8h.html#ae568214e9b386ca23e6628431eda1f7e">libnet_build_ipv6()</a>. </p>
! 3800: <dl><dt><b>Parameters:</b></dt><dd>
! 3801: <table class="params">
! 3802: <tr><td class="paramname">type</td><td>type of ICMP packet (should be ICMP6_DST_UNREACH) </td></tr>
! 3803: <tr><td class="paramname">code</td><td>code of ICMP packet (should be one of the 5 ICMP6_DST_UNREACH_* codes) </td></tr>
! 3804: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3805: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3806: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3807: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3808: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3809: </table>
! 3810: </dd>
! 3811: </dl>
! 3812: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3813:
! 3814: </div>
! 3815: </div>
! 3816: <a class="anchor" id="a66590b72b65d46bf15544327235edc66"></a><!-- doxytag: member="libnet-functions.h::libnet_build_igmp" ref="a66590b72b65d46bf15544327235edc66" args="(uint8_t type, uint8_t reserved, uint16_t sum, uint32_t ip, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3817: <div class="memitem">
! 3818: <div class="memproto">
! 3819: <table class="memname">
1.1 misho 3820: <tr>
1.1.1.2 ! misho 3821: <td class="memname">libnet_ptag_t libnet_build_igmp </td>
! 3822: <td>(</td>
! 3823: <td class="paramtype">uint8_t </td>
! 3824: <td class="paramname"><em>type</em>, </td>
1.1 misho 3825: </tr>
3826: <tr>
1.1.1.2 ! misho 3827: <td class="paramkey"></td>
1.1 misho 3828: <td></td>
1.1.1.2 ! misho 3829: <td class="paramtype">uint8_t </td>
! 3830: <td class="paramname"><em>reserved</em>, </td>
1.1 misho 3831: </tr>
3832: <tr>
1.1.1.2 ! misho 3833: <td class="paramkey"></td>
1.1 misho 3834: <td></td>
1.1.1.2 ! misho 3835: <td class="paramtype">uint16_t </td>
! 3836: <td class="paramname"><em>sum</em>, </td>
1.1 misho 3837: </tr>
3838: <tr>
1.1.1.2 ! misho 3839: <td class="paramkey"></td>
1.1 misho 3840: <td></td>
1.1.1.2 ! misho 3841: <td class="paramtype">uint32_t </td>
! 3842: <td class="paramname"><em>ip</em>, </td>
1.1 misho 3843: </tr>
3844: <tr>
1.1.1.2 ! misho 3845: <td class="paramkey"></td>
1.1 misho 3846: <td></td>
1.1.1.2 ! misho 3847: <td class="paramtype">const uint8_t * </td>
! 3848: <td class="paramname"><em>payload</em>, </td>
1.1 misho 3849: </tr>
3850: <tr>
1.1.1.2 ! misho 3851: <td class="paramkey"></td>
1.1 misho 3852: <td></td>
1.1.1.2 ! misho 3853: <td class="paramtype">uint32_t </td>
! 3854: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3855: </tr>
3856: <tr>
1.1.1.2 ! misho 3857: <td class="paramkey"></td>
1.1 misho 3858: <td></td>
1.1.1.2 ! misho 3859: <td class="paramtype">libnet_t * </td>
! 3860: <td class="paramname"><em>l</em>, </td>
! 3861: </tr>
! 3862: <tr>
! 3863: <td class="paramkey"></td>
1.1 misho 3864: <td></td>
1.1.1.2 ! misho 3865: <td class="paramtype">libnet_ptag_t </td>
! 3866: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3867: </tr>
3868: <tr>
3869: <td></td>
1.1.1.2 ! misho 3870: <td>)</td>
! 3871: <td></td><td></td>
1.1 misho 3872: </tr>
3873: </table>
1.1.1.2 ! misho 3874: </div>
! 3875: <div class="memdoc">
! 3876: <p>Builds an RFC 1112 Internet Group Memebership Protocol (IGMP) header. </p>
! 3877: <dl><dt><b>Parameters:</b></dt><dd>
! 3878: <table class="params">
! 3879: <tr><td class="paramname">type</td><td>packet type </td></tr>
! 3880: <tr><td class="paramname">reserved</td><td>(should be 0 for IGMPv1) </td></tr>
! 3881: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 3882: <tr><td class="paramname">ip</td><td>IPv4 address (in standard/network byte order) </td></tr>
! 3883: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3884: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3885: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3886: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3887: </table>
! 3888: </dd>
! 3889: </dl>
! 3890: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error</dd></dl>
! 3891: <dl class="note"><dt><b>Note:</b></dt><dd>'reserved' was previously called 'code', which it is not, in any IGMP version. </dd></dl>
! 3892:
! 3893: </div>
! 3894: </div>
! 3895: <a class="anchor" id="a9506a46bfe340f8284ae58656a02c574"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ipsec_ah" ref="a9506a46bfe340f8284ae58656a02c574" args="(uint8_t nh, uint8_t len, uint16_t res, uint32_t spi, uint32_t seq, uint32_t auth, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3896: <div class="memitem">
! 3897: <div class="memproto">
! 3898: <table class="memname">
1.1 misho 3899: <tr>
1.1.1.2 ! misho 3900: <td class="memname">libnet_ptag_t libnet_build_ipsec_ah </td>
! 3901: <td>(</td>
! 3902: <td class="paramtype">uint8_t </td>
! 3903: <td class="paramname"><em>nh</em>, </td>
1.1 misho 3904: </tr>
3905: <tr>
1.1.1.2 ! misho 3906: <td class="paramkey"></td>
1.1 misho 3907: <td></td>
1.1.1.2 ! misho 3908: <td class="paramtype">uint8_t </td>
! 3909: <td class="paramname"><em>len</em>, </td>
1.1 misho 3910: </tr>
3911: <tr>
1.1.1.2 ! misho 3912: <td class="paramkey"></td>
1.1 misho 3913: <td></td>
1.1.1.2 ! misho 3914: <td class="paramtype">uint16_t </td>
! 3915: <td class="paramname"><em>res</em>, </td>
1.1 misho 3916: </tr>
3917: <tr>
1.1.1.2 ! misho 3918: <td class="paramkey"></td>
1.1 misho 3919: <td></td>
1.1.1.2 ! misho 3920: <td class="paramtype">uint32_t </td>
! 3921: <td class="paramname"><em>spi</em>, </td>
1.1 misho 3922: </tr>
3923: <tr>
1.1.1.2 ! misho 3924: <td class="paramkey"></td>
1.1 misho 3925: <td></td>
1.1.1.2 ! misho 3926: <td class="paramtype">uint32_t </td>
! 3927: <td class="paramname"><em>seq</em>, </td>
1.1 misho 3928: </tr>
3929: <tr>
1.1.1.2 ! misho 3930: <td class="paramkey"></td>
1.1 misho 3931: <td></td>
1.1.1.2 ! misho 3932: <td class="paramtype">uint32_t </td>
! 3933: <td class="paramname"><em>auth</em>, </td>
! 3934: </tr>
! 3935: <tr>
! 3936: <td class="paramkey"></td>
! 3937: <td></td>
! 3938: <td class="paramtype">const uint8_t * </td>
! 3939: <td class="paramname"><em>payload</em>, </td>
! 3940: </tr>
! 3941: <tr>
! 3942: <td class="paramkey"></td>
1.1 misho 3943: <td></td>
1.1.1.2 ! misho 3944: <td class="paramtype">uint32_t </td>
! 3945: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 3946: </tr>
3947: <tr>
1.1.1.2 ! misho 3948: <td class="paramkey"></td>
1.1 misho 3949: <td></td>
1.1.1.2 ! misho 3950: <td class="paramtype">libnet_t * </td>
! 3951: <td class="paramname"><em>l</em>, </td>
! 3952: </tr>
! 3953: <tr>
! 3954: <td class="paramkey"></td>
1.1 misho 3955: <td></td>
1.1.1.2 ! misho 3956: <td class="paramtype">libnet_ptag_t </td>
! 3957: <td class="paramname"><em>ptag</em> </td>
1.1 misho 3958: </tr>
3959: <tr>
3960: <td></td>
1.1.1.2 ! misho 3961: <td>)</td>
! 3962: <td></td><td></td>
1.1 misho 3963: </tr>
3964: </table>
1.1.1.2 ! misho 3965: </div>
! 3966: <div class="memdoc">
! 3967: <p>Builds an Internet Protocol Security Authentication header. </p>
! 3968: <dl><dt><b>Parameters:</b></dt><dd>
! 3969: <table class="params">
! 3970: <tr><td class="paramname">nh</td><td>next header </td></tr>
! 3971: <tr><td class="paramname">len</td><td>payload length </td></tr>
! 3972: <tr><td class="paramname">res</td><td>reserved </td></tr>
! 3973: <tr><td class="paramname">spi</td><td>security parameter index </td></tr>
! 3974: <tr><td class="paramname">seq</td><td>sequence number </td></tr>
! 3975: <tr><td class="paramname">auth</td><td>authentication data </td></tr>
! 3976: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 3977: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 3978: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 3979: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 3980: </table>
! 3981: </dd>
! 3982: </dl>
! 3983: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 3984:
! 3985: </div>
! 3986: </div>
! 3987: <a class="anchor" id="a277c0db9a61ea2d24b58b452df0edda0"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ipsec_esp_ftr" ref="a277c0db9a61ea2d24b58b452df0edda0" args="(uint8_t len, uint8_t nh, int8_t *auth, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 3988: <div class="memitem">
! 3989: <div class="memproto">
! 3990: <table class="memname">
1.1 misho 3991: <tr>
1.1.1.2 ! misho 3992: <td class="memname">libnet_ptag_t libnet_build_ipsec_esp_ftr </td>
! 3993: <td>(</td>
! 3994: <td class="paramtype">uint8_t </td>
! 3995: <td class="paramname"><em>len</em>, </td>
1.1 misho 3996: </tr>
3997: <tr>
1.1.1.2 ! misho 3998: <td class="paramkey"></td>
1.1 misho 3999: <td></td>
1.1.1.2 ! misho 4000: <td class="paramtype">uint8_t </td>
! 4001: <td class="paramname"><em>nh</em>, </td>
1.1 misho 4002: </tr>
4003: <tr>
1.1.1.2 ! misho 4004: <td class="paramkey"></td>
1.1 misho 4005: <td></td>
1.1.1.2 ! misho 4006: <td class="paramtype">int8_t * </td>
! 4007: <td class="paramname"><em>auth</em>, </td>
1.1 misho 4008: </tr>
4009: <tr>
1.1.1.2 ! misho 4010: <td class="paramkey"></td>
1.1 misho 4011: <td></td>
1.1.1.2 ! misho 4012: <td class="paramtype">const uint8_t * </td>
! 4013: <td class="paramname"><em>payload</em>, </td>
1.1 misho 4014: </tr>
4015: <tr>
1.1.1.2 ! misho 4016: <td class="paramkey"></td>
1.1 misho 4017: <td></td>
1.1.1.2 ! misho 4018: <td class="paramtype">uint32_t </td>
! 4019: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4020: </tr>
4021: <tr>
1.1.1.2 ! misho 4022: <td class="paramkey"></td>
1.1 misho 4023: <td></td>
1.1.1.2 ! misho 4024: <td class="paramtype">libnet_t * </td>
! 4025: <td class="paramname"><em>l</em>, </td>
1.1 misho 4026: </tr>
4027: <tr>
1.1.1.2 ! misho 4028: <td class="paramkey"></td>
1.1 misho 4029: <td></td>
1.1.1.2 ! misho 4030: <td class="paramtype">libnet_ptag_t </td>
! 4031: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4032: </tr>
4033: <tr>
4034: <td></td>
1.1.1.2 ! misho 4035: <td>)</td>
! 4036: <td></td><td></td>
! 4037: </tr>
! 4038: </table>
! 4039: </div>
! 4040: <div class="memdoc">
! 4041: <p>Builds an Internet Protocol Security Encapsulating Security Payload footer. </p>
! 4042: <dl><dt><b>Parameters:</b></dt><dd>
! 4043: <table class="params">
! 4044: <tr><td class="paramname">len</td><td>padding length </td></tr>
! 4045: <tr><td class="paramname">nh</td><td>next header </td></tr>
! 4046: <tr><td class="paramname">auth</td><td>authentication data </td></tr>
! 4047: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 4048: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 4049: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4050: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4051: </table>
! 4052: </dd>
! 4053: </dl>
! 4054: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4055:
! 4056: </div>
! 4057: </div>
! 4058: <a class="anchor" id="ad75f92207cb45587e18e898b344c7600"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ipsec_esp_hdr" ref="ad75f92207cb45587e18e898b344c7600" args="(uint32_t spi, uint32_t seq, uint32_t iv, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4059: <div class="memitem">
! 4060: <div class="memproto">
! 4061: <table class="memname">
! 4062: <tr>
! 4063: <td class="memname">libnet_ptag_t libnet_build_ipsec_esp_hdr </td>
! 4064: <td>(</td>
! 4065: <td class="paramtype">uint32_t </td>
! 4066: <td class="paramname"><em>spi</em>, </td>
1.1 misho 4067: </tr>
4068: <tr>
1.1.1.2 ! misho 4069: <td class="paramkey"></td>
1.1 misho 4070: <td></td>
1.1.1.2 ! misho 4071: <td class="paramtype">uint32_t </td>
! 4072: <td class="paramname"><em>seq</em>, </td>
1.1 misho 4073: </tr>
4074: <tr>
1.1.1.2 ! misho 4075: <td class="paramkey"></td>
1.1 misho 4076: <td></td>
1.1.1.2 ! misho 4077: <td class="paramtype">uint32_t </td>
! 4078: <td class="paramname"><em>iv</em>, </td>
1.1 misho 4079: </tr>
4080: <tr>
1.1.1.2 ! misho 4081: <td class="paramkey"></td>
1.1 misho 4082: <td></td>
1.1.1.2 ! misho 4083: <td class="paramtype">const uint8_t * </td>
! 4084: <td class="paramname"><em>payload</em>, </td>
1.1 misho 4085: </tr>
4086: <tr>
1.1.1.2 ! misho 4087: <td class="paramkey"></td>
1.1 misho 4088: <td></td>
1.1.1.2 ! misho 4089: <td class="paramtype">uint32_t </td>
! 4090: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4091: </tr>
4092: <tr>
1.1.1.2 ! misho 4093: <td class="paramkey"></td>
1.1 misho 4094: <td></td>
1.1.1.2 ! misho 4095: <td class="paramtype">libnet_t * </td>
! 4096: <td class="paramname"><em>l</em>, </td>
! 4097: </tr>
! 4098: <tr>
! 4099: <td class="paramkey"></td>
1.1 misho 4100: <td></td>
1.1.1.2 ! misho 4101: <td class="paramtype">libnet_ptag_t </td>
! 4102: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4103: </tr>
4104: <tr>
4105: <td></td>
1.1.1.2 ! misho 4106: <td>)</td>
! 4107: <td></td><td></td>
1.1 misho 4108: </tr>
4109: </table>
1.1.1.2 ! misho 4110: </div>
! 4111: <div class="memdoc">
! 4112: <p>Builds an Internet Protocol Security Encapsulating Security Payload header. </p>
! 4113: <dl><dt><b>Parameters:</b></dt><dd>
! 4114: <table class="params">
! 4115: <tr><td class="paramname">spi</td><td>security parameter index </td></tr>
! 4116: <tr><td class="paramname">seq</td><td>ESP sequence number </td></tr>
! 4117: <tr><td class="paramname">iv</td><td>initialization vector </td></tr>
! 4118: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 4119: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 4120: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4121: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4122: </table>
! 4123: </dd>
! 4124: </dl>
! 4125: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4126:
! 4127: </div>
! 4128: </div>
! 4129: <a class="anchor" id="a326cf29f24a37dc9232b8b6a56a3f12f"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ipv4" ref="a326cf29f24a37dc9232b8b6a56a3f12f" args="(uint16_t ip_len, uint8_t tos, uint16_t id, uint16_t frag, uint8_t ttl, uint8_t prot, uint16_t sum, uint32_t src, uint32_t dst, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4130: <div class="memitem">
! 4131: <div class="memproto">
! 4132: <table class="memname">
1.1 misho 4133: <tr>
1.1.1.2 ! misho 4134: <td class="memname">libnet_ptag_t libnet_build_ipv4 </td>
! 4135: <td>(</td>
! 4136: <td class="paramtype">uint16_t </td>
! 4137: <td class="paramname"><em>ip_len</em>, </td>
1.1 misho 4138: </tr>
4139: <tr>
1.1.1.2 ! misho 4140: <td class="paramkey"></td>
1.1 misho 4141: <td></td>
1.1.1.2 ! misho 4142: <td class="paramtype">uint8_t </td>
! 4143: <td class="paramname"><em>tos</em>, </td>
1.1 misho 4144: </tr>
4145: <tr>
1.1.1.2 ! misho 4146: <td class="paramkey"></td>
1.1 misho 4147: <td></td>
1.1.1.2 ! misho 4148: <td class="paramtype">uint16_t </td>
! 4149: <td class="paramname"><em>id</em>, </td>
1.1 misho 4150: </tr>
4151: <tr>
1.1.1.2 ! misho 4152: <td class="paramkey"></td>
1.1 misho 4153: <td></td>
1.1.1.2 ! misho 4154: <td class="paramtype">uint16_t </td>
! 4155: <td class="paramname"><em>frag</em>, </td>
1.1 misho 4156: </tr>
4157: <tr>
1.1.1.2 ! misho 4158: <td class="paramkey"></td>
1.1 misho 4159: <td></td>
1.1.1.2 ! misho 4160: <td class="paramtype">uint8_t </td>
! 4161: <td class="paramname"><em>ttl</em>, </td>
1.1 misho 4162: </tr>
4163: <tr>
1.1.1.2 ! misho 4164: <td class="paramkey"></td>
! 4165: <td></td>
! 4166: <td class="paramtype">uint8_t </td>
! 4167: <td class="paramname"><em>prot</em>, </td>
1.1 misho 4168: </tr>
4169: <tr>
1.1.1.2 ! misho 4170: <td class="paramkey"></td>
1.1 misho 4171: <td></td>
1.1.1.2 ! misho 4172: <td class="paramtype">uint16_t </td>
! 4173: <td class="paramname"><em>sum</em>, </td>
1.1 misho 4174: </tr>
4175: <tr>
1.1.1.2 ! misho 4176: <td class="paramkey"></td>
1.1 misho 4177: <td></td>
1.1.1.2 ! misho 4178: <td class="paramtype">uint32_t </td>
! 4179: <td class="paramname"><em>src</em>, </td>
1.1 misho 4180: </tr>
4181: <tr>
1.1.1.2 ! misho 4182: <td class="paramkey"></td>
1.1 misho 4183: <td></td>
1.1.1.2 ! misho 4184: <td class="paramtype">uint32_t </td>
! 4185: <td class="paramname"><em>dst</em>, </td>
1.1 misho 4186: </tr>
4187: <tr>
1.1.1.2 ! misho 4188: <td class="paramkey"></td>
1.1 misho 4189: <td></td>
1.1.1.2 ! misho 4190: <td class="paramtype">const uint8_t * </td>
! 4191: <td class="paramname"><em>payload</em>, </td>
1.1 misho 4192: </tr>
4193: <tr>
1.1.1.2 ! misho 4194: <td class="paramkey"></td>
1.1 misho 4195: <td></td>
1.1.1.2 ! misho 4196: <td class="paramtype">uint32_t </td>
! 4197: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4198: </tr>
4199: <tr>
1.1.1.2 ! misho 4200: <td class="paramkey"></td>
1.1 misho 4201: <td></td>
1.1.1.2 ! misho 4202: <td class="paramtype">libnet_t * </td>
! 4203: <td class="paramname"><em>l</em>, </td>
1.1 misho 4204: </tr>
4205: <tr>
1.1.1.2 ! misho 4206: <td class="paramkey"></td>
1.1 misho 4207: <td></td>
1.1.1.2 ! misho 4208: <td class="paramtype">libnet_ptag_t </td>
! 4209: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4210: </tr>
4211: <tr>
4212: <td></td>
1.1.1.2 ! misho 4213: <td>)</td>
! 4214: <td></td><td></td>
! 4215: </tr>
! 4216: </table>
! 4217: </div>
! 4218: <div class="memdoc">
! 4219: <p>Builds a version 4 RFC 791 Internet Protocol (IP) header.</p>
! 4220: <dl><dt><b>Parameters:</b></dt><dd>
! 4221: <table class="params">
! 4222: <tr><td class="paramname">ip_len</td><td>total length of the IP packet including all subsequent data (subsequent data includes any IP options and IP options padding) </td></tr>
! 4223: <tr><td class="paramname">tos</td><td>type of service bits </td></tr>
! 4224: <tr><td class="paramname">id</td><td>IP identification number </td></tr>
! 4225: <tr><td class="paramname">frag</td><td>fragmentation bits and offset </td></tr>
! 4226: <tr><td class="paramname">ttl</td><td>time to live in the network </td></tr>
! 4227: <tr><td class="paramname">prot</td><td>upper layer protocol </td></tr>
! 4228: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 4229: <tr><td class="paramname">src</td><td>source IPv4 address (little endian) </td></tr>
! 4230: <tr><td class="paramname">dst</td><td>destination IPv4 address (little endian) </td></tr>
! 4231: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 4232: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 4233: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4234: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4235: </table>
! 4236: </dd>
! 4237: </dl>
! 4238: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4239:
! 4240: </div>
! 4241: </div>
! 4242: <a class="anchor" id="af1e1c66ed14370114d61ca919d558092"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ipv4_options" ref="af1e1c66ed14370114d61ca919d558092" args="(const uint8_t *options, uint32_t options_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4243: <div class="memitem">
! 4244: <div class="memproto">
! 4245: <table class="memname">
! 4246: <tr>
! 4247: <td class="memname">libnet_ptag_t libnet_build_ipv4_options </td>
! 4248: <td>(</td>
! 4249: <td class="paramtype">const uint8_t * </td>
! 4250: <td class="paramname"><em>options</em>, </td>
1.1 misho 4251: </tr>
4252: <tr>
1.1.1.2 ! misho 4253: <td class="paramkey"></td>
1.1 misho 4254: <td></td>
1.1.1.2 ! misho 4255: <td class="paramtype">uint32_t </td>
! 4256: <td class="paramname"><em>options_s</em>, </td>
1.1 misho 4257: </tr>
4258: <tr>
1.1.1.2 ! misho 4259: <td class="paramkey"></td>
1.1 misho 4260: <td></td>
1.1.1.2 ! misho 4261: <td class="paramtype">libnet_t * </td>
! 4262: <td class="paramname"><em>l</em>, </td>
! 4263: </tr>
! 4264: <tr>
! 4265: <td class="paramkey"></td>
1.1 misho 4266: <td></td>
1.1.1.2 ! misho 4267: <td class="paramtype">libnet_ptag_t </td>
! 4268: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4269: </tr>
4270: <tr>
4271: <td></td>
1.1.1.2 ! misho 4272: <td>)</td>
! 4273: <td></td><td></td>
1.1 misho 4274: </tr>
4275: </table>
1.1.1.2 ! misho 4276: </div>
! 4277: <div class="memdoc">
! 4278: <p>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).</p>
! 4279: <p>When building a chain, the options must be built, then the IPv4 header.</p>
! 4280: <p>When updating a chain, if the block following the options is an IPv4 header, it's total length and header length will be updated if the options block size changes.</p>
! 4281: <dl><dt><b>Parameters:</b></dt><dd>
! 4282: <table class="params">
! 4283: <tr><td class="paramname">options</td><td>byte string of IP options (it will be padded up to be an integral multiple of 32-bit words). </td></tr>
! 4284: <tr><td class="paramname">options_s</td><td>length of options string </td></tr>
! 4285: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4286: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4287: </table>
! 4288: </dd>
! 4289: </dl>
! 4290: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4291:
! 4292: </div>
! 4293: </div>
! 4294: <a class="anchor" id="ae568214e9b386ca23e6628431eda1f7e"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ipv6" ref="ae568214e9b386ca23e6628431eda1f7e" args="(uint8_t tc, uint32_t fl, uint16_t len, uint8_t nh, uint8_t hl, struct libnet_in6_addr src, struct libnet_in6_addr dst, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4295: <div class="memitem">
! 4296: <div class="memproto">
! 4297: <table class="memname">
1.1 misho 4298: <tr>
1.1.1.2 ! misho 4299: <td class="memname">libnet_ptag_t libnet_build_ipv6 </td>
! 4300: <td>(</td>
! 4301: <td class="paramtype">uint8_t </td>
! 4302: <td class="paramname"><em>tc</em>, </td>
1.1 misho 4303: </tr>
4304: <tr>
1.1.1.2 ! misho 4305: <td class="paramkey"></td>
1.1 misho 4306: <td></td>
1.1.1.2 ! misho 4307: <td class="paramtype">uint32_t </td>
! 4308: <td class="paramname"><em>fl</em>, </td>
! 4309: </tr>
! 4310: <tr>
! 4311: <td class="paramkey"></td>
1.1 misho 4312: <td></td>
1.1.1.2 ! misho 4313: <td class="paramtype">uint16_t </td>
! 4314: <td class="paramname"><em>len</em>, </td>
1.1 misho 4315: </tr>
4316: <tr>
1.1.1.2 ! misho 4317: <td class="paramkey"></td>
1.1 misho 4318: <td></td>
1.1.1.2 ! misho 4319: <td class="paramtype">uint8_t </td>
! 4320: <td class="paramname"><em>nh</em>, </td>
! 4321: </tr>
! 4322: <tr>
! 4323: <td class="paramkey"></td>
1.1 misho 4324: <td></td>
1.1.1.2 ! misho 4325: <td class="paramtype">uint8_t </td>
! 4326: <td class="paramname"><em>hl</em>, </td>
1.1 misho 4327: </tr>
4328: <tr>
1.1.1.2 ! misho 4329: <td class="paramkey"></td>
1.1 misho 4330: <td></td>
1.1.1.2 ! misho 4331: <td class="paramtype">struct libnet_in6_addr </td>
! 4332: <td class="paramname"><em>src</em>, </td>
! 4333: </tr>
! 4334: <tr>
! 4335: <td class="paramkey"></td>
1.1 misho 4336: <td></td>
1.1.1.2 ! misho 4337: <td class="paramtype">struct libnet_in6_addr </td>
! 4338: <td class="paramname"><em>dst</em>, </td>
1.1 misho 4339: </tr>
4340: <tr>
1.1.1.2 ! misho 4341: <td class="paramkey"></td>
1.1 misho 4342: <td></td>
1.1.1.2 ! misho 4343: <td class="paramtype">const uint8_t * </td>
! 4344: <td class="paramname"><em>payload</em>, </td>
! 4345: </tr>
! 4346: <tr>
! 4347: <td class="paramkey"></td>
1.1 misho 4348: <td></td>
1.1.1.2 ! misho 4349: <td class="paramtype">uint32_t </td>
! 4350: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4351: </tr>
4352: <tr>
1.1.1.2 ! misho 4353: <td class="paramkey"></td>
1.1 misho 4354: <td></td>
1.1.1.2 ! misho 4355: <td class="paramtype">libnet_t * </td>
! 4356: <td class="paramname"><em>l</em>, </td>
! 4357: </tr>
! 4358: <tr>
! 4359: <td class="paramkey"></td>
1.1 misho 4360: <td></td>
1.1.1.2 ! misho 4361: <td class="paramtype">libnet_ptag_t </td>
! 4362: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4363: </tr>
4364: <tr>
4365: <td></td>
1.1.1.2 ! misho 4366: <td>)</td>
! 4367: <td></td><td></td>
1.1 misho 4368: </tr>
4369: </table>
1.1.1.2 ! misho 4370: </div>
! 4371: <div class="memdoc">
! 4372: <p>Builds a version 6 RFC 2460 Internet Protocol (IP) header. </p>
! 4373: <dl><dt><b>Parameters:</b></dt><dd>
! 4374: <table class="params">
! 4375: <tr><td class="paramname">tc</td><td>traffic class </td></tr>
! 4376: <tr><td class="paramname">fl</td><td>flow label </td></tr>
! 4377: <tr><td class="paramname">len</td><td>total length of the IP packet </td></tr>
! 4378: <tr><td class="paramname">nh</td><td>next header </td></tr>
! 4379: <tr><td class="paramname">hl</td><td>hop limit </td></tr>
! 4380: <tr><td class="paramname">src</td><td>source IPv6 address </td></tr>
! 4381: <tr><td class="paramname">dst</td><td>destination IPv6 address </td></tr>
! 4382: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 4383: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 4384: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4385: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4386: </table>
! 4387: </dd>
! 4388: </dl>
! 4389: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4390:
! 4391: </div>
! 4392: </div>
! 4393: <a class="anchor" id="a463971e2d708f4e14f2ed9bea7f197be"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ipv6_destopts" ref="a463971e2d708f4e14f2ed9bea7f197be" args="(uint8_t nh, uint8_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4394: <div class="memitem">
! 4395: <div class="memproto">
! 4396: <table class="memname">
1.1 misho 4397: <tr>
1.1.1.2 ! misho 4398: <td class="memname">libnet_ptag_t libnet_build_ipv6_destopts </td>
! 4399: <td>(</td>
! 4400: <td class="paramtype">uint8_t </td>
! 4401: <td class="paramname"><em>nh</em>, </td>
1.1 misho 4402: </tr>
4403: <tr>
1.1.1.2 ! misho 4404: <td class="paramkey"></td>
1.1 misho 4405: <td></td>
1.1.1.2 ! misho 4406: <td class="paramtype">uint8_t </td>
! 4407: <td class="paramname"><em>len</em>, </td>
1.1 misho 4408: </tr>
4409: <tr>
1.1.1.2 ! misho 4410: <td class="paramkey"></td>
1.1 misho 4411: <td></td>
1.1.1.2 ! misho 4412: <td class="paramtype">const uint8_t * </td>
! 4413: <td class="paramname"><em>payload</em>, </td>
! 4414: </tr>
! 4415: <tr>
! 4416: <td class="paramkey"></td>
1.1 misho 4417: <td></td>
1.1.1.2 ! misho 4418: <td class="paramtype">uint32_t </td>
! 4419: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4420: </tr>
4421: <tr>
1.1.1.2 ! misho 4422: <td class="paramkey"></td>
1.1 misho 4423: <td></td>
1.1.1.2 ! misho 4424: <td class="paramtype">libnet_t * </td>
! 4425: <td class="paramname"><em>l</em>, </td>
! 4426: </tr>
! 4427: <tr>
! 4428: <td class="paramkey"></td>
1.1 misho 4429: <td></td>
1.1.1.2 ! misho 4430: <td class="paramtype">libnet_ptag_t </td>
! 4431: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4432: </tr>
4433: <tr>
4434: <td></td>
1.1.1.2 ! misho 4435: <td>)</td>
! 4436: <td></td><td></td>
! 4437: </tr>
! 4438: </table>
! 4439: </div>
! 4440: <div class="memdoc">
! 4441: <p>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. </p>
! 4442: <dl><dt><b>Parameters:</b></dt><dd>
! 4443: <table class="params">
! 4444: <tr><td class="paramname">nh</td><td>next header </td></tr>
! 4445: <tr><td class="paramname">len</td><td>length of the header in 8-byte octets not including the first 8 octets </td></tr>
! 4446: <tr><td class="paramname">payload</td><td>options payload </td></tr>
! 4447: <tr><td class="paramname">payload_s</td><td>payload length </td></tr>
! 4448: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4449: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4450: </table>
! 4451: </dd>
! 4452: </dl>
! 4453: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4454:
! 4455: </div>
! 4456: </div>
! 4457: <a class="anchor" id="a16867e9f92b162ff4c00a5587fd3377d"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ipv6_frag" ref="a16867e9f92b162ff4c00a5587fd3377d" args="(uint8_t nh, uint8_t reserved, uint16_t frag, uint32_t id, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4458: <div class="memitem">
! 4459: <div class="memproto">
! 4460: <table class="memname">
! 4461: <tr>
! 4462: <td class="memname">libnet_ptag_t libnet_build_ipv6_frag </td>
! 4463: <td>(</td>
! 4464: <td class="paramtype">uint8_t </td>
! 4465: <td class="paramname"><em>nh</em>, </td>
! 4466: </tr>
! 4467: <tr>
! 4468: <td class="paramkey"></td>
1.1 misho 4469: <td></td>
1.1.1.2 ! misho 4470: <td class="paramtype">uint8_t </td>
! 4471: <td class="paramname"><em>reserved</em>, </td>
1.1 misho 4472: </tr>
4473: <tr>
1.1.1.2 ! misho 4474: <td class="paramkey"></td>
1.1 misho 4475: <td></td>
1.1.1.2 ! misho 4476: <td class="paramtype">uint16_t </td>
! 4477: <td class="paramname"><em>frag</em>, </td>
! 4478: </tr>
! 4479: <tr>
! 4480: <td class="paramkey"></td>
1.1 misho 4481: <td></td>
1.1.1.2 ! misho 4482: <td class="paramtype">uint32_t </td>
! 4483: <td class="paramname"><em>id</em>, </td>
1.1 misho 4484: </tr>
4485: <tr>
1.1.1.2 ! misho 4486: <td class="paramkey"></td>
1.1 misho 4487: <td></td>
1.1.1.2 ! misho 4488: <td class="paramtype">const uint8_t * </td>
! 4489: <td class="paramname"><em>payload</em>, </td>
! 4490: </tr>
! 4491: <tr>
! 4492: <td class="paramkey"></td>
1.1 misho 4493: <td></td>
1.1.1.2 ! misho 4494: <td class="paramtype">uint32_t </td>
! 4495: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4496: </tr>
4497: <tr>
1.1.1.2 ! misho 4498: <td class="paramkey"></td>
1.1 misho 4499: <td></td>
1.1.1.2 ! misho 4500: <td class="paramtype">libnet_t * </td>
! 4501: <td class="paramname"><em>l</em>, </td>
! 4502: </tr>
! 4503: <tr>
! 4504: <td class="paramkey"></td>
1.1 misho 4505: <td></td>
1.1.1.2 ! misho 4506: <td class="paramtype">libnet_ptag_t </td>
! 4507: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4508: </tr>
4509: <tr>
4510: <td></td>
1.1.1.2 ! misho 4511: <td>)</td>
! 4512: <td></td><td></td>
1.1 misho 4513: </tr>
4514: </table>
1.1.1.2 ! misho 4515: </div>
! 4516: <div class="memdoc">
! 4517: <p>Builds a version 6 RFC 2460 Internet Protocol (IP) fragmentation header. </p>
! 4518: <dl><dt><b>Parameters:</b></dt><dd>
! 4519: <table class="params">
! 4520: <tr><td class="paramname">nh</td><td>next header </td></tr>
! 4521: <tr><td class="paramname">reserved</td><td>unused value... OR IS IT! </td></tr>
! 4522: <tr><td class="paramname">frag</td><td>fragmentation bits (ala ipv4) </td></tr>
! 4523: <tr><td class="paramname">id</td><td>packet identification </td></tr>
! 4524: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 4525: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 4526: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4527: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4528: </table>
! 4529: </dd>
! 4530: </dl>
! 4531: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4532:
! 4533: </div>
! 4534: </div>
! 4535: <a class="anchor" id="accbcb7a6342997afd1a5410c7006f748"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ipv6_hbhopts" ref="accbcb7a6342997afd1a5410c7006f748" args="(uint8_t nh, uint8_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4536: <div class="memitem">
! 4537: <div class="memproto">
! 4538: <table class="memname">
1.1 misho 4539: <tr>
1.1.1.2 ! misho 4540: <td class="memname">libnet_ptag_t libnet_build_ipv6_hbhopts </td>
! 4541: <td>(</td>
! 4542: <td class="paramtype">uint8_t </td>
! 4543: <td class="paramname"><em>nh</em>, </td>
1.1 misho 4544: </tr>
4545: <tr>
1.1.1.2 ! misho 4546: <td class="paramkey"></td>
1.1 misho 4547: <td></td>
1.1.1.2 ! misho 4548: <td class="paramtype">uint8_t </td>
! 4549: <td class="paramname"><em>len</em>, </td>
1.1 misho 4550: </tr>
4551: <tr>
1.1.1.2 ! misho 4552: <td class="paramkey"></td>
1.1 misho 4553: <td></td>
1.1.1.2 ! misho 4554: <td class="paramtype">const uint8_t * </td>
! 4555: <td class="paramname"><em>payload</em>, </td>
1.1 misho 4556: </tr>
4557: <tr>
1.1.1.2 ! misho 4558: <td class="paramkey"></td>
1.1 misho 4559: <td></td>
1.1.1.2 ! misho 4560: <td class="paramtype">uint32_t </td>
! 4561: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4562: </tr>
4563: <tr>
1.1.1.2 ! misho 4564: <td class="paramkey"></td>
1.1 misho 4565: <td></td>
1.1.1.2 ! misho 4566: <td class="paramtype">libnet_t * </td>
! 4567: <td class="paramname"><em>l</em>, </td>
1.1 misho 4568: </tr>
4569: <tr>
1.1.1.2 ! misho 4570: <td class="paramkey"></td>
1.1 misho 4571: <td></td>
1.1.1.2 ! misho 4572: <td class="paramtype">libnet_ptag_t </td>
! 4573: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4574: </tr>
4575: <tr>
4576: <td></td>
1.1.1.2 ! misho 4577: <td>)</td>
! 4578: <td></td><td></td>
1.1 misho 4579: </tr>
4580: </table>
1.1.1.2 ! misho 4581: </div>
! 4582: <div class="memdoc">
! 4583: <p>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. </p>
! 4584: <dl><dt><b>Parameters:</b></dt><dd>
! 4585: <table class="params">
! 4586: <tr><td class="paramname">nh</td><td>next header </td></tr>
! 4587: <tr><td class="paramname">len</td><td>length of the header in 8-byte octets not including the first 8 octets </td></tr>
! 4588: <tr><td class="paramname">payload</td><td>options payload </td></tr>
! 4589: <tr><td class="paramname">payload_s</td><td>payload length </td></tr>
! 4590: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4591: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4592: </table>
! 4593: </dd>
! 4594: </dl>
! 4595: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4596:
! 4597: </div>
! 4598: </div>
! 4599: <a class="anchor" id="a0aeda945e0b6d1ce4bee591107d8887b"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ipv6_routing" ref="a0aeda945e0b6d1ce4bee591107d8887b" args="(uint8_t nh, uint8_t len, uint8_t rtype, uint8_t segments, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4600: <div class="memitem">
! 4601: <div class="memproto">
! 4602: <table class="memname">
1.1 misho 4603: <tr>
1.1.1.2 ! misho 4604: <td class="memname">libnet_ptag_t libnet_build_ipv6_routing </td>
! 4605: <td>(</td>
! 4606: <td class="paramtype">uint8_t </td>
! 4607: <td class="paramname"><em>nh</em>, </td>
1.1 misho 4608: </tr>
4609: <tr>
1.1.1.2 ! misho 4610: <td class="paramkey"></td>
1.1 misho 4611: <td></td>
1.1.1.2 ! misho 4612: <td class="paramtype">uint8_t </td>
! 4613: <td class="paramname"><em>len</em>, </td>
1.1 misho 4614: </tr>
4615: <tr>
1.1.1.2 ! misho 4616: <td class="paramkey"></td>
1.1 misho 4617: <td></td>
1.1.1.2 ! misho 4618: <td class="paramtype">uint8_t </td>
! 4619: <td class="paramname"><em>rtype</em>, </td>
1.1 misho 4620: </tr>
4621: <tr>
1.1.1.2 ! misho 4622: <td class="paramkey"></td>
1.1 misho 4623: <td></td>
1.1.1.2 ! misho 4624: <td class="paramtype">uint8_t </td>
! 4625: <td class="paramname"><em>segments</em>, </td>
1.1 misho 4626: </tr>
4627: <tr>
1.1.1.2 ! misho 4628: <td class="paramkey"></td>
1.1 misho 4629: <td></td>
1.1.1.2 ! misho 4630: <td class="paramtype">const uint8_t * </td>
! 4631: <td class="paramname"><em>payload</em>, </td>
1.1 misho 4632: </tr>
4633: <tr>
1.1.1.2 ! misho 4634: <td class="paramkey"></td>
1.1 misho 4635: <td></td>
1.1.1.2 ! misho 4636: <td class="paramtype">uint32_t </td>
! 4637: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4638: </tr>
4639: <tr>
1.1.1.2 ! misho 4640: <td class="paramkey"></td>
1.1 misho 4641: <td></td>
1.1.1.2 ! misho 4642: <td class="paramtype">libnet_t * </td>
! 4643: <td class="paramname"><em>l</em>, </td>
1.1 misho 4644: </tr>
4645: <tr>
1.1.1.2 ! misho 4646: <td class="paramkey"></td>
1.1 misho 4647: <td></td>
1.1.1.2 ! misho 4648: <td class="paramtype">libnet_ptag_t </td>
! 4649: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4650: </tr>
4651: <tr>
4652: <td></td>
1.1.1.2 ! misho 4653: <td>)</td>
! 4654: <td></td><td></td>
1.1 misho 4655: </tr>
4656: </table>
1.1.1.2 ! misho 4657: </div>
! 4658: <div class="memdoc">
! 4659: <p>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. </p>
! 4660: <dl><dt><b>Parameters:</b></dt><dd>
! 4661: <table class="params">
! 4662: <tr><td class="paramname">nh</td><td>next header </td></tr>
! 4663: <tr><td class="paramname">len</td><td>length of the header in 8-byte octets not including the first 8 octets </td></tr>
! 4664: <tr><td class="paramname">rtype</td><td>routing header type </td></tr>
! 4665: <tr><td class="paramname">segments</td><td>number of routing segments that follow </td></tr>
! 4666: <tr><td class="paramname">payload</td><td>optional payload of routing information </td></tr>
! 4667: <tr><td class="paramname">payload_s</td><td>payload length </td></tr>
! 4668: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4669: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4670: </table>
! 4671: </dd>
! 4672: </dl>
! 4673: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4674:
! 4675: </div>
! 4676: </div>
! 4677: <a class="anchor" id="a8c3b2833b869c4628240bb5be8b7c864"></a><!-- doxytag: member="libnet-functions.h::libnet_build_isl" ref="a8c3b2833b869c4628240bb5be8b7c864" args="(uint8_t *dhost, uint8_t type, uint8_t user, uint8_t *shost, uint16_t len, const uint8_t *snap, uint16_t vid, uint16_t portindex, uint16_t reserved, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4678: <div class="memitem">
! 4679: <div class="memproto">
! 4680: <table class="memname">
1.1 misho 4681: <tr>
1.1.1.2 ! misho 4682: <td class="memname">libnet_ptag_t libnet_build_isl </td>
! 4683: <td>(</td>
! 4684: <td class="paramtype">uint8_t * </td>
! 4685: <td class="paramname"><em>dhost</em>, </td>
1.1 misho 4686: </tr>
4687: <tr>
1.1.1.2 ! misho 4688: <td class="paramkey"></td>
1.1 misho 4689: <td></td>
1.1.1.2 ! misho 4690: <td class="paramtype">uint8_t </td>
! 4691: <td class="paramname"><em>type</em>, </td>
1.1 misho 4692: </tr>
4693: <tr>
1.1.1.2 ! misho 4694: <td class="paramkey"></td>
1.1 misho 4695: <td></td>
1.1.1.2 ! misho 4696: <td class="paramtype">uint8_t </td>
! 4697: <td class="paramname"><em>user</em>, </td>
1.1 misho 4698: </tr>
4699: <tr>
1.1.1.2 ! misho 4700: <td class="paramkey"></td>
1.1 misho 4701: <td></td>
1.1.1.2 ! misho 4702: <td class="paramtype">uint8_t * </td>
! 4703: <td class="paramname"><em>shost</em>, </td>
1.1 misho 4704: </tr>
4705: <tr>
1.1.1.2 ! misho 4706: <td class="paramkey"></td>
1.1 misho 4707: <td></td>
1.1.1.2 ! misho 4708: <td class="paramtype">uint16_t </td>
! 4709: <td class="paramname"><em>len</em>, </td>
1.1 misho 4710: </tr>
4711: <tr>
1.1.1.2 ! misho 4712: <td class="paramkey"></td>
1.1 misho 4713: <td></td>
1.1.1.2 ! misho 4714: <td class="paramtype">const uint8_t * </td>
! 4715: <td class="paramname"><em>snap</em>, </td>
1.1 misho 4716: </tr>
4717: <tr>
1.1.1.2 ! misho 4718: <td class="paramkey"></td>
1.1 misho 4719: <td></td>
1.1.1.2 ! misho 4720: <td class="paramtype">uint16_t </td>
! 4721: <td class="paramname"><em>vid</em>, </td>
1.1 misho 4722: </tr>
4723: <tr>
1.1.1.2 ! misho 4724: <td class="paramkey"></td>
1.1 misho 4725: <td></td>
1.1.1.2 ! misho 4726: <td class="paramtype">uint16_t </td>
! 4727: <td class="paramname"><em>portindex</em>, </td>
1.1 misho 4728: </tr>
4729: <tr>
1.1.1.2 ! misho 4730: <td class="paramkey"></td>
1.1 misho 4731: <td></td>
1.1.1.2 ! misho 4732: <td class="paramtype">uint16_t </td>
! 4733: <td class="paramname"><em>reserved</em>, </td>
1.1 misho 4734: </tr>
4735: <tr>
1.1.1.2 ! misho 4736: <td class="paramkey"></td>
1.1 misho 4737: <td></td>
1.1.1.2 ! misho 4738: <td class="paramtype">const uint8_t * </td>
! 4739: <td class="paramname"><em>payload</em>, </td>
1.1 misho 4740: </tr>
4741: <tr>
1.1.1.2 ! misho 4742: <td class="paramkey"></td>
1.1 misho 4743: <td></td>
1.1.1.2 ! misho 4744: <td class="paramtype">uint32_t </td>
! 4745: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4746: </tr>
4747: <tr>
1.1.1.2 ! misho 4748: <td class="paramkey"></td>
1.1 misho 4749: <td></td>
1.1.1.2 ! misho 4750: <td class="paramtype">libnet_t * </td>
! 4751: <td class="paramname"><em>l</em>, </td>
1.1 misho 4752: </tr>
4753: <tr>
1.1.1.2 ! misho 4754: <td class="paramkey"></td>
1.1 misho 4755: <td></td>
1.1.1.2 ! misho 4756: <td class="paramtype">libnet_ptag_t </td>
! 4757: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4758: </tr>
4759: <tr>
4760: <td></td>
1.1.1.2 ! misho 4761: <td>)</td>
! 4762: <td></td><td></td>
1.1 misho 4763: </tr>
4764: </table>
1.1.1.2 ! misho 4765: </div>
! 4766: <div class="memdoc">
! 4767: <p>Builds a Cisco Inter-Switch Link (ISL) header. </p>
! 4768: <dl><dt><b>Parameters:</b></dt><dd>
! 4769: <table class="params">
! 4770: <tr><td class="paramname">dhost</td><td>destination address (should be 01:00:0c:00:00) </td></tr>
! 4771: <tr><td class="paramname">type</td><td>type of frame </td></tr>
! 4772: <tr><td class="paramname">user</td><td>user defined data </td></tr>
! 4773: <tr><td class="paramname">shost</td><td>source mac address </td></tr>
! 4774: <tr><td class="paramname">len</td><td>total length of the encapuslated packet less 18 bytes </td></tr>
! 4775: <tr><td class="paramname">snap</td><td>SNAP information (0xaaaa03 + vendor code) </td></tr>
! 4776: <tr><td class="paramname">vid</td><td>15 bit VLAN ID, 1 bit BPDU or CDP indicator </td></tr>
! 4777: <tr><td class="paramname">portindex</td><td>port index </td></tr>
! 4778: <tr><td class="paramname">reserved</td><td>used for FDDI and token ring </td></tr>
! 4779: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 4780: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 4781: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4782: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4783: </table>
! 4784: </dd>
! 4785: </dl>
! 4786: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4787:
! 4788: </div>
! 4789: </div>
! 4790: <a class="anchor" id="a76a5b279a29e54057b1fb3e3786ce32f"></a><!-- doxytag: member="libnet-functions.h::libnet_build_link" ref="a76a5b279a29e54057b1fb3e3786ce32f" args="(const uint8_t *dst, const uint8_t *src, const uint8_t *oui, uint16_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4791: <div class="memitem">
! 4792: <div class="memproto">
! 4793: <table class="memname">
1.1 misho 4794: <tr>
1.1.1.2 ! misho 4795: <td class="memname">libnet_ptag_t libnet_build_link </td>
! 4796: <td>(</td>
! 4797: <td class="paramtype">const uint8_t * </td>
! 4798: <td class="paramname"><em>dst</em>, </td>
1.1 misho 4799: </tr>
4800: <tr>
1.1.1.2 ! misho 4801: <td class="paramkey"></td>
1.1 misho 4802: <td></td>
1.1.1.2 ! misho 4803: <td class="paramtype">const uint8_t * </td>
! 4804: <td class="paramname"><em>src</em>, </td>
1.1 misho 4805: </tr>
4806: <tr>
1.1.1.2 ! misho 4807: <td class="paramkey"></td>
1.1 misho 4808: <td></td>
1.1.1.2 ! misho 4809: <td class="paramtype">const uint8_t * </td>
! 4810: <td class="paramname"><em>oui</em>, </td>
1.1 misho 4811: </tr>
4812: <tr>
1.1.1.2 ! misho 4813: <td class="paramkey"></td>
1.1 misho 4814: <td></td>
1.1.1.2 ! misho 4815: <td class="paramtype">uint16_t </td>
! 4816: <td class="paramname"><em>type</em>, </td>
1.1 misho 4817: </tr>
4818: <tr>
1.1.1.2 ! misho 4819: <td class="paramkey"></td>
1.1 misho 4820: <td></td>
1.1.1.2 ! misho 4821: <td class="paramtype">const uint8_t * </td>
! 4822: <td class="paramname"><em>payload</em>, </td>
1.1 misho 4823: </tr>
4824: <tr>
1.1.1.2 ! misho 4825: <td class="paramkey"></td>
1.1 misho 4826: <td></td>
1.1.1.2 ! misho 4827: <td class="paramtype">uint32_t </td>
! 4828: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4829: </tr>
4830: <tr>
1.1.1.2 ! misho 4831: <td class="paramkey"></td>
1.1 misho 4832: <td></td>
1.1.1.2 ! misho 4833: <td class="paramtype">libnet_t * </td>
! 4834: <td class="paramname"><em>l</em>, </td>
1.1 misho 4835: </tr>
4836: <tr>
1.1.1.2 ! misho 4837: <td class="paramkey"></td>
1.1 misho 4838: <td></td>
1.1.1.2 ! misho 4839: <td class="paramtype">libnet_ptag_t </td>
! 4840: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4841: </tr>
4842: <tr>
4843: <td></td>
1.1.1.2 ! misho 4844: <td>)</td>
! 4845: <td></td><td></td>
1.1 misho 4846: </tr>
4847: </table>
1.1.1.2 ! misho 4848: </div>
! 4849: <div class="memdoc">
! 4850: <p>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. </p>
! 4851: <dl><dt><b>Parameters:</b></dt><dd>
! 4852: <table class="params">
! 4853: <tr><td class="paramname">dst</td><td>the destination MAC address </td></tr>
! 4854: <tr><td class="paramname">src</td><td>the source MAC address </td></tr>
! 4855: <tr><td class="paramname">oui</td><td>Organizationally Unique Identifier (unused for Ethernet) </td></tr>
! 4856: <tr><td class="paramname">type</td><td>the upper layer protocol type </td></tr>
! 4857: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 4858: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 4859: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4860: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4861: </table>
! 4862: </dd>
! 4863: </dl>
! 4864: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4865:
! 4866: </div>
! 4867: </div>
! 4868: <a class="anchor" id="ada1854f38dd301252fc97c93084ac4eb"></a><!-- doxytag: member="libnet-functions.h::libnet_build_mpls" ref="ada1854f38dd301252fc97c93084ac4eb" args="(uint32_t label, uint8_t experimental, uint8_t bos, uint8_t ttl, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4869: <div class="memitem">
! 4870: <div class="memproto">
! 4871: <table class="memname">
1.1 misho 4872: <tr>
1.1.1.2 ! misho 4873: <td class="memname">libnet_ptag_t libnet_build_mpls </td>
! 4874: <td>(</td>
! 4875: <td class="paramtype">uint32_t </td>
! 4876: <td class="paramname"><em>label</em>, </td>
1.1 misho 4877: </tr>
4878: <tr>
1.1.1.2 ! misho 4879: <td class="paramkey"></td>
1.1 misho 4880: <td></td>
1.1.1.2 ! misho 4881: <td class="paramtype">uint8_t </td>
! 4882: <td class="paramname"><em>experimental</em>, </td>
1.1 misho 4883: </tr>
4884: <tr>
1.1.1.2 ! misho 4885: <td class="paramkey"></td>
1.1 misho 4886: <td></td>
1.1.1.2 ! misho 4887: <td class="paramtype">uint8_t </td>
! 4888: <td class="paramname"><em>bos</em>, </td>
1.1 misho 4889: </tr>
4890: <tr>
1.1.1.2 ! misho 4891: <td class="paramkey"></td>
1.1 misho 4892: <td></td>
1.1.1.2 ! misho 4893: <td class="paramtype">uint8_t </td>
! 4894: <td class="paramname"><em>ttl</em>, </td>
1.1 misho 4895: </tr>
4896: <tr>
1.1.1.2 ! misho 4897: <td class="paramkey"></td>
1.1 misho 4898: <td></td>
1.1.1.2 ! misho 4899: <td class="paramtype">const uint8_t * </td>
! 4900: <td class="paramname"><em>payload</em>, </td>
1.1 misho 4901: </tr>
4902: <tr>
1.1.1.2 ! misho 4903: <td class="paramkey"></td>
1.1 misho 4904: <td></td>
1.1.1.2 ! misho 4905: <td class="paramtype">uint32_t </td>
! 4906: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 4907: </tr>
4908: <tr>
1.1.1.2 ! misho 4909: <td class="paramkey"></td>
1.1 misho 4910: <td></td>
1.1.1.2 ! misho 4911: <td class="paramtype">libnet_t * </td>
! 4912: <td class="paramname"><em>l</em>, </td>
1.1 misho 4913: </tr>
4914: <tr>
1.1.1.2 ! misho 4915: <td class="paramkey"></td>
1.1 misho 4916: <td></td>
1.1.1.2 ! misho 4917: <td class="paramtype">libnet_ptag_t </td>
! 4918: <td class="paramname"><em>ptag</em> </td>
1.1 misho 4919: </tr>
4920: <tr>
4921: <td></td>
1.1.1.2 ! misho 4922: <td>)</td>
! 4923: <td></td><td></td>
1.1 misho 4924: </tr>
4925: </table>
1.1.1.2 ! misho 4926: </div>
! 4927: <div class="memdoc">
! 4928: <p>Builds an RFC 3032 Multi-Protocol Label Switching (MPLS) header. </p>
! 4929: <dl><dt><b>Parameters:</b></dt><dd>
! 4930: <table class="params">
! 4931: <tr><td class="paramname">label</td><td>20-bit label value </td></tr>
! 4932: <tr><td class="paramname">experimental</td><td>3-bit reserved field </td></tr>
! 4933: <tr><td class="paramname">bos</td><td>1-bit bottom of stack identifier </td></tr>
! 4934: <tr><td class="paramname">ttl</td><td>time to live </td></tr>
! 4935: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 4936: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 4937: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 4938: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 4939: </table>
! 4940: </dd>
! 4941: </dl>
! 4942: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 4943:
! 4944: </div>
! 4945: </div>
! 4946: <a class="anchor" id="a8a13581c5722c0ee77c2486465c10275"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ntp" ref="a8a13581c5722c0ee77c2486465c10275" args="(uint8_t leap_indicator, uint8_t version, uint8_t mode, uint8_t stratum, uint8_t poll, uint8_t precision, uint16_t delay_int, uint16_t delay_frac, uint16_t dispersion_int, uint16_t dispersion_frac, uint32_t reference_id, uint32_t ref_ts_int, uint32_t ref_ts_frac, uint32_t orig_ts_int, uint32_t orig_ts_frac, uint32_t rec_ts_int, uint32_t rec_ts_frac, uint32_t xmt_ts_int, uint32_t xmt_ts_frac, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 4947: <div class="memitem">
! 4948: <div class="memproto">
! 4949: <table class="memname">
1.1 misho 4950: <tr>
1.1.1.2 ! misho 4951: <td class="memname">libnet_ptag_t libnet_build_ntp </td>
! 4952: <td>(</td>
! 4953: <td class="paramtype">uint8_t </td>
! 4954: <td class="paramname"><em>leap_indicator</em>, </td>
1.1 misho 4955: </tr>
4956: <tr>
1.1.1.2 ! misho 4957: <td class="paramkey"></td>
1.1 misho 4958: <td></td>
1.1.1.2 ! misho 4959: <td class="paramtype">uint8_t </td>
! 4960: <td class="paramname"><em>version</em>, </td>
1.1 misho 4961: </tr>
4962: <tr>
1.1.1.2 ! misho 4963: <td class="paramkey"></td>
1.1 misho 4964: <td></td>
1.1.1.2 ! misho 4965: <td class="paramtype">uint8_t </td>
! 4966: <td class="paramname"><em>mode</em>, </td>
1.1 misho 4967: </tr>
4968: <tr>
1.1.1.2 ! misho 4969: <td class="paramkey"></td>
1.1 misho 4970: <td></td>
1.1.1.2 ! misho 4971: <td class="paramtype">uint8_t </td>
! 4972: <td class="paramname"><em>stratum</em>, </td>
1.1 misho 4973: </tr>
4974: <tr>
1.1.1.2 ! misho 4975: <td class="paramkey"></td>
1.1 misho 4976: <td></td>
1.1.1.2 ! misho 4977: <td class="paramtype">uint8_t </td>
! 4978: <td class="paramname"><em>poll</em>, </td>
1.1 misho 4979: </tr>
4980: <tr>
1.1.1.2 ! misho 4981: <td class="paramkey"></td>
1.1 misho 4982: <td></td>
1.1.1.2 ! misho 4983: <td class="paramtype">uint8_t </td>
! 4984: <td class="paramname"><em>precision</em>, </td>
1.1 misho 4985: </tr>
4986: <tr>
1.1.1.2 ! misho 4987: <td class="paramkey"></td>
1.1 misho 4988: <td></td>
1.1.1.2 ! misho 4989: <td class="paramtype">uint16_t </td>
! 4990: <td class="paramname"><em>delay_int</em>, </td>
1.1 misho 4991: </tr>
4992: <tr>
1.1.1.2 ! misho 4993: <td class="paramkey"></td>
1.1 misho 4994: <td></td>
1.1.1.2 ! misho 4995: <td class="paramtype">uint16_t </td>
! 4996: <td class="paramname"><em>delay_frac</em>, </td>
1.1 misho 4997: </tr>
4998: <tr>
1.1.1.2 ! misho 4999: <td class="paramkey"></td>
1.1 misho 5000: <td></td>
1.1.1.2 ! misho 5001: <td class="paramtype">uint16_t </td>
! 5002: <td class="paramname"><em>dispersion_int</em>, </td>
1.1 misho 5003: </tr>
5004: <tr>
1.1.1.2 ! misho 5005: <td class="paramkey"></td>
1.1 misho 5006: <td></td>
1.1.1.2 ! misho 5007: <td class="paramtype">uint16_t </td>
! 5008: <td class="paramname"><em>dispersion_frac</em>, </td>
1.1 misho 5009: </tr>
5010: <tr>
1.1.1.2 ! misho 5011: <td class="paramkey"></td>
1.1 misho 5012: <td></td>
1.1.1.2 ! misho 5013: <td class="paramtype">uint32_t </td>
! 5014: <td class="paramname"><em>reference_id</em>, </td>
1.1 misho 5015: </tr>
5016: <tr>
1.1.1.2 ! misho 5017: <td class="paramkey"></td>
1.1 misho 5018: <td></td>
1.1.1.2 ! misho 5019: <td class="paramtype">uint32_t </td>
! 5020: <td class="paramname"><em>ref_ts_int</em>, </td>
1.1 misho 5021: </tr>
5022: <tr>
1.1.1.2 ! misho 5023: <td class="paramkey"></td>
1.1 misho 5024: <td></td>
1.1.1.2 ! misho 5025: <td class="paramtype">uint32_t </td>
! 5026: <td class="paramname"><em>ref_ts_frac</em>, </td>
1.1 misho 5027: </tr>
5028: <tr>
1.1.1.2 ! misho 5029: <td class="paramkey"></td>
1.1 misho 5030: <td></td>
1.1.1.2 ! misho 5031: <td class="paramtype">uint32_t </td>
! 5032: <td class="paramname"><em>orig_ts_int</em>, </td>
1.1 misho 5033: </tr>
5034: <tr>
1.1.1.2 ! misho 5035: <td class="paramkey"></td>
1.1 misho 5036: <td></td>
1.1.1.2 ! misho 5037: <td class="paramtype">uint32_t </td>
! 5038: <td class="paramname"><em>orig_ts_frac</em>, </td>
1.1 misho 5039: </tr>
5040: <tr>
1.1.1.2 ! misho 5041: <td class="paramkey"></td>
1.1 misho 5042: <td></td>
1.1.1.2 ! misho 5043: <td class="paramtype">uint32_t </td>
! 5044: <td class="paramname"><em>rec_ts_int</em>, </td>
1.1 misho 5045: </tr>
5046: <tr>
1.1.1.2 ! misho 5047: <td class="paramkey"></td>
1.1 misho 5048: <td></td>
1.1.1.2 ! misho 5049: <td class="paramtype">uint32_t </td>
! 5050: <td class="paramname"><em>rec_ts_frac</em>, </td>
1.1 misho 5051: </tr>
5052: <tr>
1.1.1.2 ! misho 5053: <td class="paramkey"></td>
1.1 misho 5054: <td></td>
1.1.1.2 ! misho 5055: <td class="paramtype">uint32_t </td>
! 5056: <td class="paramname"><em>xmt_ts_int</em>, </td>
1.1 misho 5057: </tr>
5058: <tr>
1.1.1.2 ! misho 5059: <td class="paramkey"></td>
1.1 misho 5060: <td></td>
1.1.1.2 ! misho 5061: <td class="paramtype">uint32_t </td>
! 5062: <td class="paramname"><em>xmt_ts_frac</em>, </td>
1.1 misho 5063: </tr>
5064: <tr>
1.1.1.2 ! misho 5065: <td class="paramkey"></td>
1.1 misho 5066: <td></td>
1.1.1.2 ! misho 5067: <td class="paramtype">const uint8_t * </td>
! 5068: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5069: </tr>
5070: <tr>
1.1.1.2 ! misho 5071: <td class="paramkey"></td>
1.1 misho 5072: <td></td>
1.1.1.2 ! misho 5073: <td class="paramtype">uint32_t </td>
! 5074: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5075: </tr>
5076: <tr>
1.1.1.2 ! misho 5077: <td class="paramkey"></td>
1.1 misho 5078: <td></td>
1.1.1.2 ! misho 5079: <td class="paramtype">libnet_t * </td>
! 5080: <td class="paramname"><em>l</em>, </td>
1.1 misho 5081: </tr>
5082: <tr>
1.1.1.2 ! misho 5083: <td class="paramkey"></td>
1.1 misho 5084: <td></td>
1.1.1.2 ! misho 5085: <td class="paramtype">libnet_ptag_t </td>
! 5086: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5087: </tr>
5088: <tr>
5089: <td></td>
1.1.1.2 ! misho 5090: <td>)</td>
! 5091: <td></td><td></td>
1.1 misho 5092: </tr>
5093: </table>
1.1.1.2 ! misho 5094: </div>
! 5095: <div class="memdoc">
! 5096: <p>Builds an RFC 958 Network Time Protocol (NTP) header. </p>
! 5097: <dl><dt><b>Parameters:</b></dt><dd>
! 5098: <table class="params">
! 5099: <tr><td class="paramname">leap_indicator</td><td>the leap indicator </td></tr>
! 5100: <tr><td class="paramname">version</td><td>NTP protocol version </td></tr>
! 5101: <tr><td class="paramname">mode</td><td>NTP mode </td></tr>
! 5102: <tr><td class="paramname">stratum</td><td>stratum </td></tr>
! 5103: <tr><td class="paramname">poll</td><td>polling interval </td></tr>
! 5104: <tr><td class="paramname">precision</td><td>precision </td></tr>
! 5105: <tr><td class="paramname">delay_int</td><td>delay interval </td></tr>
! 5106: <tr><td class="paramname">delay_frac</td><td>delay fraction </td></tr>
! 5107: <tr><td class="paramname">dispersion_int</td><td>dispersion interval </td></tr>
! 5108: <tr><td class="paramname">dispersion_frac</td><td>dispersion fraction </td></tr>
! 5109: <tr><td class="paramname">reference_id</td><td>reference id </td></tr>
! 5110: <tr><td class="paramname">ref_ts_int</td><td>reference timestamp integer </td></tr>
! 5111: <tr><td class="paramname">ref_ts_frac</td><td>reference timestamp fraction </td></tr>
! 5112: <tr><td class="paramname">orig_ts_int</td><td>original timestamp integer </td></tr>
! 5113: <tr><td class="paramname">orig_ts_frac</td><td>original timestamp fraction </td></tr>
! 5114: <tr><td class="paramname">rec_ts_int</td><td>receiver timestamp integer </td></tr>
! 5115: <tr><td class="paramname">rec_ts_frac</td><td>reciever timestamp fraction </td></tr>
! 5116: <tr><td class="paramname">xmt_ts_int</td><td>transmit timestamp integer </td></tr>
! 5117: <tr><td class="paramname">xmt_ts_frac</td><td>transmit timestamp integer </td></tr>
! 5118: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5119: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5120: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5121: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5122: </table>
! 5123: </dd>
! 5124: </dl>
! 5125: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5126:
! 5127: </div>
! 5128: </div>
! 5129: <a class="anchor" id="a215924e3d5c0cbcc4479579e45e60b58"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ospfv2" ref="a215924e3d5c0cbcc4479579e45e60b58" args="(uint16_t len, uint8_t type, uint32_t rtr_id, uint32_t area_id, uint16_t sum, uint16_t autype, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5130: <div class="memitem">
! 5131: <div class="memproto">
! 5132: <table class="memname">
1.1 misho 5133: <tr>
1.1.1.2 ! misho 5134: <td class="memname">libnet_ptag_t libnet_build_ospfv2 </td>
! 5135: <td>(</td>
! 5136: <td class="paramtype">uint16_t </td>
! 5137: <td class="paramname"><em>len</em>, </td>
1.1 misho 5138: </tr>
5139: <tr>
1.1.1.2 ! misho 5140: <td class="paramkey"></td>
1.1 misho 5141: <td></td>
1.1.1.2 ! misho 5142: <td class="paramtype">uint8_t </td>
! 5143: <td class="paramname"><em>type</em>, </td>
1.1 misho 5144: </tr>
5145: <tr>
1.1.1.2 ! misho 5146: <td class="paramkey"></td>
1.1 misho 5147: <td></td>
1.1.1.2 ! misho 5148: <td class="paramtype">uint32_t </td>
! 5149: <td class="paramname"><em>rtr_id</em>, </td>
1.1 misho 5150: </tr>
5151: <tr>
1.1.1.2 ! misho 5152: <td class="paramkey"></td>
1.1 misho 5153: <td></td>
1.1.1.2 ! misho 5154: <td class="paramtype">uint32_t </td>
! 5155: <td class="paramname"><em>area_id</em>, </td>
1.1 misho 5156: </tr>
5157: <tr>
1.1.1.2 ! misho 5158: <td class="paramkey"></td>
1.1 misho 5159: <td></td>
1.1.1.2 ! misho 5160: <td class="paramtype">uint16_t </td>
! 5161: <td class="paramname"><em>sum</em>, </td>
1.1 misho 5162: </tr>
5163: <tr>
1.1.1.2 ! misho 5164: <td class="paramkey"></td>
1.1 misho 5165: <td></td>
1.1.1.2 ! misho 5166: <td class="paramtype">uint16_t </td>
! 5167: <td class="paramname"><em>autype</em>, </td>
1.1 misho 5168: </tr>
5169: <tr>
1.1.1.2 ! misho 5170: <td class="paramkey"></td>
1.1 misho 5171: <td></td>
1.1.1.2 ! misho 5172: <td class="paramtype">const uint8_t * </td>
! 5173: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5174: </tr>
5175: <tr>
1.1.1.2 ! misho 5176: <td class="paramkey"></td>
1.1 misho 5177: <td></td>
1.1.1.2 ! misho 5178: <td class="paramtype">uint32_t </td>
! 5179: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5180: </tr>
5181: <tr>
1.1.1.2 ! misho 5182: <td class="paramkey"></td>
1.1 misho 5183: <td></td>
1.1.1.2 ! misho 5184: <td class="paramtype">libnet_t * </td>
! 5185: <td class="paramname"><em>l</em>, </td>
1.1 misho 5186: </tr>
5187: <tr>
1.1.1.2 ! misho 5188: <td class="paramkey"></td>
1.1 misho 5189: <td></td>
1.1.1.2 ! misho 5190: <td class="paramtype">libnet_ptag_t </td>
! 5191: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5192: </tr>
5193: <tr>
5194: <td></td>
1.1.1.2 ! misho 5195: <td>)</td>
! 5196: <td></td><td></td>
1.1 misho 5197: </tr>
5198: </table>
1.1.1.2 ! misho 5199: </div>
! 5200: <div class="memdoc">
! 5201: <dl><dt><b>Parameters:</b></dt><dd>
! 5202: <table class="params">
! 5203: <tr><td class="paramname">len</td><td></td></tr>
! 5204: <tr><td class="paramname">type</td><td></td></tr>
! 5205: <tr><td class="paramname">rtr_id</td><td></td></tr>
! 5206: <tr><td class="paramname">area_id</td><td></td></tr>
! 5207: <tr><td class="paramname">sum</td><td></td></tr>
! 5208: <tr><td class="paramname">autype</td><td></td></tr>
! 5209: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5210: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5211: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5212: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5213: </table>
! 5214: </dd>
! 5215: </dl>
! 5216: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5217:
! 5218: </div>
! 5219: </div>
! 5220: <a class="anchor" id="a08a78bd747a22581c5ab036b73ca8867"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ospfv2_dbd" ref="a08a78bd747a22581c5ab036b73ca8867" args="(uint16_t dgram_len, uint8_t opts, uint8_t type, uint seqnum, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5221: <div class="memitem">
! 5222: <div class="memproto">
! 5223: <table class="memname">
1.1 misho 5224: <tr>
1.1.1.2 ! misho 5225: <td class="memname">libnet_ptag_t libnet_build_ospfv2_dbd </td>
! 5226: <td>(</td>
! 5227: <td class="paramtype">uint16_t </td>
! 5228: <td class="paramname"><em>dgram_len</em>, </td>
1.1 misho 5229: </tr>
5230: <tr>
1.1.1.2 ! misho 5231: <td class="paramkey"></td>
1.1 misho 5232: <td></td>
1.1.1.2 ! misho 5233: <td class="paramtype">uint8_t </td>
! 5234: <td class="paramname"><em>opts</em>, </td>
1.1 misho 5235: </tr>
5236: <tr>
1.1.1.2 ! misho 5237: <td class="paramkey"></td>
1.1 misho 5238: <td></td>
1.1.1.2 ! misho 5239: <td class="paramtype">uint8_t </td>
! 5240: <td class="paramname"><em>type</em>, </td>
1.1 misho 5241: </tr>
5242: <tr>
1.1.1.2 ! misho 5243: <td class="paramkey"></td>
1.1 misho 5244: <td></td>
1.1.1.2 ! misho 5245: <td class="paramtype">uint </td>
! 5246: <td class="paramname"><em>seqnum</em>, </td>
1.1 misho 5247: </tr>
5248: <tr>
1.1.1.2 ! misho 5249: <td class="paramkey"></td>
1.1 misho 5250: <td></td>
1.1.1.2 ! misho 5251: <td class="paramtype">const uint8_t * </td>
! 5252: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5253: </tr>
5254: <tr>
1.1.1.2 ! misho 5255: <td class="paramkey"></td>
1.1 misho 5256: <td></td>
1.1.1.2 ! misho 5257: <td class="paramtype">uint32_t </td>
! 5258: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5259: </tr>
5260: <tr>
1.1.1.2 ! misho 5261: <td class="paramkey"></td>
1.1 misho 5262: <td></td>
1.1.1.2 ! misho 5263: <td class="paramtype">libnet_t * </td>
! 5264: <td class="paramname"><em>l</em>, </td>
1.1 misho 5265: </tr>
5266: <tr>
1.1.1.2 ! misho 5267: <td class="paramkey"></td>
1.1 misho 5268: <td></td>
1.1.1.2 ! misho 5269: <td class="paramtype">libnet_ptag_t </td>
! 5270: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5271: </tr>
5272: <tr>
5273: <td></td>
1.1.1.2 ! misho 5274: <td>)</td>
! 5275: <td></td><td></td>
1.1 misho 5276: </tr>
5277: </table>
1.1.1.2 ! misho 5278: </div>
! 5279: <div class="memdoc">
! 5280: <dl><dt><b>Parameters:</b></dt><dd>
! 5281: <table class="params">
! 5282: <tr><td class="paramname">dgram_len</td><td></td></tr>
! 5283: <tr><td class="paramname">opts</td><td></td></tr>
! 5284: <tr><td class="paramname">type</td><td></td></tr>
! 5285: <tr><td class="paramname">seqnum</td><td></td></tr>
! 5286: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5287: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5288: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5289: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5290: </table>
! 5291: </dd>
! 5292: </dl>
! 5293: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5294:
! 5295: </div>
! 5296: </div>
! 5297: <a class="anchor" id="aff42a70a3b00a91d14200798d10889f2"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ospfv2_hello" ref="aff42a70a3b00a91d14200798d10889f2" args="(uint32_t netmask, uint16_t interval, uint8_t opts, uint8_t priority, uint dead_int, uint32_t des_rtr, uint32_t bkup_rtr, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5298: <div class="memitem">
! 5299: <div class="memproto">
! 5300: <table class="memname">
1.1 misho 5301: <tr>
1.1.1.2 ! misho 5302: <td class="memname">libnet_ptag_t libnet_build_ospfv2_hello </td>
! 5303: <td>(</td>
! 5304: <td class="paramtype">uint32_t </td>
! 5305: <td class="paramname"><em>netmask</em>, </td>
1.1 misho 5306: </tr>
5307: <tr>
1.1.1.2 ! misho 5308: <td class="paramkey"></td>
1.1 misho 5309: <td></td>
1.1.1.2 ! misho 5310: <td class="paramtype">uint16_t </td>
! 5311: <td class="paramname"><em>interval</em>, </td>
1.1 misho 5312: </tr>
5313: <tr>
1.1.1.2 ! misho 5314: <td class="paramkey"></td>
1.1 misho 5315: <td></td>
1.1.1.2 ! misho 5316: <td class="paramtype">uint8_t </td>
! 5317: <td class="paramname"><em>opts</em>, </td>
1.1 misho 5318: </tr>
5319: <tr>
1.1.1.2 ! misho 5320: <td class="paramkey"></td>
1.1 misho 5321: <td></td>
1.1.1.2 ! misho 5322: <td class="paramtype">uint8_t </td>
! 5323: <td class="paramname"><em>priority</em>, </td>
1.1 misho 5324: </tr>
5325: <tr>
1.1.1.2 ! misho 5326: <td class="paramkey"></td>
1.1 misho 5327: <td></td>
1.1.1.2 ! misho 5328: <td class="paramtype">uint </td>
! 5329: <td class="paramname"><em>dead_int</em>, </td>
1.1 misho 5330: </tr>
5331: <tr>
1.1.1.2 ! misho 5332: <td class="paramkey"></td>
1.1 misho 5333: <td></td>
1.1.1.2 ! misho 5334: <td class="paramtype">uint32_t </td>
! 5335: <td class="paramname"><em>des_rtr</em>, </td>
1.1 misho 5336: </tr>
5337: <tr>
1.1.1.2 ! misho 5338: <td class="paramkey"></td>
1.1 misho 5339: <td></td>
1.1.1.2 ! misho 5340: <td class="paramtype">uint32_t </td>
! 5341: <td class="paramname"><em>bkup_rtr</em>, </td>
1.1 misho 5342: </tr>
5343: <tr>
1.1.1.2 ! misho 5344: <td class="paramkey"></td>
1.1 misho 5345: <td></td>
1.1.1.2 ! misho 5346: <td class="paramtype">const uint8_t * </td>
! 5347: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5348: </tr>
5349: <tr>
1.1.1.2 ! misho 5350: <td class="paramkey"></td>
1.1 misho 5351: <td></td>
1.1.1.2 ! misho 5352: <td class="paramtype">uint32_t </td>
! 5353: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5354: </tr>
5355: <tr>
1.1.1.2 ! misho 5356: <td class="paramkey"></td>
1.1 misho 5357: <td></td>
1.1.1.2 ! misho 5358: <td class="paramtype">libnet_t * </td>
! 5359: <td class="paramname"><em>l</em>, </td>
1.1 misho 5360: </tr>
5361: <tr>
1.1.1.2 ! misho 5362: <td class="paramkey"></td>
1.1 misho 5363: <td></td>
1.1.1.2 ! misho 5364: <td class="paramtype">libnet_ptag_t </td>
! 5365: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5366: </tr>
5367: <tr>
5368: <td></td>
1.1.1.2 ! misho 5369: <td>)</td>
! 5370: <td></td><td></td>
1.1 misho 5371: </tr>
5372: </table>
1.1.1.2 ! misho 5373: </div>
! 5374: <div class="memdoc">
! 5375: <dl><dt><b>Parameters:</b></dt><dd>
! 5376: <table class="params">
! 5377: <tr><td class="paramname">netmask</td><td></td></tr>
! 5378: <tr><td class="paramname">interval</td><td></td></tr>
! 5379: <tr><td class="paramname">opts</td><td></td></tr>
! 5380: <tr><td class="paramname">priority</td><td></td></tr>
! 5381: <tr><td class="paramname">dead_int</td><td></td></tr>
! 5382: <tr><td class="paramname">des_rtr</td><td></td></tr>
! 5383: <tr><td class="paramname">bkup_rtr</td><td></td></tr>
! 5384: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5385: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5386: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5387: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5388: </table>
! 5389: </dd>
! 5390: </dl>
! 5391: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5392:
! 5393: </div>
! 5394: </div>
! 5395: <a class="anchor" id="a611d140c425ab18996909be01e02f1c6"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ospfv2_lsa" ref="a611d140c425ab18996909be01e02f1c6" args="(uint16_t age, uint8_t opts, uint8_t type, uint lsid, uint32_t advrtr, uint seqnum, uint16_t sum, uint16_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5396: <div class="memitem">
! 5397: <div class="memproto">
! 5398: <table class="memname">
1.1 misho 5399: <tr>
1.1.1.2 ! misho 5400: <td class="memname">libnet_ptag_t libnet_build_ospfv2_lsa </td>
! 5401: <td>(</td>
! 5402: <td class="paramtype">uint16_t </td>
! 5403: <td class="paramname"><em>age</em>, </td>
1.1 misho 5404: </tr>
5405: <tr>
1.1.1.2 ! misho 5406: <td class="paramkey"></td>
1.1 misho 5407: <td></td>
1.1.1.2 ! misho 5408: <td class="paramtype">uint8_t </td>
! 5409: <td class="paramname"><em>opts</em>, </td>
1.1 misho 5410: </tr>
5411: <tr>
1.1.1.2 ! misho 5412: <td class="paramkey"></td>
1.1 misho 5413: <td></td>
1.1.1.2 ! misho 5414: <td class="paramtype">uint8_t </td>
! 5415: <td class="paramname"><em>type</em>, </td>
1.1 misho 5416: </tr>
5417: <tr>
1.1.1.2 ! misho 5418: <td class="paramkey"></td>
1.1 misho 5419: <td></td>
1.1.1.2 ! misho 5420: <td class="paramtype">uint </td>
! 5421: <td class="paramname"><em>lsid</em>, </td>
1.1 misho 5422: </tr>
5423: <tr>
1.1.1.2 ! misho 5424: <td class="paramkey"></td>
1.1 misho 5425: <td></td>
1.1.1.2 ! misho 5426: <td class="paramtype">uint32_t </td>
! 5427: <td class="paramname"><em>advrtr</em>, </td>
1.1 misho 5428: </tr>
5429: <tr>
1.1.1.2 ! misho 5430: <td class="paramkey"></td>
1.1 misho 5431: <td></td>
1.1.1.2 ! misho 5432: <td class="paramtype">uint </td>
! 5433: <td class="paramname"><em>seqnum</em>, </td>
1.1 misho 5434: </tr>
5435: <tr>
1.1.1.2 ! misho 5436: <td class="paramkey"></td>
1.1 misho 5437: <td></td>
1.1.1.2 ! misho 5438: <td class="paramtype">uint16_t </td>
! 5439: <td class="paramname"><em>sum</em>, </td>
1.1 misho 5440: </tr>
5441: <tr>
1.1.1.2 ! misho 5442: <td class="paramkey"></td>
1.1 misho 5443: <td></td>
1.1.1.2 ! misho 5444: <td class="paramtype">uint16_t </td>
! 5445: <td class="paramname"><em>len</em>, </td>
1.1 misho 5446: </tr>
5447: <tr>
1.1.1.2 ! misho 5448: <td class="paramkey"></td>
1.1 misho 5449: <td></td>
1.1.1.2 ! misho 5450: <td class="paramtype">const uint8_t * </td>
! 5451: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5452: </tr>
5453: <tr>
1.1.1.2 ! misho 5454: <td class="paramkey"></td>
1.1 misho 5455: <td></td>
1.1.1.2 ! misho 5456: <td class="paramtype">uint32_t </td>
! 5457: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5458: </tr>
5459: <tr>
1.1.1.2 ! misho 5460: <td class="paramkey"></td>
1.1 misho 5461: <td></td>
1.1.1.2 ! misho 5462: <td class="paramtype">libnet_t * </td>
! 5463: <td class="paramname"><em>l</em>, </td>
1.1 misho 5464: </tr>
5465: <tr>
1.1.1.2 ! misho 5466: <td class="paramkey"></td>
1.1 misho 5467: <td></td>
1.1.1.2 ! misho 5468: <td class="paramtype">libnet_ptag_t </td>
! 5469: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5470: </tr>
5471: <tr>
5472: <td></td>
1.1.1.2 ! misho 5473: <td>)</td>
! 5474: <td></td><td></td>
1.1 misho 5475: </tr>
5476: </table>
1.1.1.2 ! misho 5477: </div>
! 5478: <div class="memdoc">
! 5479: <dl><dt><b>Parameters:</b></dt><dd>
! 5480: <table class="params">
! 5481: <tr><td class="paramname">age</td><td></td></tr>
! 5482: <tr><td class="paramname">opts</td><td></td></tr>
! 5483: <tr><td class="paramname">type</td><td></td></tr>
! 5484: <tr><td class="paramname">lsid</td><td></td></tr>
! 5485: <tr><td class="paramname">advrtr</td><td></td></tr>
! 5486: <tr><td class="paramname">seqnum</td><td></td></tr>
! 5487: <tr><td class="paramname">sum</td><td></td></tr>
! 5488: <tr><td class="paramname">len</td><td></td></tr>
! 5489: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5490: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5491: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5492: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5493: </table>
! 5494: </dd>
! 5495: </dl>
! 5496: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5497:
! 5498: </div>
! 5499: </div>
! 5500: <a class="anchor" id="ab1a6927f757475cd9734772cc93779a7"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ospfv2_lsa_as" ref="ab1a6927f757475cd9734772cc93779a7" args="(uint32_t nmask, uint metric, uint32_t fwdaddr, uint tag, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5501: <div class="memitem">
! 5502: <div class="memproto">
! 5503: <table class="memname">
1.1 misho 5504: <tr>
1.1.1.2 ! misho 5505: <td class="memname">libnet_ptag_t libnet_build_ospfv2_lsa_as </td>
! 5506: <td>(</td>
! 5507: <td class="paramtype">uint32_t </td>
! 5508: <td class="paramname"><em>nmask</em>, </td>
1.1 misho 5509: </tr>
5510: <tr>
1.1.1.2 ! misho 5511: <td class="paramkey"></td>
1.1 misho 5512: <td></td>
1.1.1.2 ! misho 5513: <td class="paramtype">uint </td>
! 5514: <td class="paramname"><em>metric</em>, </td>
1.1 misho 5515: </tr>
5516: <tr>
1.1.1.2 ! misho 5517: <td class="paramkey"></td>
1.1 misho 5518: <td></td>
1.1.1.2 ! misho 5519: <td class="paramtype">uint32_t </td>
! 5520: <td class="paramname"><em>fwdaddr</em>, </td>
1.1 misho 5521: </tr>
5522: <tr>
1.1.1.2 ! misho 5523: <td class="paramkey"></td>
1.1 misho 5524: <td></td>
1.1.1.2 ! misho 5525: <td class="paramtype">uint </td>
! 5526: <td class="paramname"><em>tag</em>, </td>
1.1 misho 5527: </tr>
5528: <tr>
1.1.1.2 ! misho 5529: <td class="paramkey"></td>
1.1 misho 5530: <td></td>
1.1.1.2 ! misho 5531: <td class="paramtype">const uint8_t * </td>
! 5532: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5533: </tr>
5534: <tr>
1.1.1.2 ! misho 5535: <td class="paramkey"></td>
1.1 misho 5536: <td></td>
1.1.1.2 ! misho 5537: <td class="paramtype">uint32_t </td>
! 5538: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5539: </tr>
5540: <tr>
1.1.1.2 ! misho 5541: <td class="paramkey"></td>
1.1 misho 5542: <td></td>
1.1.1.2 ! misho 5543: <td class="paramtype">libnet_t * </td>
! 5544: <td class="paramname"><em>l</em>, </td>
1.1 misho 5545: </tr>
5546: <tr>
1.1.1.2 ! misho 5547: <td class="paramkey"></td>
1.1 misho 5548: <td></td>
1.1.1.2 ! misho 5549: <td class="paramtype">libnet_ptag_t </td>
! 5550: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5551: </tr>
5552: <tr>
5553: <td></td>
1.1.1.2 ! misho 5554: <td>)</td>
! 5555: <td></td><td></td>
1.1 misho 5556: </tr>
5557: </table>
1.1.1.2 ! misho 5558: </div>
! 5559: <div class="memdoc">
! 5560: <dl><dt><b>Parameters:</b></dt><dd>
! 5561: <table class="params">
! 5562: <tr><td class="paramname">nmask</td><td></td></tr>
! 5563: <tr><td class="paramname">metric</td><td></td></tr>
! 5564: <tr><td class="paramname">fwdaddr</td><td></td></tr>
! 5565: <tr><td class="paramname">tag</td><td></td></tr>
! 5566: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5567: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5568: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5569: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5570: </table>
! 5571: </dd>
! 5572: </dl>
! 5573: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5574:
! 5575: </div>
! 5576: </div>
! 5577: <a class="anchor" id="a0e067929f1e1dfe92062603c6ba12e71"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ospfv2_lsa_net" ref="a0e067929f1e1dfe92062603c6ba12e71" args="(uint32_t nmask, uint rtrid, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5578: <div class="memitem">
! 5579: <div class="memproto">
! 5580: <table class="memname">
1.1 misho 5581: <tr>
1.1.1.2 ! misho 5582: <td class="memname">libnet_ptag_t libnet_build_ospfv2_lsa_net </td>
! 5583: <td>(</td>
! 5584: <td class="paramtype">uint32_t </td>
! 5585: <td class="paramname"><em>nmask</em>, </td>
1.1 misho 5586: </tr>
5587: <tr>
1.1.1.2 ! misho 5588: <td class="paramkey"></td>
1.1 misho 5589: <td></td>
1.1.1.2 ! misho 5590: <td class="paramtype">uint </td>
! 5591: <td class="paramname"><em>rtrid</em>, </td>
1.1 misho 5592: </tr>
5593: <tr>
1.1.1.2 ! misho 5594: <td class="paramkey"></td>
1.1 misho 5595: <td></td>
1.1.1.2 ! misho 5596: <td class="paramtype">const uint8_t * </td>
! 5597: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5598: </tr>
5599: <tr>
1.1.1.2 ! misho 5600: <td class="paramkey"></td>
1.1 misho 5601: <td></td>
1.1.1.2 ! misho 5602: <td class="paramtype">uint32_t </td>
! 5603: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5604: </tr>
5605: <tr>
1.1.1.2 ! misho 5606: <td class="paramkey"></td>
1.1 misho 5607: <td></td>
1.1.1.2 ! misho 5608: <td class="paramtype">libnet_t * </td>
! 5609: <td class="paramname"><em>l</em>, </td>
1.1 misho 5610: </tr>
5611: <tr>
1.1.1.2 ! misho 5612: <td class="paramkey"></td>
1.1 misho 5613: <td></td>
1.1.1.2 ! misho 5614: <td class="paramtype">libnet_ptag_t </td>
! 5615: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5616: </tr>
5617: <tr>
5618: <td></td>
1.1.1.2 ! misho 5619: <td>)</td>
! 5620: <td></td><td></td>
1.1 misho 5621: </tr>
5622: </table>
1.1.1.2 ! misho 5623: </div>
! 5624: <div class="memdoc">
! 5625: <dl><dt><b>Parameters:</b></dt><dd>
! 5626: <table class="params">
! 5627: <tr><td class="paramname">nmask</td><td></td></tr>
! 5628: <tr><td class="paramname">rtrid</td><td></td></tr>
! 5629: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5630: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5631: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5632: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5633: </table>
! 5634: </dd>
! 5635: </dl>
! 5636: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5637:
! 5638: </div>
! 5639: </div>
! 5640: <a class="anchor" id="ad85342b88f62015f11c85e5b387af465"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ospfv2_lsa_rtr" ref="ad85342b88f62015f11c85e5b387af465" args="(uint16_t flags, uint16_t num, uint id, uint data, uint8_t type, uint8_t tos, uint16_t metric, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5641: <div class="memitem">
! 5642: <div class="memproto">
! 5643: <table class="memname">
1.1 misho 5644: <tr>
1.1.1.2 ! misho 5645: <td class="memname">libnet_ptag_t libnet_build_ospfv2_lsa_rtr </td>
! 5646: <td>(</td>
! 5647: <td class="paramtype">uint16_t </td>
! 5648: <td class="paramname"><em>flags</em>, </td>
1.1 misho 5649: </tr>
5650: <tr>
1.1.1.2 ! misho 5651: <td class="paramkey"></td>
1.1 misho 5652: <td></td>
1.1.1.2 ! misho 5653: <td class="paramtype">uint16_t </td>
! 5654: <td class="paramname"><em>num</em>, </td>
1.1 misho 5655: </tr>
5656: <tr>
1.1.1.2 ! misho 5657: <td class="paramkey"></td>
1.1 misho 5658: <td></td>
1.1.1.2 ! misho 5659: <td class="paramtype">uint </td>
! 5660: <td class="paramname"><em>id</em>, </td>
1.1 misho 5661: </tr>
5662: <tr>
1.1.1.2 ! misho 5663: <td class="paramkey"></td>
1.1 misho 5664: <td></td>
1.1.1.2 ! misho 5665: <td class="paramtype">uint </td>
! 5666: <td class="paramname"><em>data</em>, </td>
1.1 misho 5667: </tr>
5668: <tr>
1.1.1.2 ! misho 5669: <td class="paramkey"></td>
1.1 misho 5670: <td></td>
1.1.1.2 ! misho 5671: <td class="paramtype">uint8_t </td>
! 5672: <td class="paramname"><em>type</em>, </td>
1.1 misho 5673: </tr>
5674: <tr>
1.1.1.2 ! misho 5675: <td class="paramkey"></td>
1.1 misho 5676: <td></td>
1.1.1.2 ! misho 5677: <td class="paramtype">uint8_t </td>
! 5678: <td class="paramname"><em>tos</em>, </td>
1.1 misho 5679: </tr>
5680: <tr>
1.1.1.2 ! misho 5681: <td class="paramkey"></td>
1.1 misho 5682: <td></td>
1.1.1.2 ! misho 5683: <td class="paramtype">uint16_t </td>
! 5684: <td class="paramname"><em>metric</em>, </td>
1.1 misho 5685: </tr>
5686: <tr>
1.1.1.2 ! misho 5687: <td class="paramkey"></td>
1.1 misho 5688: <td></td>
1.1.1.2 ! misho 5689: <td class="paramtype">const uint8_t * </td>
! 5690: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5691: </tr>
5692: <tr>
1.1.1.2 ! misho 5693: <td class="paramkey"></td>
1.1 misho 5694: <td></td>
1.1.1.2 ! misho 5695: <td class="paramtype">uint32_t </td>
! 5696: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5697: </tr>
5698: <tr>
1.1.1.2 ! misho 5699: <td class="paramkey"></td>
1.1 misho 5700: <td></td>
1.1.1.2 ! misho 5701: <td class="paramtype">libnet_t * </td>
! 5702: <td class="paramname"><em>l</em>, </td>
1.1 misho 5703: </tr>
5704: <tr>
1.1.1.2 ! misho 5705: <td class="paramkey"></td>
1.1 misho 5706: <td></td>
1.1.1.2 ! misho 5707: <td class="paramtype">libnet_ptag_t </td>
! 5708: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5709: </tr>
5710: <tr>
5711: <td></td>
1.1.1.2 ! misho 5712: <td>)</td>
! 5713: <td></td><td></td>
1.1 misho 5714: </tr>
5715: </table>
1.1.1.2 ! misho 5716: </div>
! 5717: <div class="memdoc">
! 5718: <dl><dt><b>Parameters:</b></dt><dd>
! 5719: <table class="params">
! 5720: <tr><td class="paramname">flags</td><td></td></tr>
! 5721: <tr><td class="paramname">num</td><td></td></tr>
! 5722: <tr><td class="paramname">id</td><td></td></tr>
! 5723: <tr><td class="paramname">data</td><td></td></tr>
! 5724: <tr><td class="paramname">type</td><td></td></tr>
! 5725: <tr><td class="paramname">tos</td><td></td></tr>
! 5726: <tr><td class="paramname">metric</td><td></td></tr>
! 5727: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5728: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5729: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5730: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5731: </table>
! 5732: </dd>
! 5733: </dl>
! 5734: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5735:
! 5736: </div>
! 5737: </div>
! 5738: <a class="anchor" id="af3a2ccf97bfd42d3e4760ebf10d71fa5"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ospfv2_lsa_sum" ref="af3a2ccf97bfd42d3e4760ebf10d71fa5" args="(uint32_t nmask, uint metric, uint tos, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5739: <div class="memitem">
! 5740: <div class="memproto">
! 5741: <table class="memname">
1.1 misho 5742: <tr>
1.1.1.2 ! misho 5743: <td class="memname">libnet_ptag_t libnet_build_ospfv2_lsa_sum </td>
! 5744: <td>(</td>
! 5745: <td class="paramtype">uint32_t </td>
! 5746: <td class="paramname"><em>nmask</em>, </td>
1.1 misho 5747: </tr>
5748: <tr>
1.1.1.2 ! misho 5749: <td class="paramkey"></td>
1.1 misho 5750: <td></td>
1.1.1.2 ! misho 5751: <td class="paramtype">uint </td>
! 5752: <td class="paramname"><em>metric</em>, </td>
1.1 misho 5753: </tr>
5754: <tr>
1.1.1.2 ! misho 5755: <td class="paramkey"></td>
1.1 misho 5756: <td></td>
1.1.1.2 ! misho 5757: <td class="paramtype">uint </td>
! 5758: <td class="paramname"><em>tos</em>, </td>
1.1 misho 5759: </tr>
5760: <tr>
1.1.1.2 ! misho 5761: <td class="paramkey"></td>
1.1 misho 5762: <td></td>
1.1.1.2 ! misho 5763: <td class="paramtype">const uint8_t * </td>
! 5764: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5765: </tr>
5766: <tr>
1.1.1.2 ! misho 5767: <td class="paramkey"></td>
1.1 misho 5768: <td></td>
1.1.1.2 ! misho 5769: <td class="paramtype">uint32_t </td>
! 5770: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5771: </tr>
5772: <tr>
1.1.1.2 ! misho 5773: <td class="paramkey"></td>
1.1 misho 5774: <td></td>
1.1.1.2 ! misho 5775: <td class="paramtype">libnet_t * </td>
! 5776: <td class="paramname"><em>l</em>, </td>
1.1 misho 5777: </tr>
5778: <tr>
1.1.1.2 ! misho 5779: <td class="paramkey"></td>
1.1 misho 5780: <td></td>
1.1.1.2 ! misho 5781: <td class="paramtype">libnet_ptag_t </td>
! 5782: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5783: </tr>
5784: <tr>
5785: <td></td>
1.1.1.2 ! misho 5786: <td>)</td>
! 5787: <td></td><td></td>
1.1 misho 5788: </tr>
5789: </table>
1.1.1.2 ! misho 5790: </div>
! 5791: <div class="memdoc">
! 5792: <dl><dt><b>Parameters:</b></dt><dd>
! 5793: <table class="params">
! 5794: <tr><td class="paramname">nmask</td><td></td></tr>
! 5795: <tr><td class="paramname">metric</td><td></td></tr>
! 5796: <tr><td class="paramname">tos</td><td></td></tr>
! 5797: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5798: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5799: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5800: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5801: </table>
! 5802: </dd>
! 5803: </dl>
! 5804: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5805:
! 5806: </div>
! 5807: </div>
! 5808: <a class="anchor" id="a1cfa7596a2f85b2b7226d81fa47e7d39"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ospfv2_lsr" ref="a1cfa7596a2f85b2b7226d81fa47e7d39" args="(uint type, uint lsid, uint32_t advrtr, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5809: <div class="memitem">
! 5810: <div class="memproto">
! 5811: <table class="memname">
1.1 misho 5812: <tr>
1.1.1.2 ! misho 5813: <td class="memname">libnet_ptag_t libnet_build_ospfv2_lsr </td>
! 5814: <td>(</td>
! 5815: <td class="paramtype">uint </td>
! 5816: <td class="paramname"><em>type</em>, </td>
1.1 misho 5817: </tr>
5818: <tr>
1.1.1.2 ! misho 5819: <td class="paramkey"></td>
1.1 misho 5820: <td></td>
1.1.1.2 ! misho 5821: <td class="paramtype">uint </td>
! 5822: <td class="paramname"><em>lsid</em>, </td>
1.1 misho 5823: </tr>
5824: <tr>
1.1.1.2 ! misho 5825: <td class="paramkey"></td>
1.1 misho 5826: <td></td>
1.1.1.2 ! misho 5827: <td class="paramtype">uint32_t </td>
! 5828: <td class="paramname"><em>advrtr</em>, </td>
1.1 misho 5829: </tr>
5830: <tr>
1.1.1.2 ! misho 5831: <td class="paramkey"></td>
1.1 misho 5832: <td></td>
1.1.1.2 ! misho 5833: <td class="paramtype">const uint8_t * </td>
! 5834: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5835: </tr>
5836: <tr>
1.1.1.2 ! misho 5837: <td class="paramkey"></td>
1.1 misho 5838: <td></td>
1.1.1.2 ! misho 5839: <td class="paramtype">uint32_t </td>
! 5840: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5841: </tr>
5842: <tr>
1.1.1.2 ! misho 5843: <td class="paramkey"></td>
1.1 misho 5844: <td></td>
1.1.1.2 ! misho 5845: <td class="paramtype">libnet_t * </td>
! 5846: <td class="paramname"><em>l</em>, </td>
1.1 misho 5847: </tr>
5848: <tr>
1.1.1.2 ! misho 5849: <td class="paramkey"></td>
1.1 misho 5850: <td></td>
1.1.1.2 ! misho 5851: <td class="paramtype">libnet_ptag_t </td>
! 5852: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5853: </tr>
5854: <tr>
5855: <td></td>
1.1.1.2 ! misho 5856: <td>)</td>
! 5857: <td></td><td></td>
1.1 misho 5858: </tr>
5859: </table>
1.1.1.2 ! misho 5860: </div>
! 5861: <div class="memdoc">
! 5862: <dl><dt><b>Parameters:</b></dt><dd>
! 5863: <table class="params">
! 5864: <tr><td class="paramname">type</td><td></td></tr>
! 5865: <tr><td class="paramname">lsid</td><td></td></tr>
! 5866: <tr><td class="paramname">advrtr</td><td></td></tr>
! 5867: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5868: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5869: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5870: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5871: </table>
! 5872: </dd>
! 5873: </dl>
! 5874: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5875:
! 5876: </div>
! 5877: </div>
! 5878: <a class="anchor" id="a65617e2355459bc9ec2db6b979bee9d4"></a><!-- doxytag: member="libnet-functions.h::libnet_build_ospfv2_lsu" ref="a65617e2355459bc9ec2db6b979bee9d4" args="(uint num, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5879: <div class="memitem">
! 5880: <div class="memproto">
! 5881: <table class="memname">
1.1 misho 5882: <tr>
1.1.1.2 ! misho 5883: <td class="memname">libnet_ptag_t libnet_build_ospfv2_lsu </td>
! 5884: <td>(</td>
! 5885: <td class="paramtype">uint </td>
! 5886: <td class="paramname"><em>num</em>, </td>
1.1 misho 5887: </tr>
5888: <tr>
1.1.1.2 ! misho 5889: <td class="paramkey"></td>
1.1 misho 5890: <td></td>
1.1.1.2 ! misho 5891: <td class="paramtype">const uint8_t * </td>
! 5892: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5893: </tr>
5894: <tr>
1.1.1.2 ! misho 5895: <td class="paramkey"></td>
1.1 misho 5896: <td></td>
1.1.1.2 ! misho 5897: <td class="paramtype">uint32_t </td>
! 5898: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 5899: </tr>
5900: <tr>
1.1.1.2 ! misho 5901: <td class="paramkey"></td>
1.1 misho 5902: <td></td>
1.1.1.2 ! misho 5903: <td class="paramtype">libnet_t * </td>
! 5904: <td class="paramname"><em>l</em>, </td>
1.1 misho 5905: </tr>
5906: <tr>
1.1.1.2 ! misho 5907: <td class="paramkey"></td>
1.1 misho 5908: <td></td>
1.1.1.2 ! misho 5909: <td class="paramtype">libnet_ptag_t </td>
! 5910: <td class="paramname"><em>ptag</em> </td>
1.1 misho 5911: </tr>
5912: <tr>
5913: <td></td>
1.1.1.2 ! misho 5914: <td>)</td>
! 5915: <td></td><td></td>
1.1 misho 5916: </tr>
5917: </table>
1.1.1.2 ! misho 5918: </div>
! 5919: <div class="memdoc">
! 5920: <dl><dt><b>Parameters:</b></dt><dd>
! 5921: <table class="params">
! 5922: <tr><td class="paramname">num</td><td></td></tr>
! 5923: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 5924: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 5925: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 5926: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 5927: </table>
! 5928: </dd>
! 5929: </dl>
! 5930: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 5931:
! 5932: </div>
! 5933: </div>
! 5934: <a class="anchor" id="ad8e0469edf11477ccc3fc0b9cb031d00"></a><!-- doxytag: member="libnet-functions.h::libnet_build_rip" ref="ad8e0469edf11477ccc3fc0b9cb031d00" args="(uint8_t cmd, uint8_t version, uint16_t rd, uint16_t af, uint16_t rt, uint32_t addr, uint32_t mask, uint32_t next_hop, uint32_t metric, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 5935: <div class="memitem">
! 5936: <div class="memproto">
! 5937: <table class="memname">
1.1 misho 5938: <tr>
1.1.1.2 ! misho 5939: <td class="memname">libnet_ptag_t libnet_build_rip </td>
! 5940: <td>(</td>
! 5941: <td class="paramtype">uint8_t </td>
! 5942: <td class="paramname"><em>cmd</em>, </td>
1.1 misho 5943: </tr>
5944: <tr>
1.1.1.2 ! misho 5945: <td class="paramkey"></td>
1.1 misho 5946: <td></td>
1.1.1.2 ! misho 5947: <td class="paramtype">uint8_t </td>
! 5948: <td class="paramname"><em>version</em>, </td>
1.1 misho 5949: </tr>
5950: <tr>
1.1.1.2 ! misho 5951: <td class="paramkey"></td>
1.1 misho 5952: <td></td>
1.1.1.2 ! misho 5953: <td class="paramtype">uint16_t </td>
! 5954: <td class="paramname"><em>rd</em>, </td>
1.1 misho 5955: </tr>
5956: <tr>
1.1.1.2 ! misho 5957: <td class="paramkey"></td>
1.1 misho 5958: <td></td>
1.1.1.2 ! misho 5959: <td class="paramtype">uint16_t </td>
! 5960: <td class="paramname"><em>af</em>, </td>
1.1 misho 5961: </tr>
5962: <tr>
1.1.1.2 ! misho 5963: <td class="paramkey"></td>
1.1 misho 5964: <td></td>
1.1.1.2 ! misho 5965: <td class="paramtype">uint16_t </td>
! 5966: <td class="paramname"><em>rt</em>, </td>
1.1 misho 5967: </tr>
5968: <tr>
1.1.1.2 ! misho 5969: <td class="paramkey"></td>
1.1 misho 5970: <td></td>
1.1.1.2 ! misho 5971: <td class="paramtype">uint32_t </td>
! 5972: <td class="paramname"><em>addr</em>, </td>
1.1 misho 5973: </tr>
5974: <tr>
1.1.1.2 ! misho 5975: <td class="paramkey"></td>
1.1 misho 5976: <td></td>
1.1.1.2 ! misho 5977: <td class="paramtype">uint32_t </td>
! 5978: <td class="paramname"><em>mask</em>, </td>
1.1 misho 5979: </tr>
5980: <tr>
1.1.1.2 ! misho 5981: <td class="paramkey"></td>
1.1 misho 5982: <td></td>
1.1.1.2 ! misho 5983: <td class="paramtype">uint32_t </td>
! 5984: <td class="paramname"><em>next_hop</em>, </td>
1.1 misho 5985: </tr>
5986: <tr>
1.1.1.2 ! misho 5987: <td class="paramkey"></td>
1.1 misho 5988: <td></td>
1.1.1.2 ! misho 5989: <td class="paramtype">uint32_t </td>
! 5990: <td class="paramname"><em>metric</em>, </td>
1.1 misho 5991: </tr>
5992: <tr>
1.1.1.2 ! misho 5993: <td class="paramkey"></td>
1.1 misho 5994: <td></td>
1.1.1.2 ! misho 5995: <td class="paramtype">const uint8_t * </td>
! 5996: <td class="paramname"><em>payload</em>, </td>
1.1 misho 5997: </tr>
5998: <tr>
1.1.1.2 ! misho 5999: <td class="paramkey"></td>
1.1 misho 6000: <td></td>
1.1.1.2 ! misho 6001: <td class="paramtype">uint32_t </td>
! 6002: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 6003: </tr>
6004: <tr>
1.1.1.2 ! misho 6005: <td class="paramkey"></td>
1.1 misho 6006: <td></td>
1.1.1.2 ! misho 6007: <td class="paramtype">libnet_t * </td>
! 6008: <td class="paramname"><em>l</em>, </td>
1.1 misho 6009: </tr>
6010: <tr>
1.1.1.2 ! misho 6011: <td class="paramkey"></td>
1.1 misho 6012: <td></td>
1.1.1.2 ! misho 6013: <td class="paramtype">libnet_ptag_t </td>
! 6014: <td class="paramname"><em>ptag</em> </td>
1.1 misho 6015: </tr>
6016: <tr>
6017: <td></td>
1.1.1.2 ! misho 6018: <td>)</td>
! 6019: <td></td><td></td>
1.1 misho 6020: </tr>
6021: </table>
1.1.1.2 ! misho 6022: </div>
! 6023: <div class="memdoc">
! 6024: <p>Builds a Routing Information Protocol header (RFCs 1058 and 2453). </p>
! 6025: <dl><dt><b>Parameters:</b></dt><dd>
! 6026: <table class="params">
! 6027: <tr><td class="paramname">cmd</td><td>command </td></tr>
! 6028: <tr><td class="paramname">version</td><td>protocol version </td></tr>
! 6029: <tr><td class="paramname">rd</td><td>version one: 0, version two: routing domain </td></tr>
! 6030: <tr><td class="paramname">af</td><td>address family </td></tr>
! 6031: <tr><td class="paramname">rt</td><td>version one: 0, version two: route tag </td></tr>
! 6032: <tr><td class="paramname">addr</td><td>IPv4 address </td></tr>
! 6033: <tr><td class="paramname">mask</td><td>version one: 0, version two: subnet mask </td></tr>
! 6034: <tr><td class="paramname">next_hop</td><td>version one: 0, version two: next hop address </td></tr>
! 6035: <tr><td class="paramname">metric</td><td>routing metric </td></tr>
! 6036: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 6037: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 6038: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6039: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 6040: </table>
! 6041: </dd>
! 6042: </dl>
! 6043: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 6044:
! 6045: </div>
! 6046: </div>
! 6047: <a class="anchor" id="a7bc36e79f132c1b7ff449e9df2a459b7"></a><!-- doxytag: member="libnet-functions.h::libnet_build_rpc_call" ref="a7bc36e79f132c1b7ff449e9df2a459b7" args="(uint32_t rm, uint32_t xid, uint32_t prog_num, uint32_t prog_vers, uint32_t procedure, uint32_t cflavor, uint32_t clength, uint8_t *cdata, uint32_t vflavor, uint32_t vlength, const uint8_t *vdata, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 6048: <div class="memitem">
! 6049: <div class="memproto">
! 6050: <table class="memname">
1.1 misho 6051: <tr>
1.1.1.2 ! misho 6052: <td class="memname">libnet_ptag_t libnet_build_rpc_call </td>
! 6053: <td>(</td>
! 6054: <td class="paramtype">uint32_t </td>
! 6055: <td class="paramname"><em>rm</em>, </td>
1.1 misho 6056: </tr>
6057: <tr>
1.1.1.2 ! misho 6058: <td class="paramkey"></td>
1.1 misho 6059: <td></td>
1.1.1.2 ! misho 6060: <td class="paramtype">uint32_t </td>
! 6061: <td class="paramname"><em>xid</em>, </td>
1.1 misho 6062: </tr>
6063: <tr>
1.1.1.2 ! misho 6064: <td class="paramkey"></td>
1.1 misho 6065: <td></td>
1.1.1.2 ! misho 6066: <td class="paramtype">uint32_t </td>
! 6067: <td class="paramname"><em>prog_num</em>, </td>
1.1 misho 6068: </tr>
6069: <tr>
1.1.1.2 ! misho 6070: <td class="paramkey"></td>
1.1 misho 6071: <td></td>
1.1.1.2 ! misho 6072: <td class="paramtype">uint32_t </td>
! 6073: <td class="paramname"><em>prog_vers</em>, </td>
1.1 misho 6074: </tr>
6075: <tr>
1.1.1.2 ! misho 6076: <td class="paramkey"></td>
1.1 misho 6077: <td></td>
1.1.1.2 ! misho 6078: <td class="paramtype">uint32_t </td>
! 6079: <td class="paramname"><em>procedure</em>, </td>
1.1 misho 6080: </tr>
6081: <tr>
1.1.1.2 ! misho 6082: <td class="paramkey"></td>
1.1 misho 6083: <td></td>
1.1.1.2 ! misho 6084: <td class="paramtype">uint32_t </td>
! 6085: <td class="paramname"><em>cflavor</em>, </td>
1.1 misho 6086: </tr>
6087: <tr>
1.1.1.2 ! misho 6088: <td class="paramkey"></td>
1.1 misho 6089: <td></td>
1.1.1.2 ! misho 6090: <td class="paramtype">uint32_t </td>
! 6091: <td class="paramname"><em>clength</em>, </td>
1.1 misho 6092: </tr>
6093: <tr>
1.1.1.2 ! misho 6094: <td class="paramkey"></td>
1.1 misho 6095: <td></td>
1.1.1.2 ! misho 6096: <td class="paramtype">uint8_t * </td>
! 6097: <td class="paramname"><em>cdata</em>, </td>
1.1 misho 6098: </tr>
6099: <tr>
1.1.1.2 ! misho 6100: <td class="paramkey"></td>
1.1 misho 6101: <td></td>
1.1.1.2 ! misho 6102: <td class="paramtype">uint32_t </td>
! 6103: <td class="paramname"><em>vflavor</em>, </td>
1.1 misho 6104: </tr>
6105: <tr>
1.1.1.2 ! misho 6106: <td class="paramkey"></td>
1.1 misho 6107: <td></td>
1.1.1.2 ! misho 6108: <td class="paramtype">uint32_t </td>
! 6109: <td class="paramname"><em>vlength</em>, </td>
1.1 misho 6110: </tr>
6111: <tr>
1.1.1.2 ! misho 6112: <td class="paramkey"></td>
1.1 misho 6113: <td></td>
1.1.1.2 ! misho 6114: <td class="paramtype">const uint8_t * </td>
! 6115: <td class="paramname"><em>vdata</em>, </td>
1.1 misho 6116: </tr>
6117: <tr>
1.1.1.2 ! misho 6118: <td class="paramkey"></td>
1.1 misho 6119: <td></td>
1.1.1.2 ! misho 6120: <td class="paramtype">const uint8_t * </td>
! 6121: <td class="paramname"><em>payload</em>, </td>
1.1 misho 6122: </tr>
6123: <tr>
1.1.1.2 ! misho 6124: <td class="paramkey"></td>
1.1 misho 6125: <td></td>
1.1.1.2 ! misho 6126: <td class="paramtype">uint32_t </td>
! 6127: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 6128: </tr>
6129: <tr>
1.1.1.2 ! misho 6130: <td class="paramkey"></td>
1.1 misho 6131: <td></td>
1.1.1.2 ! misho 6132: <td class="paramtype">libnet_t * </td>
! 6133: <td class="paramname"><em>l</em>, </td>
1.1 misho 6134: </tr>
6135: <tr>
1.1.1.2 ! misho 6136: <td class="paramkey"></td>
1.1 misho 6137: <td></td>
1.1.1.2 ! misho 6138: <td class="paramtype">libnet_ptag_t </td>
! 6139: <td class="paramname"><em>ptag</em> </td>
1.1 misho 6140: </tr>
6141: <tr>
6142: <td></td>
1.1.1.2 ! misho 6143: <td>)</td>
! 6144: <td></td><td></td>
1.1 misho 6145: </tr>
6146: </table>
1.1.1.2 ! misho 6147: </div>
! 6148: <div class="memdoc">
! 6149: <p>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). </p>
! 6150: <dl><dt><b>Parameters:</b></dt><dd>
! 6151: <table class="params">
! 6152: <tr><td class="paramname">rm</td><td>record marking indicating the position in a stream, 0 otherwise </td></tr>
! 6153: <tr><td class="paramname">xid</td><td>transaction identifier used to link calls and replies </td></tr>
! 6154: <tr><td class="paramname">prog_num</td><td>remote program specification typically between 0 - 1fffffff </td></tr>
! 6155: <tr><td class="paramname">prog_vers</td><td>remote program version specification </td></tr>
! 6156: <tr><td class="paramname">procedure</td><td>procedure to be performed by remote program </td></tr>
! 6157: <tr><td class="paramname">cflavor</td><td>authentication credential type </td></tr>
! 6158: <tr><td class="paramname">clength</td><td>credential length (should be 0) </td></tr>
! 6159: <tr><td class="paramname">cdata</td><td>opaque credential data (currently unused) </td></tr>
! 6160: <tr><td class="paramname">vflavor</td><td>authentication verifier type </td></tr>
! 6161: <tr><td class="paramname">vlength</td><td>verifier length (should be 0) </td></tr>
! 6162: <tr><td class="paramname">vdata</td><td>opaque verifier data (currently unused) </td></tr>
! 6163: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 6164: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 6165: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6166: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 6167: </table>
! 6168: </dd>
! 6169: </dl>
! 6170: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 6171:
! 6172: </div>
! 6173: </div>
! 6174: <a class="anchor" id="a9a182529f97b05e9a2a5bd120f2f8456"></a><!-- doxytag: member="libnet-functions.h::libnet_build_sebek" ref="a9a182529f97b05e9a2a5bd120f2f8456" args="(uint32_t magic, uint16_t version, uint16_t type, uint32_t counter, uint32_t time_sec, uint32_t time_usec, uint32_t pid, uint32_t uid, uint32_t fd, uint8_t cmd[SEBEK_CMD_LENGTH], uint32_t length, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 6175: <div class="memitem">
! 6176: <div class="memproto">
! 6177: <table class="memname">
1.1 misho 6178: <tr>
1.1.1.2 ! misho 6179: <td class="memname">libnet_ptag_t libnet_build_sebek </td>
! 6180: <td>(</td>
! 6181: <td class="paramtype">uint32_t </td>
! 6182: <td class="paramname"><em>magic</em>, </td>
1.1 misho 6183: </tr>
6184: <tr>
1.1.1.2 ! misho 6185: <td class="paramkey"></td>
1.1 misho 6186: <td></td>
1.1.1.2 ! misho 6187: <td class="paramtype">uint16_t </td>
! 6188: <td class="paramname"><em>version</em>, </td>
1.1 misho 6189: </tr>
6190: <tr>
1.1.1.2 ! misho 6191: <td class="paramkey"></td>
1.1 misho 6192: <td></td>
1.1.1.2 ! misho 6193: <td class="paramtype">uint16_t </td>
! 6194: <td class="paramname"><em>type</em>, </td>
1.1 misho 6195: </tr>
6196: <tr>
1.1.1.2 ! misho 6197: <td class="paramkey"></td>
1.1 misho 6198: <td></td>
1.1.1.2 ! misho 6199: <td class="paramtype">uint32_t </td>
! 6200: <td class="paramname"><em>counter</em>, </td>
1.1 misho 6201: </tr>
6202: <tr>
1.1.1.2 ! misho 6203: <td class="paramkey"></td>
1.1 misho 6204: <td></td>
1.1.1.2 ! misho 6205: <td class="paramtype">uint32_t </td>
! 6206: <td class="paramname"><em>time_sec</em>, </td>
1.1 misho 6207: </tr>
6208: <tr>
1.1.1.2 ! misho 6209: <td class="paramkey"></td>
1.1 misho 6210: <td></td>
1.1.1.2 ! misho 6211: <td class="paramtype">uint32_t </td>
! 6212: <td class="paramname"><em>time_usec</em>, </td>
1.1 misho 6213: </tr>
6214: <tr>
1.1.1.2 ! misho 6215: <td class="paramkey"></td>
1.1 misho 6216: <td></td>
1.1.1.2 ! misho 6217: <td class="paramtype">uint32_t </td>
! 6218: <td class="paramname"><em>pid</em>, </td>
1.1 misho 6219: </tr>
6220: <tr>
1.1.1.2 ! misho 6221: <td class="paramkey"></td>
1.1 misho 6222: <td></td>
1.1.1.2 ! misho 6223: <td class="paramtype">uint32_t </td>
! 6224: <td class="paramname"><em>uid</em>, </td>
1.1 misho 6225: </tr>
6226: <tr>
1.1.1.2 ! misho 6227: <td class="paramkey"></td>
1.1 misho 6228: <td></td>
1.1.1.2 ! misho 6229: <td class="paramtype">uint32_t </td>
! 6230: <td class="paramname"><em>fd</em>, </td>
1.1 misho 6231: </tr>
6232: <tr>
1.1.1.2 ! misho 6233: <td class="paramkey"></td>
1.1 misho 6234: <td></td>
1.1.1.2 ! misho 6235: <td class="paramtype">uint8_t </td>
! 6236: <td class="paramname"><em>cmd</em>[SEBEK_CMD_LENGTH], </td>
1.1 misho 6237: </tr>
6238: <tr>
1.1.1.2 ! misho 6239: <td class="paramkey"></td>
1.1 misho 6240: <td></td>
1.1.1.2 ! misho 6241: <td class="paramtype">uint32_t </td>
! 6242: <td class="paramname"><em>length</em>, </td>
1.1 misho 6243: </tr>
6244: <tr>
1.1.1.2 ! misho 6245: <td class="paramkey"></td>
1.1 misho 6246: <td></td>
1.1.1.2 ! misho 6247: <td class="paramtype">const uint8_t * </td>
! 6248: <td class="paramname"><em>payload</em>, </td>
1.1 misho 6249: </tr>
6250: <tr>
1.1.1.2 ! misho 6251: <td class="paramkey"></td>
1.1 misho 6252: <td></td>
1.1.1.2 ! misho 6253: <td class="paramtype">uint32_t </td>
! 6254: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 6255: </tr>
6256: <tr>
1.1.1.2 ! misho 6257: <td class="paramkey"></td>
1.1 misho 6258: <td></td>
1.1.1.2 ! misho 6259: <td class="paramtype">libnet_t * </td>
! 6260: <td class="paramname"><em>l</em>, </td>
1.1 misho 6261: </tr>
6262: <tr>
1.1.1.2 ! misho 6263: <td class="paramkey"></td>
1.1 misho 6264: <td></td>
1.1.1.2 ! misho 6265: <td class="paramtype">libnet_ptag_t </td>
! 6266: <td class="paramname"><em>ptag</em> </td>
1.1 misho 6267: </tr>
6268: <tr>
6269: <td></td>
1.1.1.2 ! misho 6270: <td>)</td>
! 6271: <td></td><td></td>
1.1 misho 6272: </tr>
6273: </table>
1.1.1.2 ! misho 6274: </div>
! 6275: <div class="memdoc">
! 6276: <p>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>
! 6277: <dl><dt><b>Parameters:</b></dt><dd>
! 6278: <table class="params">
! 6279: <tr><td class="paramname">magic</td><td>identify packets that should be hidden </td></tr>
! 6280: <tr><td class="paramname">version</td><td>protocol version, currently 1 </td></tr>
! 6281: <tr><td class="paramname">type</td><td>type of record (read data is type 0, write data is type 1) </td></tr>
! 6282: <tr><td class="paramname">counter</td><td>PDU counter used to identify when packet are lost </td></tr>
! 6283: <tr><td class="paramname">time_sec</td><td>seconds since EPOCH according to the honeypot </td></tr>
! 6284: <tr><td class="paramname">time_usec</td><td>residual microseconds </td></tr>
! 6285: <tr><td class="paramname">pid</td><td>PID </td></tr>
! 6286: <tr><td class="paramname">uid</td><td>UID </td></tr>
! 6287: <tr><td class="paramname">fd</td><td>FD </td></tr>
! 6288: <tr><td class="paramname">cmd</td><td>12 first characters of the command </td></tr>
! 6289: <tr><td class="paramname">length</td><td>length in bytes of the PDU's body </td></tr>
! 6290: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 6291: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 6292: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6293: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 6294: </table>
! 6295: </dd>
! 6296: </dl>
! 6297: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 6298:
! 6299: </div>
! 6300: </div>
! 6301: <a class="anchor" id="a5051a29044af5ac103f6604ef8d480e5"></a><!-- doxytag: member="libnet-functions.h::libnet_build_stp_conf" ref="a5051a29044af5ac103f6604ef8d480e5" args="(uint16_t id, uint8_t version, uint8_t bpdu_type, uint8_t flags, const uint8_t *root_id, uint32_t root_pc, const uint8_t *bridge_id, uint16_t port_id, uint16_t message_age, uint16_t max_age, uint16_t hello_time, uint16_t f_delay, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 6302: <div class="memitem">
! 6303: <div class="memproto">
! 6304: <table class="memname">
1.1 misho 6305: <tr>
1.1.1.2 ! misho 6306: <td class="memname">libnet_ptag_t libnet_build_stp_conf </td>
! 6307: <td>(</td>
! 6308: <td class="paramtype">uint16_t </td>
! 6309: <td class="paramname"><em>id</em>, </td>
1.1 misho 6310: </tr>
6311: <tr>
1.1.1.2 ! misho 6312: <td class="paramkey"></td>
1.1 misho 6313: <td></td>
1.1.1.2 ! misho 6314: <td class="paramtype">uint8_t </td>
! 6315: <td class="paramname"><em>version</em>, </td>
1.1 misho 6316: </tr>
6317: <tr>
1.1.1.2 ! misho 6318: <td class="paramkey"></td>
1.1 misho 6319: <td></td>
1.1.1.2 ! misho 6320: <td class="paramtype">uint8_t </td>
! 6321: <td class="paramname"><em>bpdu_type</em>, </td>
1.1 misho 6322: </tr>
6323: <tr>
1.1.1.2 ! misho 6324: <td class="paramkey"></td>
1.1 misho 6325: <td></td>
1.1.1.2 ! misho 6326: <td class="paramtype">uint8_t </td>
! 6327: <td class="paramname"><em>flags</em>, </td>
1.1 misho 6328: </tr>
6329: <tr>
1.1.1.2 ! misho 6330: <td class="paramkey"></td>
1.1 misho 6331: <td></td>
1.1.1.2 ! misho 6332: <td class="paramtype">const uint8_t * </td>
! 6333: <td class="paramname"><em>root_id</em>, </td>
1.1 misho 6334: </tr>
6335: <tr>
1.1.1.2 ! misho 6336: <td class="paramkey"></td>
1.1 misho 6337: <td></td>
1.1.1.2 ! misho 6338: <td class="paramtype">uint32_t </td>
! 6339: <td class="paramname"><em>root_pc</em>, </td>
1.1 misho 6340: </tr>
6341: <tr>
1.1.1.2 ! misho 6342: <td class="paramkey"></td>
1.1 misho 6343: <td></td>
1.1.1.2 ! misho 6344: <td class="paramtype">const uint8_t * </td>
! 6345: <td class="paramname"><em>bridge_id</em>, </td>
1.1 misho 6346: </tr>
6347: <tr>
1.1.1.2 ! misho 6348: <td class="paramkey"></td>
1.1 misho 6349: <td></td>
1.1.1.2 ! misho 6350: <td class="paramtype">uint16_t </td>
! 6351: <td class="paramname"><em>port_id</em>, </td>
1.1 misho 6352: </tr>
6353: <tr>
1.1.1.2 ! misho 6354: <td class="paramkey"></td>
1.1 misho 6355: <td></td>
1.1.1.2 ! misho 6356: <td class="paramtype">uint16_t </td>
! 6357: <td class="paramname"><em>message_age</em>, </td>
1.1 misho 6358: </tr>
6359: <tr>
1.1.1.2 ! misho 6360: <td class="paramkey"></td>
1.1 misho 6361: <td></td>
1.1.1.2 ! misho 6362: <td class="paramtype">uint16_t </td>
! 6363: <td class="paramname"><em>max_age</em>, </td>
1.1 misho 6364: </tr>
6365: <tr>
1.1.1.2 ! misho 6366: <td class="paramkey"></td>
1.1 misho 6367: <td></td>
1.1.1.2 ! misho 6368: <td class="paramtype">uint16_t </td>
! 6369: <td class="paramname"><em>hello_time</em>, </td>
1.1 misho 6370: </tr>
6371: <tr>
1.1.1.2 ! misho 6372: <td class="paramkey"></td>
1.1 misho 6373: <td></td>
1.1.1.2 ! misho 6374: <td class="paramtype">uint16_t </td>
! 6375: <td class="paramname"><em>f_delay</em>, </td>
1.1 misho 6376: </tr>
6377: <tr>
1.1.1.2 ! misho 6378: <td class="paramkey"></td>
1.1 misho 6379: <td></td>
1.1.1.2 ! misho 6380: <td class="paramtype">const uint8_t * </td>
! 6381: <td class="paramname"><em>payload</em>, </td>
1.1 misho 6382: </tr>
6383: <tr>
1.1.1.2 ! misho 6384: <td class="paramkey"></td>
1.1 misho 6385: <td></td>
1.1.1.2 ! misho 6386: <td class="paramtype">uint32_t </td>
! 6387: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 6388: </tr>
6389: <tr>
1.1.1.2 ! misho 6390: <td class="paramkey"></td>
1.1 misho 6391: <td></td>
1.1.1.2 ! misho 6392: <td class="paramtype">libnet_t * </td>
! 6393: <td class="paramname"><em>l</em>, </td>
1.1 misho 6394: </tr>
6395: <tr>
1.1.1.2 ! misho 6396: <td class="paramkey"></td>
1.1 misho 6397: <td></td>
1.1.1.2 ! misho 6398: <td class="paramtype">libnet_ptag_t </td>
! 6399: <td class="paramname"><em>ptag</em> </td>
1.1 misho 6400: </tr>
6401: <tr>
6402: <td></td>
1.1.1.2 ! misho 6403: <td>)</td>
! 6404: <td></td><td></td>
1.1 misho 6405: </tr>
6406: </table>
1.1.1.2 ! misho 6407: </div>
! 6408: <div class="memdoc">
! 6409: <p>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. </p>
! 6410: <dl><dt><b>Parameters:</b></dt><dd>
! 6411: <table class="params">
! 6412: <tr><td class="paramname">id</td><td>protocol id </td></tr>
! 6413: <tr><td class="paramname">version</td><td>protocol version </td></tr>
! 6414: <tr><td class="paramname">bpdu_type</td><td>bridge protocol data unit type </td></tr>
! 6415: <tr><td class="paramname">flags</td><td>flags </td></tr>
! 6416: <tr><td class="paramname">root_id</td><td>root id </td></tr>
! 6417: <tr><td class="paramname">root_pc</td><td>root path cost </td></tr>
! 6418: <tr><td class="paramname">bridge_id</td><td>bridge id </td></tr>
! 6419: <tr><td class="paramname">port_id</td><td>port id </td></tr>
! 6420: <tr><td class="paramname">message_age</td><td>message age </td></tr>
! 6421: <tr><td class="paramname">max_age</td><td>max age </td></tr>
! 6422: <tr><td class="paramname">hello_time</td><td>hello time </td></tr>
! 6423: <tr><td class="paramname">f_delay</td><td>forward delay </td></tr>
! 6424: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 6425: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 6426: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6427: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 6428: </table>
! 6429: </dd>
! 6430: </dl>
! 6431: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 6432:
! 6433: </div>
! 6434: </div>
! 6435: <a class="anchor" id="a20cda717c9254f73230b95f9eb808bc1"></a><!-- doxytag: member="libnet-functions.h::libnet_build_stp_tcn" ref="a20cda717c9254f73230b95f9eb808bc1" args="(uint16_t id, uint8_t version, uint8_t bpdu_type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 6436: <div class="memitem">
! 6437: <div class="memproto">
! 6438: <table class="memname">
1.1 misho 6439: <tr>
1.1.1.2 ! misho 6440: <td class="memname">libnet_ptag_t libnet_build_stp_tcn </td>
! 6441: <td>(</td>
! 6442: <td class="paramtype">uint16_t </td>
! 6443: <td class="paramname"><em>id</em>, </td>
1.1 misho 6444: </tr>
6445: <tr>
1.1.1.2 ! misho 6446: <td class="paramkey"></td>
1.1 misho 6447: <td></td>
1.1.1.2 ! misho 6448: <td class="paramtype">uint8_t </td>
! 6449: <td class="paramname"><em>version</em>, </td>
1.1 misho 6450: </tr>
6451: <tr>
1.1.1.2 ! misho 6452: <td class="paramkey"></td>
1.1 misho 6453: <td></td>
1.1.1.2 ! misho 6454: <td class="paramtype">uint8_t </td>
! 6455: <td class="paramname"><em>bpdu_type</em>, </td>
1.1 misho 6456: </tr>
6457: <tr>
1.1.1.2 ! misho 6458: <td class="paramkey"></td>
1.1 misho 6459: <td></td>
1.1.1.2 ! misho 6460: <td class="paramtype">const uint8_t * </td>
! 6461: <td class="paramname"><em>payload</em>, </td>
1.1 misho 6462: </tr>
6463: <tr>
1.1.1.2 ! misho 6464: <td class="paramkey"></td>
1.1 misho 6465: <td></td>
1.1.1.2 ! misho 6466: <td class="paramtype">uint32_t </td>
! 6467: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 6468: </tr>
6469: <tr>
1.1.1.2 ! misho 6470: <td class="paramkey"></td>
1.1 misho 6471: <td></td>
1.1.1.2 ! misho 6472: <td class="paramtype">libnet_t * </td>
! 6473: <td class="paramname"><em>l</em>, </td>
1.1 misho 6474: </tr>
6475: <tr>
1.1.1.2 ! misho 6476: <td class="paramkey"></td>
1.1 misho 6477: <td></td>
1.1.1.2 ! misho 6478: <td class="paramtype">libnet_ptag_t </td>
! 6479: <td class="paramname"><em>ptag</em> </td>
1.1 misho 6480: </tr>
6481: <tr>
6482: <td></td>
1.1.1.2 ! misho 6483: <td>)</td>
! 6484: <td></td><td></td>
1.1 misho 6485: </tr>
6486: </table>
1.1.1.2 ! misho 6487: </div>
! 6488: <div class="memdoc">
! 6489: <p>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. </p>
! 6490: <dl><dt><b>Parameters:</b></dt><dd>
! 6491: <table class="params">
! 6492: <tr><td class="paramname">id</td><td>protocol id </td></tr>
! 6493: <tr><td class="paramname">version</td><td>protocol version </td></tr>
! 6494: <tr><td class="paramname">bpdu_type</td><td>bridge protocol data unit type </td></tr>
! 6495: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 6496: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 6497: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6498: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 6499: </table>
! 6500: </dd>
! 6501: </dl>
! 6502: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 6503:
! 6504: </div>
! 6505: </div>
! 6506: <a class="anchor" id="a729cfdedc3e59a3152c99c914d66ec6f"></a><!-- doxytag: member="libnet-functions.h::libnet_build_tcp" ref="a729cfdedc3e59a3152c99c914d66ec6f" args="(uint16_t sp, uint16_t dp, uint32_t seq, uint32_t ack, uint8_t control, uint16_t win, uint16_t sum, uint16_t urg, uint16_t len, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 6507: <div class="memitem">
! 6508: <div class="memproto">
! 6509: <table class="memname">
1.1 misho 6510: <tr>
1.1.1.2 ! misho 6511: <td class="memname">libnet_ptag_t libnet_build_tcp </td>
! 6512: <td>(</td>
! 6513: <td class="paramtype">uint16_t </td>
! 6514: <td class="paramname"><em>sp</em>, </td>
1.1 misho 6515: </tr>
6516: <tr>
1.1.1.2 ! misho 6517: <td class="paramkey"></td>
1.1 misho 6518: <td></td>
1.1.1.2 ! misho 6519: <td class="paramtype">uint16_t </td>
! 6520: <td class="paramname"><em>dp</em>, </td>
1.1 misho 6521: </tr>
6522: <tr>
1.1.1.2 ! misho 6523: <td class="paramkey"></td>
1.1 misho 6524: <td></td>
1.1.1.2 ! misho 6525: <td class="paramtype">uint32_t </td>
! 6526: <td class="paramname"><em>seq</em>, </td>
1.1 misho 6527: </tr>
6528: <tr>
1.1.1.2 ! misho 6529: <td class="paramkey"></td>
1.1 misho 6530: <td></td>
1.1.1.2 ! misho 6531: <td class="paramtype">uint32_t </td>
! 6532: <td class="paramname"><em>ack</em>, </td>
1.1 misho 6533: </tr>
6534: <tr>
1.1.1.2 ! misho 6535: <td class="paramkey"></td>
1.1 misho 6536: <td></td>
1.1.1.2 ! misho 6537: <td class="paramtype">uint8_t </td>
! 6538: <td class="paramname"><em>control</em>, </td>
1.1 misho 6539: </tr>
6540: <tr>
1.1.1.2 ! misho 6541: <td class="paramkey"></td>
1.1 misho 6542: <td></td>
1.1.1.2 ! misho 6543: <td class="paramtype">uint16_t </td>
! 6544: <td class="paramname"><em>win</em>, </td>
1.1 misho 6545: </tr>
6546: <tr>
1.1.1.2 ! misho 6547: <td class="paramkey"></td>
1.1 misho 6548: <td></td>
1.1.1.2 ! misho 6549: <td class="paramtype">uint16_t </td>
! 6550: <td class="paramname"><em>sum</em>, </td>
1.1 misho 6551: </tr>
6552: <tr>
1.1.1.2 ! misho 6553: <td class="paramkey"></td>
1.1 misho 6554: <td></td>
1.1.1.2 ! misho 6555: <td class="paramtype">uint16_t </td>
! 6556: <td class="paramname"><em>urg</em>, </td>
1.1 misho 6557: </tr>
6558: <tr>
1.1.1.2 ! misho 6559: <td class="paramkey"></td>
1.1 misho 6560: <td></td>
1.1.1.2 ! misho 6561: <td class="paramtype">uint16_t </td>
! 6562: <td class="paramname"><em>len</em>, </td>
1.1 misho 6563: </tr>
6564: <tr>
1.1.1.2 ! misho 6565: <td class="paramkey"></td>
1.1 misho 6566: <td></td>
1.1.1.2 ! misho 6567: <td class="paramtype">const uint8_t * </td>
! 6568: <td class="paramname"><em>payload</em>, </td>
1.1 misho 6569: </tr>
6570: <tr>
1.1.1.2 ! misho 6571: <td class="paramkey"></td>
1.1 misho 6572: <td></td>
1.1.1.2 ! misho 6573: <td class="paramtype">uint32_t </td>
! 6574: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 6575: </tr>
6576: <tr>
1.1.1.2 ! misho 6577: <td class="paramkey"></td>
1.1 misho 6578: <td></td>
1.1.1.2 ! misho 6579: <td class="paramtype">libnet_t * </td>
! 6580: <td class="paramname"><em>l</em>, </td>
1.1 misho 6581: </tr>
6582: <tr>
1.1.1.2 ! misho 6583: <td class="paramkey"></td>
1.1 misho 6584: <td></td>
1.1.1.2 ! misho 6585: <td class="paramtype">libnet_ptag_t </td>
! 6586: <td class="paramname"><em>ptag</em> </td>
1.1 misho 6587: </tr>
6588: <tr>
6589: <td></td>
1.1.1.2 ! misho 6590: <td>)</td>
! 6591: <td></td><td></td>
1.1 misho 6592: </tr>
6593: </table>
1.1.1.2 ! misho 6594: </div>
! 6595: <div class="memdoc">
! 6596: <p>Builds an RFC 793 Transmission Control Protocol (TCP) header. </p>
! 6597: <dl><dt><b>Parameters:</b></dt><dd>
! 6598: <table class="params">
! 6599: <tr><td class="paramname">sp</td><td>source port </td></tr>
! 6600: <tr><td class="paramname">dp</td><td>destination port </td></tr>
! 6601: <tr><td class="paramname">seq</td><td>sequence number </td></tr>
! 6602: <tr><td class="paramname">ack</td><td>acknowledgement number </td></tr>
! 6603: <tr><td class="paramname">control</td><td>control flags </td></tr>
! 6604: <tr><td class="paramname">win</td><td>window size </td></tr>
! 6605: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 6606: <tr><td class="paramname">urg</td><td>urgent pointer </td></tr>
! 6607: <tr><td class="paramname">len</td><td>total length of the TCP packet (for checksum calculation) </td></tr>
! 6608: <tr><td class="paramname">payload</td><td></td></tr>
! 6609: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 6610: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6611: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 6612: </table>
! 6613: </dd>
! 6614: </dl>
! 6615: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 6616:
! 6617: </div>
! 6618: </div>
! 6619: <a class="anchor" id="a11d0bd23cb198f3e940336b62a94839a"></a><!-- doxytag: member="libnet-functions.h::libnet_build_tcp_options" ref="a11d0bd23cb198f3e940336b62a94839a" args="(const uint8_t *options, uint32_t options_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 6620: <div class="memitem">
! 6621: <div class="memproto">
! 6622: <table class="memname">
1.1 misho 6623: <tr>
1.1.1.2 ! misho 6624: <td class="memname">libnet_ptag_t libnet_build_tcp_options </td>
! 6625: <td>(</td>
! 6626: <td class="paramtype">const uint8_t * </td>
! 6627: <td class="paramname"><em>options</em>, </td>
1.1 misho 6628: </tr>
6629: <tr>
1.1.1.2 ! misho 6630: <td class="paramkey"></td>
1.1 misho 6631: <td></td>
1.1.1.2 ! misho 6632: <td class="paramtype">uint32_t </td>
! 6633: <td class="paramname"><em>options_s</em>, </td>
1.1 misho 6634: </tr>
6635: <tr>
1.1.1.2 ! misho 6636: <td class="paramkey"></td>
1.1 misho 6637: <td></td>
1.1.1.2 ! misho 6638: <td class="paramtype">libnet_t * </td>
! 6639: <td class="paramname"><em>l</em>, </td>
1.1 misho 6640: </tr>
6641: <tr>
1.1.1.2 ! misho 6642: <td class="paramkey"></td>
1.1 misho 6643: <td></td>
1.1.1.2 ! misho 6644: <td class="paramtype">libnet_ptag_t </td>
! 6645: <td class="paramname"><em>ptag</em> </td>
1.1 misho 6646: </tr>
6647: <tr>
6648: <td></td>
1.1.1.2 ! misho 6649: <td>)</td>
! 6650: <td></td><td></td>
1.1 misho 6651: </tr>
6652: </table>
1.1.1.2 ! misho 6653: </div>
! 6654: <div class="memdoc">
! 6655: <p>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. </p>
! 6656: <dl><dt><b>Parameters:</b></dt><dd>
! 6657: <table class="params">
! 6658: <tr><td class="paramname">options</td><td>byte string of TCP options </td></tr>
! 6659: <tr><td class="paramname">options_s</td><td>length of options string </td></tr>
! 6660: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6661: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 6662: </table>
! 6663: </dd>
! 6664: </dl>
! 6665: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 6666:
! 6667: </div>
! 6668: </div>
! 6669: <a class="anchor" id="aed08f26e3bc9afd750a3b515a8d83526"></a><!-- doxytag: member="libnet-functions.h::libnet_build_token_ring" ref="aed08f26e3bc9afd750a3b515a8d83526" args="(uint8_t ac, uint8_t fc, const uint8_t *dst, const uint8_t *src, uint8_t dsap, uint8_t ssap, uint8_t cf, const uint8_t *oui, uint16_t type, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 6670: <div class="memitem">
! 6671: <div class="memproto">
! 6672: <table class="memname">
1.1 misho 6673: <tr>
1.1.1.2 ! misho 6674: <td class="memname">libnet_ptag_t libnet_build_token_ring </td>
! 6675: <td>(</td>
! 6676: <td class="paramtype">uint8_t </td>
! 6677: <td class="paramname"><em>ac</em>, </td>
1.1 misho 6678: </tr>
6679: <tr>
1.1.1.2 ! misho 6680: <td class="paramkey"></td>
1.1 misho 6681: <td></td>
1.1.1.2 ! misho 6682: <td class="paramtype">uint8_t </td>
! 6683: <td class="paramname"><em>fc</em>, </td>
1.1 misho 6684: </tr>
6685: <tr>
1.1.1.2 ! misho 6686: <td class="paramkey"></td>
1.1 misho 6687: <td></td>
1.1.1.2 ! misho 6688: <td class="paramtype">const uint8_t * </td>
! 6689: <td class="paramname"><em>dst</em>, </td>
1.1 misho 6690: </tr>
6691: <tr>
1.1.1.2 ! misho 6692: <td class="paramkey"></td>
1.1 misho 6693: <td></td>
1.1.1.2 ! misho 6694: <td class="paramtype">const uint8_t * </td>
! 6695: <td class="paramname"><em>src</em>, </td>
1.1 misho 6696: </tr>
6697: <tr>
1.1.1.2 ! misho 6698: <td class="paramkey"></td>
1.1 misho 6699: <td></td>
1.1.1.2 ! misho 6700: <td class="paramtype">uint8_t </td>
! 6701: <td class="paramname"><em>dsap</em>, </td>
1.1 misho 6702: </tr>
6703: <tr>
1.1.1.2 ! misho 6704: <td class="paramkey"></td>
1.1 misho 6705: <td></td>
1.1.1.2 ! misho 6706: <td class="paramtype">uint8_t </td>
! 6707: <td class="paramname"><em>ssap</em>, </td>
1.1 misho 6708: </tr>
6709: <tr>
1.1.1.2 ! misho 6710: <td class="paramkey"></td>
1.1 misho 6711: <td></td>
1.1.1.2 ! misho 6712: <td class="paramtype">uint8_t </td>
! 6713: <td class="paramname"><em>cf</em>, </td>
1.1 misho 6714: </tr>
6715: <tr>
1.1.1.2 ! misho 6716: <td class="paramkey"></td>
1.1 misho 6717: <td></td>
1.1.1.2 ! misho 6718: <td class="paramtype">const uint8_t * </td>
! 6719: <td class="paramname"><em>oui</em>, </td>
1.1 misho 6720: </tr>
6721: <tr>
1.1.1.2 ! misho 6722: <td class="paramkey"></td>
1.1 misho 6723: <td></td>
1.1.1.2 ! misho 6724: <td class="paramtype">uint16_t </td>
! 6725: <td class="paramname"><em>type</em>, </td>
1.1 misho 6726: </tr>
6727: <tr>
1.1.1.2 ! misho 6728: <td class="paramkey"></td>
1.1 misho 6729: <td></td>
1.1.1.2 ! misho 6730: <td class="paramtype">const uint8_t * </td>
! 6731: <td class="paramname"><em>payload</em>, </td>
1.1 misho 6732: </tr>
6733: <tr>
1.1.1.2 ! misho 6734: <td class="paramkey"></td>
1.1 misho 6735: <td></td>
1.1.1.2 ! misho 6736: <td class="paramtype">uint32_t </td>
! 6737: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 6738: </tr>
6739: <tr>
1.1.1.2 ! misho 6740: <td class="paramkey"></td>
1.1 misho 6741: <td></td>
1.1.1.2 ! misho 6742: <td class="paramtype">libnet_t * </td>
! 6743: <td class="paramname"><em>l</em>, </td>
1.1 misho 6744: </tr>
6745: <tr>
1.1.1.2 ! misho 6746: <td class="paramkey"></td>
1.1 misho 6747: <td></td>
1.1.1.2 ! misho 6748: <td class="paramtype">libnet_ptag_t </td>
! 6749: <td class="paramname"><em>ptag</em> </td>
1.1 misho 6750: </tr>
6751: <tr>
6752: <td></td>
1.1.1.2 ! misho 6753: <td>)</td>
! 6754: <td></td><td></td>
1.1 misho 6755: </tr>
6756: </table>
1.1.1.2 ! misho 6757: </div>
! 6758: <div class="memdoc">
! 6759: <p>Builds a token ring header. </p>
! 6760: <dl><dt><b>Parameters:</b></dt><dd>
! 6761: <table class="params">
! 6762: <tr><td class="paramname">ac</td><td>access control </td></tr>
! 6763: <tr><td class="paramname">fc</td><td>frame control </td></tr>
! 6764: <tr><td class="paramname">dst</td><td>destination address </td></tr>
! 6765: <tr><td class="paramname">src</td><td>source address </td></tr>
! 6766: <tr><td class="paramname">dsap</td><td>destination service access point </td></tr>
! 6767: <tr><td class="paramname">ssap</td><td>source service access point </td></tr>
! 6768: <tr><td class="paramname">cf</td><td>control field </td></tr>
! 6769: <tr><td class="paramname">oui</td><td>Organizationally Unique Identifier </td></tr>
! 6770: <tr><td class="paramname">type</td><td>upper layer protocol type </td></tr>
! 6771: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 6772: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 6773: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6774: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 6775: </table>
! 6776: </dd>
! 6777: </dl>
! 6778: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 6779:
! 6780: </div>
! 6781: </div>
! 6782: <a class="anchor" id="a1dee17aa5276df3587ee276b1b90d8fa"></a><!-- doxytag: member="libnet-functions.h::libnet_build_udp" ref="a1dee17aa5276df3587ee276b1b90d8fa" args="(uint16_t sp, uint16_t dp, uint16_t len, uint16_t sum, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 6783: <div class="memitem">
! 6784: <div class="memproto">
! 6785: <table class="memname">
1.1 misho 6786: <tr>
1.1.1.2 ! misho 6787: <td class="memname">libnet_ptag_t libnet_build_udp </td>
! 6788: <td>(</td>
! 6789: <td class="paramtype">uint16_t </td>
! 6790: <td class="paramname"><em>sp</em>, </td>
1.1 misho 6791: </tr>
6792: <tr>
1.1.1.2 ! misho 6793: <td class="paramkey"></td>
1.1 misho 6794: <td></td>
1.1.1.2 ! misho 6795: <td class="paramtype">uint16_t </td>
! 6796: <td class="paramname"><em>dp</em>, </td>
1.1 misho 6797: </tr>
6798: <tr>
1.1.1.2 ! misho 6799: <td class="paramkey"></td>
1.1 misho 6800: <td></td>
1.1.1.2 ! misho 6801: <td class="paramtype">uint16_t </td>
! 6802: <td class="paramname"><em>len</em>, </td>
1.1 misho 6803: </tr>
6804: <tr>
1.1.1.2 ! misho 6805: <td class="paramkey"></td>
1.1 misho 6806: <td></td>
1.1.1.2 ! misho 6807: <td class="paramtype">uint16_t </td>
! 6808: <td class="paramname"><em>sum</em>, </td>
1.1 misho 6809: </tr>
6810: <tr>
1.1.1.2 ! misho 6811: <td class="paramkey"></td>
1.1 misho 6812: <td></td>
1.1.1.2 ! misho 6813: <td class="paramtype">const uint8_t * </td>
! 6814: <td class="paramname"><em>payload</em>, </td>
1.1 misho 6815: </tr>
6816: <tr>
1.1.1.2 ! misho 6817: <td class="paramkey"></td>
1.1 misho 6818: <td></td>
1.1.1.2 ! misho 6819: <td class="paramtype">uint32_t </td>
! 6820: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 6821: </tr>
6822: <tr>
1.1.1.2 ! misho 6823: <td class="paramkey"></td>
1.1 misho 6824: <td></td>
1.1.1.2 ! misho 6825: <td class="paramtype">libnet_t * </td>
! 6826: <td class="paramname"><em>l</em>, </td>
1.1 misho 6827: </tr>
6828: <tr>
1.1.1.2 ! misho 6829: <td class="paramkey"></td>
1.1 misho 6830: <td></td>
1.1.1.2 ! misho 6831: <td class="paramtype">libnet_ptag_t </td>
! 6832: <td class="paramname"><em>ptag</em> </td>
1.1 misho 6833: </tr>
6834: <tr>
6835: <td></td>
1.1.1.2 ! misho 6836: <td>)</td>
! 6837: <td></td><td></td>
1.1 misho 6838: </tr>
6839: </table>
1.1.1.2 ! misho 6840: </div>
! 6841: <div class="memdoc">
! 6842: <p>Builds an RFC 768 User Datagram Protocol (UDP) header. </p>
! 6843: <dl><dt><b>Parameters:</b></dt><dd>
! 6844: <table class="params">
! 6845: <tr><td class="paramname">sp</td><td>source port </td></tr>
! 6846: <tr><td class="paramname">dp</td><td>destination port </td></tr>
! 6847: <tr><td class="paramname">len</td><td>total length of the UDP packet </td></tr>
! 6848: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 6849: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 6850: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 6851: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6852: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
! 6853: </table>
! 6854: </dd>
! 6855: </dl>
! 6856: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 6857:
! 6858: </div>
! 6859: </div>
! 6860: <a class="anchor" id="a687daca40884d1125c4115ce215060f6"></a><!-- doxytag: member="libnet-functions.h::libnet_build_vrrp" ref="a687daca40884d1125c4115ce215060f6" args="(uint8_t version, uint8_t type, uint8_t vrouter_id, uint8_t priority, uint8_t ip_count, uint8_t auth_type, uint8_t advert_int, uint16_t sum, const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)" -->
! 6861: <div class="memitem">
! 6862: <div class="memproto">
! 6863: <table class="memname">
1.1 misho 6864: <tr>
1.1.1.2 ! misho 6865: <td class="memname">libnet_ptag_t libnet_build_vrrp </td>
! 6866: <td>(</td>
! 6867: <td class="paramtype">uint8_t </td>
! 6868: <td class="paramname"><em>version</em>, </td>
1.1 misho 6869: </tr>
6870: <tr>
1.1.1.2 ! misho 6871: <td class="paramkey"></td>
1.1 misho 6872: <td></td>
1.1.1.2 ! misho 6873: <td class="paramtype">uint8_t </td>
! 6874: <td class="paramname"><em>type</em>, </td>
1.1 misho 6875: </tr>
6876: <tr>
1.1.1.2 ! misho 6877: <td class="paramkey"></td>
1.1 misho 6878: <td></td>
1.1.1.2 ! misho 6879: <td class="paramtype">uint8_t </td>
! 6880: <td class="paramname"><em>vrouter_id</em>, </td>
1.1 misho 6881: </tr>
6882: <tr>
1.1.1.2 ! misho 6883: <td class="paramkey"></td>
1.1 misho 6884: <td></td>
1.1.1.2 ! misho 6885: <td class="paramtype">uint8_t </td>
! 6886: <td class="paramname"><em>priority</em>, </td>
1.1 misho 6887: </tr>
6888: <tr>
1.1.1.2 ! misho 6889: <td class="paramkey"></td>
1.1 misho 6890: <td></td>
1.1.1.2 ! misho 6891: <td class="paramtype">uint8_t </td>
! 6892: <td class="paramname"><em>ip_count</em>, </td>
1.1 misho 6893: </tr>
6894: <tr>
1.1.1.2 ! misho 6895: <td class="paramkey"></td>
1.1 misho 6896: <td></td>
1.1.1.2 ! misho 6897: <td class="paramtype">uint8_t </td>
! 6898: <td class="paramname"><em>auth_type</em>, </td>
1.1 misho 6899: </tr>
6900: <tr>
1.1.1.2 ! misho 6901: <td class="paramkey"></td>
1.1 misho 6902: <td></td>
1.1.1.2 ! misho 6903: <td class="paramtype">uint8_t </td>
! 6904: <td class="paramname"><em>advert_int</em>, </td>
1.1 misho 6905: </tr>
6906: <tr>
1.1.1.2 ! misho 6907: <td class="paramkey"></td>
1.1 misho 6908: <td></td>
1.1.1.2 ! misho 6909: <td class="paramtype">uint16_t </td>
! 6910: <td class="paramname"><em>sum</em>, </td>
1.1 misho 6911: </tr>
6912: <tr>
1.1.1.2 ! misho 6913: <td class="paramkey"></td>
1.1 misho 6914: <td></td>
1.1.1.2 ! misho 6915: <td class="paramtype">const uint8_t * </td>
! 6916: <td class="paramname"><em>payload</em>, </td>
1.1 misho 6917: </tr>
6918: <tr>
1.1.1.2 ! misho 6919: <td class="paramkey"></td>
1.1 misho 6920: <td></td>
1.1.1.2 ! misho 6921: <td class="paramtype">uint32_t </td>
! 6922: <td class="paramname"><em>payload_s</em>, </td>
1.1 misho 6923: </tr>
6924: <tr>
1.1.1.2 ! misho 6925: <td class="paramkey"></td>
1.1 misho 6926: <td></td>
1.1.1.2 ! misho 6927: <td class="paramtype">libnet_t * </td>
! 6928: <td class="paramname"><em>l</em>, </td>
1.1 misho 6929: </tr>
6930: <tr>
1.1.1.2 ! misho 6931: <td class="paramkey"></td>
1.1 misho 6932: <td></td>
1.1.1.2 ! misho 6933: <td class="paramtype">libnet_ptag_t </td>
! 6934: <td class="paramname"><em>ptag</em> </td>
1.1 misho 6935: </tr>
6936: <tr>
6937: <td></td>
1.1.1.2 ! misho 6938: <td>)</td>
! 6939: <td></td><td></td>
1.1 misho 6940: </tr>
6941: </table>
1.1.1.2 ! misho 6942: </div>
! 6943: <div class="memdoc">
! 6944: <p>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. </p>
! 6945: <dl><dt><b>Parameters:</b></dt><dd>
! 6946: <table class="params">
! 6947: <tr><td class="paramname">version</td><td>VRRP version (should be 2) </td></tr>
! 6948: <tr><td class="paramname">type</td><td>VRRP packet type (should be 1 -- ADVERTISEMENT) </td></tr>
! 6949: <tr><td class="paramname">vrouter_id</td><td>virtual router identification </td></tr>
! 6950: <tr><td class="paramname">priority</td><td>priority (higher numbers indicate higher priority) </td></tr>
! 6951: <tr><td class="paramname">ip_count</td><td>number of IPv4 addresses contained in this advertisement </td></tr>
! 6952: <tr><td class="paramname">auth_type</td><td>type of authentication (0, 1, 2 -- see RFC) </td></tr>
! 6953: <tr><td class="paramname">advert_int</td><td>interval between advertisements </td></tr>
! 6954: <tr><td class="paramname">sum</td><td>checksum (0 for libnet to autofill) </td></tr>
! 6955: <tr><td class="paramname">payload</td><td>optional payload or NULL </td></tr>
! 6956: <tr><td class="paramname">payload_s</td><td>payload length or 0 </td></tr>
! 6957: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6958: <tr><td class="paramname">ptag</td><td>protocol tag to modify an existing header, 0 to build a new one </td></tr>
1.1 misho 6959: </table>
1.1.1.2 ! misho 6960: </dd>
1.1 misho 6961: </dl>
1.1.1.2 ! misho 6962: <dl class="return"><dt><b>Returns:</b></dt><dd>protocol tag value on success, -1 on error </dd></dl>
! 6963:
! 6964: </div>
! 6965: </div>
! 6966: <a class="anchor" id="ab84889f7fe57a1801cf03eceac47463e"></a><!-- doxytag: member="libnet-functions.h::libnet_clear_packet" ref="ab84889f7fe57a1801cf03eceac47463e" args="(libnet_t *l)" -->
! 6967: <div class="memitem">
! 6968: <div class="memproto">
! 6969: <table class="memname">
! 6970: <tr>
! 6971: <td class="memname">void libnet_clear_packet </td>
! 6972: <td>(</td>
! 6973: <td class="paramtype">libnet_t * </td>
! 6974: <td class="paramname"><em>l</em></td><td>)</td>
! 6975: <td></td>
! 6976: </tr>
! 6977: </table>
! 6978: </div>
! 6979: <div class="memdoc">
! 6980: <p>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. </p>
! 6981: <dl><dt><b>Parameters:</b></dt><dd>
! 6982: <table class="params">
! 6983: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 6984: </table>
! 6985: </dd>
! 6986: </dl>
! 6987:
! 6988: </div>
! 6989: </div>
! 6990: <a class="anchor" id="a20887ffe940f1d2c5bcae79a188176c6"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_add" ref="a20887ffe940f1d2c5bcae79a188176c6" args="(libnet_t *l, char *label)" -->
! 6991: <div class="memitem">
! 6992: <div class="memproto">
! 6993: <table class="memname">
1.1 misho 6994: <tr>
1.1.1.2 ! misho 6995: <td class="memname">int libnet_cq_add </td>
! 6996: <td>(</td>
! 6997: <td class="paramtype">libnet_t * </td>
! 6998: <td class="paramname"><em>l</em>, </td>
1.1 misho 6999: </tr>
7000: <tr>
1.1.1.2 ! misho 7001: <td class="paramkey"></td>
1.1 misho 7002: <td></td>
1.1.1.2 ! misho 7003: <td class="paramtype">char * </td>
! 7004: <td class="paramname"><em>label</em> </td>
1.1 misho 7005: </tr>
7006: <tr>
7007: <td></td>
1.1.1.2 ! misho 7008: <td>)</td>
! 7009: <td></td><td></td>
1.1 misho 7010: </tr>
7011: </table>
1.1.1.2 ! misho 7012: </div>
! 7013: <div class="memdoc">
! 7014: <p>[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#a0422723053baf0b254d1ba2215d88118">libnet_init()</a>. If the context queue in write locked, this function will fail. </p>
! 7015: <dl><dt><b>Parameters:</b></dt><dd>
! 7016: <table class="params">
! 7017: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7018: <tr><td class="paramname">label</td><td>a canonical name given to recognize the new context, no longer than LIBNET_LABEL_SIZE </td></tr>
! 7019: </table>
! 7020: </dd>
! 7021: </dl>
! 7022: <dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
1.1 misho 7023:
1.1.1.2 ! misho 7024: </div>
! 7025: </div>
! 7026: <a class="anchor" id="a565d99e292980d5033bef2d186596217"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_destroy" ref="a565d99e292980d5033bef2d186596217" args="(void)" -->
! 7027: <div class="memitem">
! 7028: <div class="memproto">
! 7029: <table class="memname">
! 7030: <tr>
! 7031: <td class="memname">void libnet_cq_destroy </td>
! 7032: <td>(</td>
! 7033: <td class="paramtype">void </td>
! 7034: <td class="paramname"></td><td>)</td>
! 7035: <td></td>
1.1 misho 7036: </tr>
7037: </table>
1.1.1.2 ! misho 7038: </div>
! 7039: <div class="memdoc">
! 7040: <p>[Context Queue] Destroys the entire context queue, calling <a class="el" href="libnet-functions_8h.html#a591804711cffa92582703a5aedbd9b25">libnet_destroy()</a> on each member context. </p>
1.1 misho 7041:
1.1.1.2 ! misho 7042: </div>
! 7043: </div>
! 7044: <a class="anchor" id="a127764f17e4457f96fb4b976a1666efa"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_end_loop" ref="a127764f17e4457f96fb4b976a1666efa" args="(void)" -->
! 7045: <div class="memitem">
! 7046: <div class="memproto">
! 7047: <table class="memname">
! 7048: <tr>
! 7049: <td class="memname">uint32_t libnet_cq_end_loop </td>
! 7050: <td>(</td>
! 7051: <td class="paramtype">void </td>
! 7052: <td class="paramname"></td><td>)</td>
! 7053: <td></td>
1.1 misho 7054: </tr>
7055: </table>
1.1.1.2 ! misho 7056: </div>
! 7057: <div class="memdoc">
! 7058: <p>[Context Queue] </p>
1.1 misho 7059:
1.1.1.2 ! misho 7060: </div>
! 7061: </div>
! 7062: <a class="anchor" id="a0cd216f0e5563ee06043a8ebfa16fe57"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_find_by_label" ref="a0cd216f0e5563ee06043a8ebfa16fe57" args="(char *label)" -->
! 7063: <div class="memitem">
! 7064: <div class="memproto">
! 7065: <table class="memname">
! 7066: <tr>
! 7067: <td class="memname">libnet_t* libnet_cq_find_by_label </td>
! 7068: <td>(</td>
! 7069: <td class="paramtype">char * </td>
! 7070: <td class="paramname"><em>label</em></td><td>)</td>
! 7071: <td></td>
1.1 misho 7072: </tr>
7073: </table>
1.1.1.2 ! misho 7074: </div>
! 7075: <div class="memdoc">
! 7076: <p>[Context Queue] Locates a libnet context from the queue, indexed by a canonical label. </p>
! 7077: <dl><dt><b>Parameters:</b></dt><dd>
! 7078: <table class="params">
! 7079: <tr><td class="paramname">label</td><td>canonical label of the libnet context to retrieve </td></tr>
! 7080: </table>
! 7081: </dd>
! 7082: </dl>
! 7083: <dl class="return"><dt><b>Returns:</b></dt><dd>the expected libnet context, NULL on failure </dd></dl>
! 7084:
! 7085: </div>
! 7086: </div>
! 7087: <a class="anchor" id="abb1341d217de4d9c39ec484951e518b0"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_getlabel" ref="abb1341d217de4d9c39ec484951e518b0" args="(libnet_t *l)" -->
! 7088: <div class="memitem">
! 7089: <div class="memproto">
! 7090: <table class="memname">
! 7091: <tr>
! 7092: <td class="memname">const char* libnet_cq_getlabel </td>
! 7093: <td>(</td>
! 7094: <td class="paramtype">libnet_t * </td>
! 7095: <td class="paramname"><em>l</em></td><td>)</td>
! 7096: <td></td>
1.1 misho 7097: </tr>
1.1.1.2 ! misho 7098: </table>
! 7099: </div>
! 7100: <div class="memdoc">
! 7101: <p>[Context Queue] Returns the canonical label associated with the context. </p>
! 7102: <dl><dt><b>Parameters:</b></dt><dd>
! 7103: <table class="params">
! 7104: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7105: </table>
! 7106: </dd>
! 7107: </dl>
! 7108: <dl class="return"><dt><b>Returns:</b></dt><dd>pointer to the libnet context's label </dd></dl>
1.1 misho 7109:
1.1.1.2 ! misho 7110: </div>
! 7111: </div>
! 7112: <a class="anchor" id="a7e98a045ac6e29ca421507d9a200b5aa"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_head" ref="a7e98a045ac6e29ca421507d9a200b5aa" args="(void)" -->
! 7113: <div class="memitem">
! 7114: <div class="memproto">
! 7115: <table class="memname">
! 7116: <tr>
! 7117: <td class="memname">libnet_t* libnet_cq_head </td>
! 7118: <td>(</td>
! 7119: <td class="paramtype">void </td>
! 7120: <td class="paramname"></td><td>)</td>
! 7121: <td></td>
! 7122: </tr>
1.1 misho 7123: </table>
1.1.1.2 ! misho 7124: </div>
! 7125: <div class="memdoc">
! 7126: <p>[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>
! 7127: <p>for (l = <a class="el" href="libnet-functions_8h.html#a7e98a045ac6e29ca421507d9a200b5aa">libnet_cq_head()</a>; <a class="el" href="libnet-functions_8h.html#aab1eb1e3ae64cde579a5a6035d5406c8">libnet_cq_last()</a>; l = <a class="el" href="libnet-functions_8h.html#ad312f3182e3e5367db87fc6bab32604d">libnet_cq_next()</a>) { ... }</p>
! 7128: <p>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#af36eb84eee10c525720134cfadb50a3e">for_each_context_in_cq(l)</a>. Warning: do not call the iterator more than once in a single loop. </p>
! 7129: <dl class="return"><dt><b>Returns:</b></dt><dd>the head of the context queue </dd></dl>
! 7130:
! 7131: </div>
! 7132: </div>
! 7133: <a class="anchor" id="aab1eb1e3ae64cde579a5a6035d5406c8"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_last" ref="aab1eb1e3ae64cde579a5a6035d5406c8" args="(void)" -->
! 7134: <div class="memitem">
! 7135: <div class="memproto">
! 7136: <table class="memname">
! 7137: <tr>
! 7138: <td class="memname">int libnet_cq_last </td>
! 7139: <td>(</td>
! 7140: <td class="paramtype">void </td>
! 7141: <td class="paramname"></td><td>)</td>
! 7142: <td></td>
1.1 misho 7143: </tr>
1.1.1.2 ! misho 7144: </table>
! 7145: </div>
! 7146: <div class="memdoc">
! 7147: <p>[Context Queue] Check whether the iterator is at the last context in the queue. </p>
! 7148: <dl class="return"><dt><b>Returns:</b></dt><dd>1 if at the end of the context queue, 0 otherwise </dd></dl>
1.1 misho 7149:
1.1.1.2 ! misho 7150: </div>
! 7151: </div>
! 7152: <a class="anchor" id="ad312f3182e3e5367db87fc6bab32604d"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_next" ref="ad312f3182e3e5367db87fc6bab32604d" args="(void)" -->
! 7153: <div class="memitem">
! 7154: <div class="memproto">
! 7155: <table class="memname">
! 7156: <tr>
! 7157: <td class="memname">libnet_t* libnet_cq_next </td>
! 7158: <td>(</td>
! 7159: <td class="paramtype">void </td>
! 7160: <td class="paramname"></td><td>)</td>
! 7161: <td></td>
! 7162: </tr>
1.1 misho 7163: </table>
1.1.1.2 ! misho 7164: </div>
! 7165: <div class="memdoc">
! 7166: <p>[Context Queue] Get next context from the context queue. </p>
! 7167: <dl class="return"><dt><b>Returns:</b></dt><dd>the next context from the context queue </dd></dl>
! 7168:
! 7169: </div>
! 7170: </div>
! 7171: <a class="anchor" id="a29f60504a0fe9b7bf6f5a962063118bb"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_remove" ref="a29f60504a0fe9b7bf6f5a962063118bb" args="(libnet_t *l)" -->
! 7172: <div class="memitem">
! 7173: <div class="memproto">
! 7174: <table class="memname">
! 7175: <tr>
! 7176: <td class="memname">libnet_t* libnet_cq_remove </td>
! 7177: <td>(</td>
! 7178: <td class="paramtype">libnet_t * </td>
! 7179: <td class="paramname"><em>l</em></td><td>)</td>
! 7180: <td></td>
1.1 misho 7181: </tr>
1.1.1.2 ! misho 7182: </table>
! 7183: </div>
! 7184: <div class="memdoc">
! 7185: <p>[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#a591804711cffa92582703a5aedbd9b25">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#a4e972664a0d839eab039f8fb2379987a">libnet_cq_remove_by_label()</a>. If the context queue is write locked, this function will fail. </p>
! 7186: <dl><dt><b>Parameters:</b></dt><dd>
! 7187: <table class="params">
! 7188: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7189: </table>
! 7190: </dd>
! 7191: </dl>
! 7192: <dl class="return"><dt><b>Returns:</b></dt><dd>the pointer to the removed libnet context, NULL on failure </dd></dl>
1.1 misho 7193:
1.1.1.2 ! misho 7194: </div>
! 7195: </div>
! 7196: <a class="anchor" id="a4e972664a0d839eab039f8fb2379987a"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_remove_by_label" ref="a4e972664a0d839eab039f8fb2379987a" args="(char *label)" -->
! 7197: <div class="memitem">
! 7198: <div class="memproto">
! 7199: <table class="memname">
! 7200: <tr>
! 7201: <td class="memname">libnet_t* libnet_cq_remove_by_label </td>
! 7202: <td>(</td>
! 7203: <td class="paramtype">char * </td>
! 7204: <td class="paramname"><em>label</em></td><td>)</td>
! 7205: <td></td>
! 7206: </tr>
1.1 misho 7207: </table>
1.1.1.2 ! misho 7208: </div>
! 7209: <div class="memdoc">
! 7210: <p>[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#a591804711cffa92582703a5aedbd9b25">libnet_destroy()</a>. If the context queue is write locked, this function will fail. </p>
! 7211: <dl><dt><b>Parameters:</b></dt><dd>
! 7212: <table class="params">
! 7213: <tr><td class="paramname">label</td><td>canonical name of the context to remove </td></tr>
! 7214: </table>
! 7215: </dd>
! 7216: </dl>
! 7217: <dl class="return"><dt><b>Returns:</b></dt><dd>the pointer to the removed libnet context, NULL on failure </dd></dl>
! 7218:
! 7219: </div>
! 7220: </div>
! 7221: <a class="anchor" id="ad26ce874f56c59091f4811a7816400a8"></a><!-- doxytag: member="libnet-functions.h::libnet_cq_size" ref="ad26ce874f56c59091f4811a7816400a8" args="(void)" -->
! 7222: <div class="memitem">
! 7223: <div class="memproto">
! 7224: <table class="memname">
! 7225: <tr>
! 7226: <td class="memname">uint32_t libnet_cq_size </td>
! 7227: <td>(</td>
! 7228: <td class="paramtype">void </td>
! 7229: <td class="paramname"></td><td>)</td>
! 7230: <td></td>
1.1 misho 7231: </tr>
1.1.1.2 ! misho 7232: </table>
! 7233: </div>
! 7234: <div class="memdoc">
! 7235: <p>[Context Queue] Function returns the number of libnet contexts that are in the queue. </p>
! 7236: <dl class="return"><dt><b>Returns:</b></dt><dd>the number of libnet contexts currently in the queue </dd></dl>
1.1 misho 7237:
1.1.1.2 ! misho 7238: </div>
! 7239: </div>
! 7240: <a class="anchor" id="a591804711cffa92582703a5aedbd9b25"></a><!-- doxytag: member="libnet-functions.h::libnet_destroy" ref="a591804711cffa92582703a5aedbd9b25" args="(libnet_t *l)" -->
! 7241: <div class="memitem">
! 7242: <div class="memproto">
! 7243: <table class="memname">
! 7244: <tr>
! 7245: <td class="memname">void libnet_destroy </td>
! 7246: <td>(</td>
! 7247: <td class="paramtype">libnet_t * </td>
! 7248: <td class="paramname"><em>l</em></td><td>)</td>
! 7249: <td></td>
! 7250: </tr>
1.1 misho 7251: </table>
1.1.1.2 ! misho 7252: </div>
! 7253: <div class="memdoc">
! 7254: <p>Shuts down the libnet session referenced by l. It closes the network interface and frees all internal memory structures associated with l. </p>
! 7255: <dl><dt><b>Parameters:</b></dt><dd>
! 7256: <table class="params">
! 7257: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
1.1 misho 7258: </table>
1.1.1.2 ! misho 7259: </dd>
1.1 misho 7260: </dl>
7261:
1.1.1.2 ! misho 7262: </div>
! 7263: </div>
! 7264: <a class="anchor" id="a3aa6623246e13310dc6f9f9834e7313b"></a><!-- doxytag: member="libnet-functions.h::libnet_diag_dump_context" ref="a3aa6623246e13310dc6f9f9834e7313b" args="(libnet_t *l)" -->
! 7265: <div class="memitem">
! 7266: <div class="memproto">
! 7267: <table class="memname">
! 7268: <tr>
! 7269: <td class="memname">void libnet_diag_dump_context </td>
! 7270: <td>(</td>
! 7271: <td class="paramtype">libnet_t * </td>
! 7272: <td class="paramname"><em>l</em></td><td>)</td>
! 7273: <td></td>
! 7274: </tr>
1.1 misho 7275: </table>
1.1.1.2 ! misho 7276: </div>
! 7277: <div class="memdoc">
! 7278: <p>[Diagnostic] Prints the contents of the given context. </p>
! 7279: <dl><dt><b>Parameters:</b></dt><dd>
! 7280: <table class="params">
! 7281: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
1.1 misho 7282: </table>
1.1.1.2 ! misho 7283: </dd>
1.1 misho 7284: </dl>
1.1.1.2 ! misho 7285:
! 7286: </div>
! 7287: </div>
! 7288: <a class="anchor" id="adb2f7d417f05a058c0c2c7f76b6f66e6"></a><!-- doxytag: member="libnet-functions.h::libnet_diag_dump_hex" ref="adb2f7d417f05a058c0c2c7f76b6f66e6" args="(const uint8_t *packet, uint32_t len, int swap, FILE *stream)" -->
! 7289: <div class="memitem">
! 7290: <div class="memproto">
! 7291: <table class="memname">
1.1 misho 7292: <tr>
1.1.1.2 ! misho 7293: <td class="memname">void libnet_diag_dump_hex </td>
! 7294: <td>(</td>
! 7295: <td class="paramtype">const uint8_t * </td>
! 7296: <td class="paramname"><em>packet</em>, </td>
1.1 misho 7297: </tr>
7298: <tr>
1.1.1.2 ! misho 7299: <td class="paramkey"></td>
1.1 misho 7300: <td></td>
1.1.1.2 ! misho 7301: <td class="paramtype">uint32_t </td>
! 7302: <td class="paramname"><em>len</em>, </td>
1.1 misho 7303: </tr>
7304: <tr>
1.1.1.2 ! misho 7305: <td class="paramkey"></td>
1.1 misho 7306: <td></td>
1.1.1.2 ! misho 7307: <td class="paramtype">int </td>
! 7308: <td class="paramname"><em>swap</em>, </td>
1.1 misho 7309: </tr>
7310: <tr>
1.1.1.2 ! misho 7311: <td class="paramkey"></td>
1.1 misho 7312: <td></td>
1.1.1.2 ! misho 7313: <td class="paramtype">FILE * </td>
! 7314: <td class="paramname"><em>stream</em> </td>
1.1 misho 7315: </tr>
7316: <tr>
7317: <td></td>
1.1.1.2 ! misho 7318: <td>)</td>
! 7319: <td></td><td></td>
1.1 misho 7320: </tr>
7321: </table>
1.1.1.2 ! misho 7322: </div>
! 7323: <div class="memdoc">
! 7324: <p>[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. </p>
! 7325: <dl><dt><b>Parameters:</b></dt><dd>
! 7326: <table class="params">
! 7327: <tr><td class="paramname">packet</td><td>the packet to print </td></tr>
! 7328: <tr><td class="paramname">len</td><td>length of the packet in bytes </td></tr>
! 7329: <tr><td class="paramname">swap</td><td>1 to swap byte order, 0 to not. Counter-intuitively, it is necessary to swap in order to see the byte order as it is on the wire (this may be a bug). </td></tr>
! 7330: <tr><td class="paramname">stream</td><td>a stream pointer to print to </td></tr>
1.1 misho 7331: </table>
1.1.1.2 ! misho 7332: </dd>
1.1 misho 7333: </dl>
7334:
1.1.1.2 ! misho 7335: </div>
! 7336: </div>
! 7337: <a class="anchor" id="a9825c6c69efd6ef24545d59177a333e6"></a><!-- doxytag: member="libnet-functions.h::libnet_diag_dump_pblock" ref="a9825c6c69efd6ef24545d59177a333e6" args="(libnet_t *l)" -->
! 7338: <div class="memitem">
! 7339: <div class="memproto">
! 7340: <table class="memname">
! 7341: <tr>
! 7342: <td class="memname">void libnet_diag_dump_pblock </td>
! 7343: <td>(</td>
! 7344: <td class="paramtype">libnet_t * </td>
! 7345: <td class="paramname"><em>l</em></td><td>)</td>
! 7346: <td></td>
! 7347: </tr>
1.1 misho 7348: </table>
1.1.1.2 ! misho 7349: </div>
! 7350: <div class="memdoc">
! 7351: <p>[Diagnostic] Prints the contents of every pblock. </p>
! 7352: <dl><dt><b>Parameters:</b></dt><dd>
! 7353: <table class="params">
! 7354: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
1.1 misho 7355: </table>
1.1.1.2 ! misho 7356: </dd>
1.1 misho 7357: </dl>
7358:
1.1.1.2 ! misho 7359: </div>
! 7360: </div>
! 7361: <a class="anchor" id="a57fed7106abf515c5883611eded7ad88"></a><!-- doxytag: member="libnet-functions.h::libnet_diag_dump_pblock_type" ref="a57fed7106abf515c5883611eded7ad88" args="(uint8_t type)" -->
! 7362: <div class="memitem">
! 7363: <div class="memproto">
! 7364: <table class="memname">
! 7365: <tr>
! 7366: <td class="memname">char* libnet_diag_dump_pblock_type </td>
! 7367: <td>(</td>
! 7368: <td class="paramtype">uint8_t </td>
! 7369: <td class="paramname"><em>type</em></td><td>)</td>
! 7370: <td></td>
1.1 misho 7371: </tr>
7372: </table>
1.1.1.2 ! misho 7373: </div>
! 7374: <div class="memdoc">
! 7375: <p>[Diagnostic] Returns the canonical name of the pblock type. </p>
! 7376: <dl><dt><b>Parameters:</b></dt><dd>
! 7377: <table class="params">
! 7378: <tr><td class="paramname">type</td><td>pblock type </td></tr>
! 7379: </table>
! 7380: </dd>
! 7381: </dl>
! 7382: <dl class="return"><dt><b>Returns:</b></dt><dd>a string representing the pblock type type or "unknown" for an unknown value </dd></dl>
1.1 misho 7383:
1.1.1.2 ! misho 7384: </div>
! 7385: </div>
! 7386: <a class="anchor" id="a6531e479687de8d195bd1605422735ca"></a><!-- doxytag: member="libnet-functions.h::libnet_get_hwaddr" ref="a6531e479687de8d195bd1605422735ca" args="(libnet_t *l)" -->
! 7387: <div class="memitem">
! 7388: <div class="memproto">
! 7389: <table class="memname">
! 7390: <tr>
! 7391: <td class="memname">struct libnet_ether_addr* libnet_get_hwaddr </td>
! 7392: <td>(</td>
! 7393: <td class="paramtype">libnet_t * </td>
! 7394: <td class="paramname"><em>l</em></td><td>)</td>
! 7395: <td><code> [read]</code></td>
1.1 misho 7396: </tr>
7397: </table>
1.1.1.2 ! misho 7398: </div>
! 7399: <div class="memdoc">
! 7400: <p>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#a36c0b24a4926a8f5d9d392836e915f2e">libnet_geterror()</a> will tell you why. </p>
! 7401: <dl><dt><b>Parameters:</b></dt><dd>
! 7402: <table class="params">
! 7403: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7404: </table>
! 7405: </dd>
! 7406: </dl>
! 7407: <dl class="return"><dt><b>Returns:</b></dt><dd>a pointer to the MAC address or NULL </dd></dl>
1.1 misho 7408:
1.1.1.2 ! misho 7409: </div>
! 7410: </div>
! 7411: <a class="anchor" id="ae1981c8f0923176ecf484e9cd07fea15"></a><!-- doxytag: member="libnet-functions.h::libnet_get_ipaddr4" ref="ae1981c8f0923176ecf484e9cd07fea15" args="(libnet_t *l)" -->
! 7412: <div class="memitem">
! 7413: <div class="memproto">
! 7414: <table class="memname">
! 7415: <tr>
! 7416: <td class="memname">uint32_t libnet_get_ipaddr4 </td>
! 7417: <td>(</td>
! 7418: <td class="paramtype">libnet_t * </td>
! 7419: <td class="paramname"><em>l</em></td><td>)</td>
! 7420: <td></td>
1.1 misho 7421: </tr>
7422: </table>
1.1.1.2 ! misho 7423: </div>
! 7424: <div class="memdoc">
! 7425: <p>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. </p>
! 7426: <dl><dt><b>Parameters:</b></dt><dd>
! 7427: <table class="params">
! 7428: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7429: </table>
! 7430: </dd>
! 7431: </dl>
! 7432: <dl class="return"><dt><b>Returns:</b></dt><dd>a big endian IP address suitable for use in a libnet_build function or -1 </dd></dl>
1.1 misho 7433:
1.1.1.2 ! misho 7434: </div>
! 7435: </div>
! 7436: <a class="anchor" id="a3d7de8968c2087df7a22140d7993e267"></a><!-- doxytag: member="libnet-functions.h::libnet_get_ipaddr6" ref="a3d7de8968c2087df7a22140d7993e267" args="(libnet_t *l)" -->
! 7437: <div class="memitem">
! 7438: <div class="memproto">
! 7439: <table class="memname">
! 7440: <tr>
! 7441: <td class="memname">struct libnet_in6_addr libnet_get_ipaddr6 </td>
! 7442: <td>(</td>
! 7443: <td class="paramtype">libnet_t * </td>
! 7444: <td class="paramname"><em>l</em></td><td>)</td>
! 7445: <td><code> [read]</code></td>
! 7446: </tr>
1.1 misho 7447: </table>
1.1.1.2 ! misho 7448: </div>
! 7449: <div class="memdoc">
! 7450: <p>Returns the IPv6 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 in6addr_error, a call to libnet_geterrror() will tell you why. This function is not yet implemented for Win32 platforms. </p>
! 7451: <dl><dt><b>Parameters:</b></dt><dd>
! 7452: <table class="params">
! 7453: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7454: </table>
! 7455: </dd>
! 7456: </dl>
! 7457: <dl class="return"><dt><b>Returns:</b></dt><dd>well, nothing yet </dd></dl>
! 7458:
! 7459: </div>
! 7460: </div>
! 7461: <a class="anchor" id="ab74bd339ef6343077dc79bab2063aee3"></a><!-- doxytag: member="libnet-functions.h::libnet_get_prand" ref="ab74bd339ef6343077dc79bab2063aee3" args="(int mod)" -->
! 7462: <div class="memitem">
! 7463: <div class="memproto">
! 7464: <table class="memname">
! 7465: <tr>
! 7466: <td class="memname">uint32_t libnet_get_prand </td>
! 7467: <td>(</td>
! 7468: <td class="paramtype">int </td>
! 7469: <td class="paramname"><em>mod</em></td><td>)</td>
! 7470: <td></td>
1.1 misho 7471: </tr>
1.1.1.2 ! misho 7472: </table>
! 7473: </div>
! 7474: <div class="memdoc">
! 7475: <p>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>
! 7476: <dl><dt><b>Parameters:</b></dt><dd>
! 7477: <table class="params">
! 7478: <tr><td class="paramname">mod</td><td>one the of LIBNET_PR* constants </td></tr>
! 7479: </table>
! 7480: </dd>
! 7481: </dl>
! 7482: <dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
1.1 misho 7483:
1.1.1.2 ! misho 7484: </div>
! 7485: </div>
! 7486: <a class="anchor" id="a1e68365ece2c976a75bc50e91df40ea0"></a><!-- doxytag: member="libnet-functions.h::libnet_getdevice" ref="a1e68365ece2c976a75bc50e91df40ea0" args="(libnet_t *l)" -->
! 7487: <div class="memitem">
! 7488: <div class="memproto">
! 7489: <table class="memname">
! 7490: <tr>
! 7491: <td class="memname">const char* libnet_getdevice </td>
! 7492: <td>(</td>
! 7493: <td class="paramtype">libnet_t * </td>
! 7494: <td class="paramname"><em>l</em></td><td>)</td>
! 7495: <td></td>
! 7496: </tr>
1.1 misho 7497: </table>
1.1.1.2 ! misho 7498: </div>
! 7499: <div class="memdoc">
! 7500: <p>Returns the canonical name of the device used for packet injection. </p>
! 7501: <dl><dt><b>Parameters:</b></dt><dd>
! 7502: <table class="params">
! 7503: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7504: </table>
! 7505: </dd>
! 7506: </dl>
! 7507: <dl class="return"><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>
! 7508:
! 7509: </div>
! 7510: </div>
! 7511: <a class="anchor" id="a36c0b24a4926a8f5d9d392836e915f2e"></a><!-- doxytag: member="libnet-functions.h::libnet_geterror" ref="a36c0b24a4926a8f5d9d392836e915f2e" args="(libnet_t *l)" -->
! 7512: <div class="memitem">
! 7513: <div class="memproto">
! 7514: <table class="memname">
! 7515: <tr>
! 7516: <td class="memname">char* libnet_geterror </td>
! 7517: <td>(</td>
! 7518: <td class="paramtype">libnet_t * </td>
! 7519: <td class="paramname"><em>l</em></td><td>)</td>
! 7520: <td></td>
1.1 misho 7521: </tr>
1.1.1.2 ! misho 7522: </table>
! 7523: </div>
! 7524: <div class="memdoc">
! 7525: <p>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. </p>
! 7526: <dl><dt><b>Parameters:</b></dt><dd>
! 7527: <table class="params">
! 7528: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7529: </table>
! 7530: </dd>
! 7531: </dl>
! 7532: <dl class="return"><dt><b>Returns:</b></dt><dd>an error string or NULL if no error has occured </dd></dl>
1.1 misho 7533:
1.1.1.2 ! misho 7534: </div>
! 7535: </div>
! 7536: <a class="anchor" id="ab9b137f454b3da05d4ac5fe388c1f2b8"></a><!-- doxytag: member="libnet-functions.h::libnet_getfd" ref="ab9b137f454b3da05d4ac5fe388c1f2b8" args="(libnet_t *l)" -->
! 7537: <div class="memitem">
! 7538: <div class="memproto">
! 7539: <table class="memname">
! 7540: <tr>
! 7541: <td class="memname">int libnet_getfd </td>
! 7542: <td>(</td>
! 7543: <td class="paramtype">libnet_t * </td>
! 7544: <td class="paramname"><em>l</em></td><td>)</td>
! 7545: <td></td>
! 7546: </tr>
1.1 misho 7547: </table>
1.1.1.2 ! misho 7548: </div>
! 7549: <div class="memdoc">
! 7550: <p>Returns the FILENO of the file descriptor used for packet injection. </p>
! 7551: <dl><dt><b>Parameters:</b></dt><dd>
! 7552: <table class="params">
! 7553: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7554: </table>
! 7555: </dd>
! 7556: </dl>
! 7557: <dl class="return"><dt><b>Returns:</b></dt><dd>the file number of the file descriptor used for packet injection </dd></dl>
! 7558:
! 7559: </div>
! 7560: </div>
! 7561: <a class="anchor" id="a223c01dcaba5f098964342ef2737fd85"></a><!-- doxytag: member="libnet-functions.h::libnet_getgre_length" ref="a223c01dcaba5f098964342ef2737fd85" args="(uint16_t fv)" -->
! 7562: <div class="memitem">
! 7563: <div class="memproto">
! 7564: <table class="memname">
! 7565: <tr>
! 7566: <td class="memname">uint32_t libnet_getgre_length </td>
! 7567: <td>(</td>
! 7568: <td class="paramtype">uint16_t </td>
! 7569: <td class="paramname"><em>fv</em></td><td>)</td>
! 7570: <td></td>
1.1 misho 7571: </tr>
1.1.1.2 ! misho 7572: </table>
! 7573: </div>
! 7574: <div class="memdoc">
! 7575: <dl><dt><b>Parameters:</b></dt><dd>
! 7576: <table class="params">
! 7577: <tr><td class="paramname">fv</td><td>see <a class="el" href="libnet-functions_8h.html#a8406f0a8d836df764bedd849ce24a14c">libnet_build_gre()</a>. </td></tr>
! 7578: </table>
! 7579: </dd>
! 7580: </dl>
! 7581: <dl class="return"><dt><b>Returns:</b></dt><dd>size, see <a class="el" href="libnet-functions_8h.html#a8406f0a8d836df764bedd849ce24a14c">libnet_build_gre()</a>. </dd></dl>
1.1 misho 7582:
1.1.1.2 ! misho 7583: </div>
! 7584: </div>
! 7585: <a class="anchor" id="a2a500c6b60a329d873a970ecda4ff6e9"></a><!-- doxytag: member="libnet-functions.h::libnet_getpacket_size" ref="a2a500c6b60a329d873a970ecda4ff6e9" args="(libnet_t *l)" -->
! 7586: <div class="memitem">
! 7587: <div class="memproto">
! 7588: <table class="memname">
! 7589: <tr>
! 7590: <td class="memname">uint32_t libnet_getpacket_size </td>
! 7591: <td>(</td>
! 7592: <td class="paramtype">libnet_t * </td>
! 7593: <td class="paramname"><em>l</em></td><td>)</td>
! 7594: <td></td>
! 7595: </tr>
1.1 misho 7596: </table>
1.1.1.2 ! misho 7597: </div>
! 7598: <div class="memdoc">
! 7599: <p>Returns the sum of the size of all of the pblocks inside of l (this should be the resuling packet size). </p>
! 7600: <dl><dt><b>Parameters:</b></dt><dd>
! 7601: <table class="params">
! 7602: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7603: </table>
! 7604: </dd>
! 7605: </dl>
! 7606: <dl class="return"><dt><b>Returns:</b></dt><dd>the size of the packet in l </dd></dl>
! 7607:
! 7608: </div>
! 7609: </div>
! 7610: <a class="anchor" id="a37ac07877d74f4dad59b86a15f5318d8"></a><!-- doxytag: member="libnet-functions.h::libnet_getpbuf" ref="a37ac07877d74f4dad59b86a15f5318d8" args="(libnet_t *l, libnet_ptag_t ptag)" -->
! 7611: <div class="memitem">
! 7612: <div class="memproto">
! 7613: <table class="memname">
1.1 misho 7614: <tr>
1.1.1.2 ! misho 7615: <td class="memname">uint8_t* libnet_getpbuf </td>
! 7616: <td>(</td>
! 7617: <td class="paramtype">libnet_t * </td>
! 7618: <td class="paramname"><em>l</em>, </td>
1.1 misho 7619: </tr>
7620: <tr>
1.1.1.2 ! misho 7621: <td class="paramkey"></td>
1.1 misho 7622: <td></td>
1.1.1.2 ! misho 7623: <td class="paramtype">libnet_ptag_t </td>
! 7624: <td class="paramname"><em>ptag</em> </td>
1.1 misho 7625: </tr>
7626: <tr>
7627: <td></td>
1.1.1.2 ! misho 7628: <td>)</td>
! 7629: <td></td><td></td>
1.1 misho 7630: </tr>
7631: </table>
1.1.1.2 ! misho 7632: </div>
! 7633: <div class="memdoc">
! 7634: <p>Returns the pblock buffer contents for the specified ptag; a subsequent call to <a class="el" href="libnet-functions_8h.html#a23ada8f4ab826966aeaf4ab070f3298e">libnet_getpbuf_size()</a> should be made to determine the size of the buffer. </p>
! 7635: <dl><dt><b>Parameters:</b></dt><dd>
! 7636: <table class="params">
! 7637: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7638: <tr><td class="paramname">ptag</td><td>the ptag reference number </td></tr>
! 7639: </table>
! 7640: </dd>
! 7641: </dl>
! 7642: <dl class="return"><dt><b>Returns:</b></dt><dd>a pointer to the pblock buffer or NULL on error </dd></dl>
! 7643:
! 7644: </div>
! 7645: </div>
! 7646: <a class="anchor" id="a23ada8f4ab826966aeaf4ab070f3298e"></a><!-- doxytag: member="libnet-functions.h::libnet_getpbuf_size" ref="a23ada8f4ab826966aeaf4ab070f3298e" args="(libnet_t *l, libnet_ptag_t ptag)" -->
! 7647: <div class="memitem">
! 7648: <div class="memproto">
! 7649: <table class="memname">
1.1 misho 7650: <tr>
1.1.1.2 ! misho 7651: <td class="memname">uint32_t libnet_getpbuf_size </td>
! 7652: <td>(</td>
! 7653: <td class="paramtype">libnet_t * </td>
! 7654: <td class="paramname"><em>l</em>, </td>
1.1 misho 7655: </tr>
7656: <tr>
1.1.1.2 ! misho 7657: <td class="paramkey"></td>
1.1 misho 7658: <td></td>
1.1.1.2 ! misho 7659: <td class="paramtype">libnet_ptag_t </td>
! 7660: <td class="paramname"><em>ptag</em> </td>
1.1 misho 7661: </tr>
7662: <tr>
7663: <td></td>
1.1.1.2 ! misho 7664: <td>)</td>
! 7665: <td></td><td></td>
1.1 misho 7666: </tr>
7667: </table>
1.1.1.2 ! misho 7668: </div>
! 7669: <div class="memdoc">
! 7670: <p>Returns the pblock buffer size for the specified ptag; a previous call to <a class="el" href="libnet-functions_8h.html#a37ac07877d74f4dad59b86a15f5318d8">libnet_getpbuf()</a> should be made to pull the actual buffer contents. </p>
! 7671: <dl><dt><b>Parameters:</b></dt><dd>
! 7672: <table class="params">
! 7673: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7674: <tr><td class="paramname">ptag</td><td>the ptag reference number </td></tr>
! 7675: </table>
! 7676: </dd>
! 7677: </dl>
! 7678: <dl class="return"><dt><b>Returns:</b></dt><dd>the size of the pblock buffer </dd></dl>
! 7679:
! 7680: </div>
! 7681: </div>
! 7682: <a class="anchor" id="a0b668af5fd10b0a2879a9a0ea343dce4"></a><!-- doxytag: member="libnet-functions.h::libnet_hex_aton" ref="a0b668af5fd10b0a2879a9a0ea343dce4" args="(const char *s, int *len)" -->
! 7683: <div class="memitem">
! 7684: <div class="memproto">
! 7685: <table class="memname">
1.1 misho 7686: <tr>
1.1.1.2 ! misho 7687: <td class="memname">uint8_t* libnet_hex_aton </td>
! 7688: <td>(</td>
! 7689: <td class="paramtype">const char * </td>
! 7690: <td class="paramname"><em>s</em>, </td>
1.1 misho 7691: </tr>
7692: <tr>
1.1.1.2 ! misho 7693: <td class="paramkey"></td>
1.1 misho 7694: <td></td>
1.1.1.2 ! misho 7695: <td class="paramtype">int * </td>
! 7696: <td class="paramname"><em>len</em> </td>
1.1 misho 7697: </tr>
7698: <tr>
7699: <td></td>
1.1.1.2 ! misho 7700: <td>)</td>
! 7701: <td></td><td></td>
1.1 misho 7702: </tr>
1.1.1.2 ! misho 7703: </table>
! 7704: </div>
! 7705: <div class="memdoc">
! 7706: <p>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. </p>
! 7707: <dl><dt><b>Parameters:</b></dt><dd>
! 7708: <table class="params">
! 7709: <tr><td class="paramname">s</td><td>the string to be parsed </td></tr>
! 7710: <tr><td class="paramname">len</td><td>the resulting size of the returned byte string </td></tr>
! 7711: </table>
! 7712: </dd>
! 7713: </dl>
! 7714: <dl class="return"><dt><b>Returns:</b></dt><dd>a byte string or NULL on failure </dd></dl>
1.1 misho 7715:
1.1.1.2 ! misho 7716: </div>
! 7717: </div>
! 7718: <a class="anchor" id="a917ef012eab1449bba7a0fd33438b292"></a><!-- doxytag: member="libnet-functions.h::libnet_in6_is_error" ref="a917ef012eab1449bba7a0fd33438b292" args="(struct libnet_in6_addr addr)" -->
! 7719: <div class="memitem">
! 7720: <div class="memproto">
! 7721: <table class="memname">
! 7722: <tr>
! 7723: <td class="memname">int libnet_in6_is_error </td>
! 7724: <td>(</td>
! 7725: <td class="paramtype">struct libnet_in6_addr </td>
! 7726: <td class="paramname"><em>addr</em></td><td>)</td>
! 7727: <td></td>
! 7728: </tr>
1.1 misho 7729: </table>
1.1.1.2 ! misho 7730: </div>
! 7731: <div class="memdoc">
! 7732: <p>Check a libnet_in6_addr structure for identity with in6addr_error. </p>
! 7733: <dl><dt><b>Parameters:</b></dt><dd>
! 7734: <table class="params">
! 7735: <tr><td class="paramname">addr</td><td>address to check </td></tr>
! 7736: </table>
! 7737: </dd>
! 7738: </dl>
! 7739: <dl class="return"><dt><b>Returns:</b></dt><dd>1 if addr is in6addr_error, 0 if it is not </dd></dl>
! 7740:
! 7741: </div>
! 7742: </div>
! 7743: <a class="anchor" id="a0422723053baf0b254d1ba2215d88118"></a><!-- doxytag: member="libnet-functions.h::libnet_init" ref="a0422723053baf0b254d1ba2215d88118" args="(int injection_type, const char *device, char *err_buf)" -->
! 7744: <div class="memitem">
! 7745: <div class="memproto">
! 7746: <table class="memname">
1.1 misho 7747: <tr>
1.1.1.2 ! misho 7748: <td class="memname">libnet_t* libnet_init </td>
! 7749: <td>(</td>
! 7750: <td class="paramtype">int </td>
! 7751: <td class="paramname"><em>injection_type</em>, </td>
1.1 misho 7752: </tr>
7753: <tr>
1.1.1.2 ! misho 7754: <td class="paramkey"></td>
1.1 misho 7755: <td></td>
1.1.1.2 ! misho 7756: <td class="paramtype">const char * </td>
! 7757: <td class="paramname"><em>device</em>, </td>
1.1 misho 7758: </tr>
7759: <tr>
1.1.1.2 ! misho 7760: <td class="paramkey"></td>
1.1 misho 7761: <td></td>
1.1.1.2 ! misho 7762: <td class="paramtype">char * </td>
! 7763: <td class="paramname"><em>err_buf</em> </td>
1.1 misho 7764: </tr>
7765: <tr>
7766: <td></td>
1.1.1.2 ! misho 7767: <td>)</td>
! 7768: <td></td><td></td>
1.1 misho 7769: </tr>
7770: </table>
1.1.1.2 ! misho 7771: </div>
! 7772: <div class="memdoc">
! 7773: <p>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. </p>
! 7774: <dl><dt><b>Parameters:</b></dt><dd>
! 7775: <table class="params">
! 7776: <tr><td class="paramname">injection_type</td><td>packet injection type (LIBNET_LINK, LIBNET_LINK_ADV, LIBNET_RAW4, LIBNET_RAW4_ADV, LIBNET_RAW6, LIBNET_RAW6_ADV) </td></tr>
! 7777: <tr><td class="paramname">device</td><td>the interface to use (NULL and libnet will choose one) </td></tr>
! 7778: <tr><td class="paramname">err_buf</td><td>will contain an error message on failure </td></tr>
! 7779: </table>
! 7780: </dd>
! 7781: </dl>
! 7782: <dl class="return"><dt><b>Returns:</b></dt><dd>libnet context ready for use or NULL on error. </dd></dl>
! 7783:
! 7784: </div>
! 7785: </div>
! 7786: <a class="anchor" id="a05a7f3f901c57be5aebfbd8b79416de9"></a><!-- doxytag: member="libnet-functions.h::libnet_name2addr4" ref="a05a7f3f901c57be5aebfbd8b79416de9" args="(libnet_t *l, char *host_name, uint8_t use_name)" -->
! 7787: <div class="memitem">
! 7788: <div class="memproto">
! 7789: <table class="memname">
1.1 misho 7790: <tr>
1.1.1.2 ! misho 7791: <td class="memname">uint32_t libnet_name2addr4 </td>
! 7792: <td>(</td>
! 7793: <td class="paramtype">libnet_t * </td>
! 7794: <td class="paramname"><em>l</em>, </td>
1.1 misho 7795: </tr>
7796: <tr>
1.1.1.2 ! misho 7797: <td class="paramkey"></td>
1.1 misho 7798: <td></td>
1.1.1.2 ! misho 7799: <td class="paramtype">char * </td>
! 7800: <td class="paramname"><em>host_name</em>, </td>
1.1 misho 7801: </tr>
7802: <tr>
1.1.1.2 ! misho 7803: <td class="paramkey"></td>
1.1 misho 7804: <td></td>
1.1.1.2 ! misho 7805: <td class="paramtype">uint8_t </td>
! 7806: <td class="paramname"><em>use_name</em> </td>
1.1 misho 7807: </tr>
7808: <tr>
7809: <td></td>
1.1.1.2 ! misho 7810: <td>)</td>
! 7811: <td></td><td></td>
1.1 misho 7812: </tr>
7813: </table>
1.1.1.2 ! misho 7814: </div>
! 7815: <div class="memdoc">
! 7816: <p>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. </p>
! 7817: <dl><dt><b>Parameters:</b></dt><dd>
! 7818: <table class="params">
! 7819: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7820: <tr><td class="paramname">host_name</td><td>pointer to a string containing a presentation format host name </td></tr>
! 7821: <tr><td class="paramname">use_name</td><td>LIBNET_RESOLVE or LIBNET_DONT_RESOLVE </td></tr>
! 7822: </table>
! 7823: </dd>
! 7824: </dl>
! 7825: <dl class="return"><dt><b>Returns:</b></dt><dd>network byte ordered IPv4 address or -1 (2^32 - 1) on error </dd></dl>
! 7826:
! 7827: </div>
! 7828: </div>
! 7829: <a class="anchor" id="a69a216eb71e3309c787bd00507148d15"></a><!-- doxytag: member="libnet-functions.h::libnet_name2addr6" ref="a69a216eb71e3309c787bd00507148d15" args="(libnet_t *l, const char *host_name, uint8_t use_name)" -->
! 7830: <div class="memitem">
! 7831: <div class="memproto">
! 7832: <table class="memname">
1.1 misho 7833: <tr>
1.1.1.2 ! misho 7834: <td class="memname">struct libnet_in6_addr libnet_name2addr6 </td>
! 7835: <td>(</td>
! 7836: <td class="paramtype">libnet_t * </td>
! 7837: <td class="paramname"><em>l</em>, </td>
1.1 misho 7838: </tr>
7839: <tr>
1.1.1.2 ! misho 7840: <td class="paramkey"></td>
1.1 misho 7841: <td></td>
1.1.1.2 ! misho 7842: <td class="paramtype">const char * </td>
! 7843: <td class="paramname"><em>host_name</em>, </td>
1.1 misho 7844: </tr>
7845: <tr>
1.1.1.2 ! misho 7846: <td class="paramkey"></td>
1.1 misho 7847: <td></td>
1.1.1.2 ! misho 7848: <td class="paramtype">uint8_t </td>
! 7849: <td class="paramname"><em>use_name</em> </td>
1.1 misho 7850: </tr>
7851: <tr>
7852: <td></td>
1.1.1.2 ! misho 7853: <td>)</td>
! 7854: <td></td><td><code> [read]</code></td>
1.1 misho 7855: </tr>
7856: </table>
1.1.1.2 ! misho 7857: </div>
! 7858: <div class="memdoc">
! 7859: <p>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. </p>
! 7860: <dl><dt><b>Parameters:</b></dt><dd>
! 7861: <table class="params">
! 7862: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7863: <tr><td class="paramname">host_name</td><td>pointer to a string containing a presentation format host name </td></tr>
! 7864: <tr><td class="paramname">use_name</td><td>LIBNET_RESOLVE or LIBNET_DONT_RESOLVE </td></tr>
! 7865: </table>
! 7866: </dd>
! 7867: </dl>
! 7868: <dl class="return"><dt><b>Returns:</b></dt><dd>network byte ordered IPv6 address structure </dd></dl>
1.1 misho 7869:
1.1.1.2 ! misho 7870: </div>
! 7871: </div>
! 7872: <a class="anchor" id="a39e332daa771627372a01867818b4301"></a><!-- doxytag: member="libnet-functions.h::libnet_plist_chain_dump" ref="a39e332daa771627372a01867818b4301" args="(libnet_plist_t *plist)" -->
! 7873: <div class="memitem">
! 7874: <div class="memproto">
! 7875: <table class="memname">
! 7876: <tr>
! 7877: <td class="memname">int libnet_plist_chain_dump </td>
! 7878: <td>(</td>
! 7879: <td class="paramtype">libnet_plist_t * </td>
! 7880: <td class="paramname"><em>plist</em></td><td>)</td>
! 7881: <td></td>
1.1 misho 7882: </tr>
7883: </table>
1.1.1.2 ! misho 7884: </div>
! 7885: <div class="memdoc">
! 7886: <p>Runs through the port list and prints the contents of the port list chain list to stdout. </p>
! 7887: <dl><dt><b>Parameters:</b></dt><dd>
! 7888: <table class="params">
! 7889: <tr><td class="paramname">plist</td><td>previously created portlist </td></tr>
! 7890: </table>
! 7891: </dd>
! 7892: </dl>
! 7893: <dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
! 7894:
! 7895: </div>
! 7896: </div>
! 7897: <a class="anchor" id="ab854695d1306f9af440145fc6767d953"></a><!-- doxytag: member="libnet-functions.h::libnet_plist_chain_dump_string" ref="ab854695d1306f9af440145fc6767d953" args="(libnet_plist_t *plist)" -->
! 7898: <div class="memitem">
! 7899: <div class="memproto">
! 7900: <table class="memname">
! 7901: <tr>
! 7902: <td class="memname">char* libnet_plist_chain_dump_string </td>
! 7903: <td>(</td>
! 7904: <td class="paramtype">libnet_plist_t * </td>
! 7905: <td class="paramname"><em>plist</em></td><td>)</td>
! 7906: <td></td>
1.1 misho 7907: </tr>
1.1.1.2 ! misho 7908: </table>
! 7909: </div>
! 7910: <div class="memdoc">
! 7911: <p>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. </p>
! 7912: <dl><dt><b>Parameters:</b></dt><dd>
! 7913: <table class="params">
! 7914: <tr><td class="paramname">plist</td><td>previously created portlist </td></tr>
! 7915: </table>
! 7916: </dd>
! 7917: </dl>
! 7918: <dl class="return"><dt><b>Returns:</b></dt><dd>a printable string containing the port list contents on success NULL on error </dd></dl>
1.1 misho 7919:
1.1.1.2 ! misho 7920: </div>
! 7921: </div>
! 7922: <a class="anchor" id="ab5cb1d70164207a7c279a909576058be"></a><!-- doxytag: member="libnet-functions.h::libnet_plist_chain_free" ref="ab5cb1d70164207a7c279a909576058be" args="(libnet_plist_t *plist)" -->
! 7923: <div class="memitem">
! 7924: <div class="memproto">
! 7925: <table class="memname">
! 7926: <tr>
! 7927: <td class="memname">int libnet_plist_chain_free </td>
! 7928: <td>(</td>
! 7929: <td class="paramtype">libnet_plist_t * </td>
! 7930: <td class="paramname"><em>plist</em></td><td>)</td>
! 7931: <td></td>
! 7932: </tr>
1.1 misho 7933: </table>
1.1.1.2 ! misho 7934: </div>
! 7935: <div class="memdoc">
! 7936: <p>Frees all memory associated with port list chain. </p>
! 7937: <dl><dt><b>Parameters:</b></dt><dd>
! 7938: <table class="params">
! 7939: <tr><td class="paramname">plist</td><td>previously created portlist </td></tr>
! 7940: </table>
! 7941: </dd>
! 7942: </dl>
! 7943: <dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
! 7944:
! 7945: </div>
! 7946: </div>
! 7947: <a class="anchor" id="aaee8e5f54482bf3c9b7c5b101fa8f41f"></a><!-- doxytag: member="libnet-functions.h::libnet_plist_chain_new" ref="aaee8e5f54482bf3c9b7c5b101fa8f41f" args="(libnet_t *l, libnet_plist_t **plist, char *token_list)" -->
! 7948: <div class="memitem">
! 7949: <div class="memproto">
! 7950: <table class="memname">
1.1 misho 7951: <tr>
1.1.1.2 ! misho 7952: <td class="memname">int libnet_plist_chain_new </td>
! 7953: <td>(</td>
! 7954: <td class="paramtype">libnet_t * </td>
! 7955: <td class="paramname"><em>l</em>, </td>
1.1 misho 7956: </tr>
7957: <tr>
1.1.1.2 ! misho 7958: <td class="paramkey"></td>
1.1 misho 7959: <td></td>
1.1.1.2 ! misho 7960: <td class="paramtype">libnet_plist_t ** </td>
! 7961: <td class="paramname"><em>plist</em>, </td>
1.1 misho 7962: </tr>
7963: <tr>
1.1.1.2 ! misho 7964: <td class="paramkey"></td>
1.1 misho 7965: <td></td>
1.1.1.2 ! misho 7966: <td class="paramtype">char * </td>
! 7967: <td class="paramname"><em>token_list</em> </td>
1.1 misho 7968: </tr>
7969: <tr>
7970: <td></td>
1.1.1.2 ! misho 7971: <td>)</td>
! 7972: <td></td><td></td>
1.1 misho 7973: </tr>
7974: </table>
1.1.1.2 ! misho 7975: </div>
! 7976: <div class="memdoc">
! 7977: <p>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#a36c0b24a4926a8f5d9d392836e915f2e">libnet_geterror()</a> can tell you why. </p>
! 7978: <dl><dt><b>Parameters:</b></dt><dd>
! 7979: <table class="params">
! 7980: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 7981: <tr><td class="paramname">plist</td><td>if successful, will refer to the portlist, if not, NULL </td></tr>
! 7982: <tr><td class="paramname">token_list</td><td>string containing the port list primitive </td></tr>
! 7983: </table>
! 7984: </dd>
! 7985: </dl>
! 7986: <dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
! 7987:
! 7988: </div>
! 7989: </div>
! 7990: <a class="anchor" id="aa4f1d2acd6b7411d3bf2be73cb617cb2"></a><!-- doxytag: member="libnet-functions.h::libnet_plist_chain_next_pair" ref="aa4f1d2acd6b7411d3bf2be73cb617cb2" args="(libnet_plist_t *plist, uint16_t *bport, uint16_t *eport)" -->
! 7991: <div class="memitem">
! 7992: <div class="memproto">
! 7993: <table class="memname">
1.1 misho 7994: <tr>
1.1.1.2 ! misho 7995: <td class="memname">int libnet_plist_chain_next_pair </td>
! 7996: <td>(</td>
! 7997: <td class="paramtype">libnet_plist_t * </td>
! 7998: <td class="paramname"><em>plist</em>, </td>
1.1 misho 7999: </tr>
8000: <tr>
1.1.1.2 ! misho 8001: <td class="paramkey"></td>
1.1 misho 8002: <td></td>
1.1.1.2 ! misho 8003: <td class="paramtype">uint16_t * </td>
! 8004: <td class="paramname"><em>bport</em>, </td>
1.1 misho 8005: </tr>
8006: <tr>
1.1.1.2 ! misho 8007: <td class="paramkey"></td>
1.1 misho 8008: <td></td>
1.1.1.2 ! misho 8009: <td class="paramtype">uint16_t * </td>
! 8010: <td class="paramname"><em>eport</em> </td>
1.1 misho 8011: </tr>
8012: <tr>
8013: <td></td>
1.1.1.2 ! misho 8014: <td>)</td>
! 8015: <td></td><td></td>
1.1 misho 8016: </tr>
8017: </table>
1.1.1.2 ! misho 8018: </div>
! 8019: <div class="memdoc">
! 8020: <p>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. </p>
! 8021: <dl><dt><b>Parameters:</b></dt><dd>
! 8022: <table class="params">
! 8023: <tr><td class="paramname">plist</td><td>previously created portlist </td></tr>
! 8024: <tr><td class="paramname">bport</td><td>will contain the beginning port number or 0 </td></tr>
! 8025: <tr><td class="paramname">eport</td><td>will contain the ending port number or 0 </td></tr>
! 8026: </table>
! 8027: </dd>
! 8028: </dl>
! 8029: <dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, 0 if empty, -1 on failure </dd></dl>
1.1 misho 8030:
1.1.1.2 ! misho 8031: </div>
! 8032: </div>
! 8033: <a class="anchor" id="a69470998be995ec8c5e11ecbb19137f5"></a><!-- doxytag: member="libnet-functions.h::libnet_seed_prand" ref="a69470998be995ec8c5e11ecbb19137f5" args="(libnet_t *l)" -->
! 8034: <div class="memitem">
! 8035: <div class="memproto">
! 8036: <table class="memname">
! 8037: <tr>
! 8038: <td class="memname">int libnet_seed_prand </td>
! 8039: <td>(</td>
! 8040: <td class="paramtype">libnet_t * </td>
! 8041: <td class="paramname"><em>l</em></td><td>)</td>
! 8042: <td></td>
! 8043: </tr>
1.1 misho 8044: </table>
1.1.1.2 ! misho 8045: </div>
! 8046: <div class="memdoc">
! 8047: <p>Seeds the psuedo-random number generator. </p>
! 8048: <dl><dt><b>Parameters:</b></dt><dd>
! 8049: <table class="params">
! 8050: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 8051: </table>
! 8052: </dd>
! 8053: </dl>
! 8054: <dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
! 8055:
! 8056: </div>
! 8057: </div>
! 8058: <a class="anchor" id="a886dc359d6add4b0608e8611af7e1b35"></a><!-- doxytag: member="libnet-functions.h::libnet_stats" ref="a886dc359d6add4b0608e8611af7e1b35" args="(libnet_t *l, struct libnet_stats *ls)" -->
! 8059: <div class="memitem">
! 8060: <div class="memproto">
! 8061: <table class="memname">
1.1 misho 8062: <tr>
1.1.1.2 ! misho 8063: <td class="memname">void libnet_stats </td>
! 8064: <td>(</td>
! 8065: <td class="paramtype">libnet_t * </td>
! 8066: <td class="paramname"><em>l</em>, </td>
1.1 misho 8067: </tr>
8068: <tr>
1.1.1.2 ! misho 8069: <td class="paramkey"></td>
1.1 misho 8070: <td></td>
1.1.1.2 ! misho 8071: <td class="paramtype">struct libnet_stats * </td>
! 8072: <td class="paramname"><em>ls</em> </td>
1.1 misho 8073: </tr>
8074: <tr>
8075: <td></td>
1.1.1.2 ! misho 8076: <td>)</td>
! 8077: <td></td><td></td>
1.1 misho 8078: </tr>
8079: </table>
1.1.1.2 ! misho 8080: </div>
! 8081: <div class="memdoc">
! 8082: <p>Fills in a libnet_stats structure with packet injection statistics (packets written, bytes written, packet sending errors). </p>
! 8083: <dl><dt><b>Parameters:</b></dt><dd>
! 8084: <table class="params">
! 8085: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 8086: <tr><td class="paramname">ls</td><td>pointer to a libnet statistics structure </td></tr>
1.1 misho 8087: </table>
1.1.1.2 ! misho 8088: </dd>
1.1 misho 8089: </dl>
1.1.1.2 ! misho 8090:
! 8091: </div>
! 8092: </div>
! 8093: <a class="anchor" id="ad36144707ce7994c12ef9d87dc9a2edf"></a><!-- doxytag: member="libnet-functions.h::libnet_toggle_checksum" ref="ad36144707ce7994c12ef9d87dc9a2edf" args="(libnet_t *l, libnet_ptag_t ptag, int mode)" -->
! 8094: <div class="memitem">
! 8095: <div class="memproto">
! 8096: <table class="memname">
1.1 misho 8097: <tr>
1.1.1.2 ! misho 8098: <td class="memname">int libnet_toggle_checksum </td>
! 8099: <td>(</td>
! 8100: <td class="paramtype">libnet_t * </td>
! 8101: <td class="paramname"><em>l</em>, </td>
1.1 misho 8102: </tr>
8103: <tr>
1.1.1.2 ! misho 8104: <td class="paramkey"></td>
1.1 misho 8105: <td></td>
1.1.1.2 ! misho 8106: <td class="paramtype">libnet_ptag_t </td>
! 8107: <td class="paramname"><em>ptag</em>, </td>
1.1 misho 8108: </tr>
8109: <tr>
1.1.1.2 ! misho 8110: <td class="paramkey"></td>
1.1 misho 8111: <td></td>
1.1.1.2 ! misho 8112: <td class="paramtype">int </td>
! 8113: <td class="paramname"><em>mode</em> </td>
1.1 misho 8114: </tr>
8115: <tr>
8116: <td></td>
1.1.1.2 ! misho 8117: <td>)</td>
! 8118: <td></td><td></td>
1.1 misho 8119: </tr>
8120: </table>
1.1.1.2 ! misho 8121: </div>
! 8122: <div class="memdoc">
! 8123: <p>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#ad36144707ce7994c12ef9d87dc9a2edf">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. </p>
! 8124: <dl><dt><b>Parameters:</b></dt><dd>
! 8125: <table class="params">
! 8126: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 8127: <tr><td class="paramname">ptag</td><td>the ptag reference number </td></tr>
! 8128: <tr><td class="paramname">mode</td><td>LIBNET_ON or LIBNET_OFF </td></tr>
! 8129: </table>
! 8130: </dd>
! 8131: </dl>
! 8132: <dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, -1 on failure </dd></dl>
! 8133:
! 8134: </div>
! 8135: </div>
! 8136: <a class="anchor" id="a5264b060183d307688780bf862fae37c"></a><!-- doxytag: member="libnet-functions.h::libnet_version" ref="a5264b060183d307688780bf862fae37c" args="(void)" -->
! 8137: <div class="memitem">
! 8138: <div class="memproto">
! 8139: <table class="memname">
! 8140: <tr>
! 8141: <td class="memname">const char* libnet_version </td>
! 8142: <td>(</td>
! 8143: <td class="paramtype">void </td>
! 8144: <td class="paramname"></td><td>)</td>
! 8145: <td></td>
1.1 misho 8146: </tr>
1.1.1.2 ! misho 8147: </table>
! 8148: </div>
! 8149: <div class="memdoc">
! 8150: <p>Returns the version of libnet. </p>
! 8151: <dl class="return"><dt><b>Returns:</b></dt><dd>the libnet version </dd></dl>
1.1 misho 8152:
1.1.1.2 ! misho 8153: </div>
! 8154: </div>
! 8155: <a class="anchor" id="a53375552efe95906e152152fc170cc0d"></a><!-- doxytag: member="libnet-functions.h::libnet_write" ref="a53375552efe95906e152152fc170cc0d" args="(libnet_t *l)" -->
! 8156: <div class="memitem">
! 8157: <div class="memproto">
! 8158: <table class="memname">
! 8159: <tr>
! 8160: <td class="memname">int libnet_write </td>
! 8161: <td>(</td>
! 8162: <td class="paramtype">libnet_t * </td>
! 8163: <td class="paramname"><em>l</em></td><td>)</td>
! 8164: <td></td>
! 8165: </tr>
1.1 misho 8166: </table>
1.1.1.2 ! misho 8167: </div>
! 8168: <div class="memdoc">
! 8169: <p>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#a0422723053baf0b254d1ba2215d88118">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#a886dc359d6add4b0608e8611af7e1b35">libnet_stats()</a>. </p>
! 8170: <dl><dt><b>Parameters:</b></dt><dd>
! 8171: <table class="params">
! 8172: <tr><td class="paramname">l</td><td>pointer to a libnet context </td></tr>
! 8173: </table>
! 8174: </dd>
! 8175: </dl>
! 8176: <dl class="return"><dt><b>Returns:</b></dt><dd>the number of bytes written, -1 on error </dd></dl>
! 8177:
! 8178: </div>
! 8179: </div>
! 8180: </div>
! 8181: <hr class="footer"/><address class="footer"><small>Generated on Thu Mar 29 2012 14:19:18 for libnet by 
1.1 misho 8182: <a href="http://www.doxygen.org/index.html">
1.1.1.2 ! misho 8183: <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
1.1 misho 8184: </body>
8185: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>