libnet-macros.h(3)
libnet-macros.h π
okay bestie, you found it: this is libnet-macros.h, living in the libnet manual, section 3 (library girlies only π
). it's the header where libnet parks all its macros and symbolic constants, and we are going through every single one of them. no skips. no "you get the idea". we do not do that here. π«Ά
πΈ NAME πΈ
libnet-macros.h β libnet macros and symbolic constants β¨
π SYNOPSIS π
Defines
here's the whole squad, exactly as they're written, character for character, no notes:
#define LIBNET_DONT_RESOLVE 0
#define LIBNET_RESOLVE 1
#define LIBNET_ON 0
#define LIBNET_OFF 1
#define IN6ADDR_ERROR_INIT
#define LIBNET_PR2 0
#define LIBNET_PR8 1
#define LIBNET_PR16 2
#define LIBNET_PRu16 3
#define LIBNET_PR32 4
#define LIBNET_PRu32 5
#define LIBNET_PRAND_MAX 0xffffffff
#define LIBNET_MAX_PACKET 0xffff
#define IP_MAXPACKET 0xffff
#define ETHER_ADDR_LEN 0x6
#define FDDI_ADDR_LEN 0x6
#define TOKEN_RING_ADDR_LEN 0x6
#define LIBNET_ORG_CODE_SIZE 0x3
#define LIBNET_ERRBUF_SIZE 0x100
#define LIBNET_MAXOPTION_SIZE 0x28
#define FIX(n) (n)
#define UNFIX(n) (n)
#define LIBNET_DO_PAYLOAD(l, p)
#define LIBNET_CKSUM_CARRY(x) (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff))
#define LIBNET_OSPF_AUTHCPY(x, y) memcpy((uint8_t *)x, (uint8_t *)y, sizeof(y))
#define LIBNET_OSPF_CKSUMBUF(x, y) memcpy((uint8_t *)x, (uint8_t *)y, sizeof(y))
#define LIBNET_NTP_DO_LI_VN_MODE(li, vn, md) ((uint8_t)((((li) << 6) & 0xc0) | (((vn) << 3) & 0x38) | ((md) & 0x7)))
#define LIBNET_ISLOOPBACK(p) (strcmp((p)->ifr_name, 'lo') == 0)
#define LIBNET_ISADVMODE(x) (x & 0x08)
#define LIBNET_LABEL_SIZE 64
#define LIBNET_LABEL_DEFAULT 'cardshark'
#define CQ_LOCK_UNLOCKED (u_int)0x00000000
#define CQ_LOCK_READ (u_int)0x00000001
#define CQ_LOCK_WRITE (u_int)0x00000002
#define for_each_context_in_cq(l) for (l = libnet_cq_head(); libnet_cq_last(); l = libnet_cq_next())
#define cq_is_wlocked() (l_cqd.cq_lock & CQ_LOCK_WRITE)
#define cq_is_rlocked() (l_cqd.cq_lock & CQ_LOCK_READ)
#define cq_is_locked() (l_cqd.cq_lock & (CQ_LOCK_READ | CQ_LOCK_WRITE))
#define check_cq_lock(x) (l_cqd.cq_lock & x)
that's 39 defines, bestie. we counted. π§
π¦ Detailed Description π¦
libnet macros and symbolic constants. that's it, that's the description. it's giving minimalist queen, and honestly? respect. π
π Define Documentation π
okay so Doxygen only wrote out prose for a handful of these babies β the rest just exist in the synopsis above, living their best mysterious life. here's everything that got actual documentation. π
#define for_each_context_in_cq(l) β for (l = libnet_cq_head(); libnet_cq_last(); l = libnet_cq_next())
Provides an interface to iterate through the context queue of libnet contexts. π
bestie, listen: before you call this macro, be sure to set the queue using libnet_cq_head(). do not skip that step. the vibes will not be immaculate if you skip that step. π
#define IN6ADDR_ERROR_INIT
Value:
{ { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } } }
IPv6 error code. π (it's sixteen 0xffs of pure, unadulterated no.)
#define LIBNET_DO_PAYLOAD(l, p)
Value:
if (payload_s && !payload)
{
snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
'%s(): payload inconsistency0, __func__);
goto bad;
}
if (payload_s)
{
n = libnet_pblock_append(l, p, payload, payload_s);
if (n == (uint32_t) - 1)
{
goto bad;
}
}
.fi
yes, that's really what's in there, including the .fi. we don't edit, we report. π
#define LIBNET_DONT_RESOLVE 0
Used for libnet's name resolution functions β specifies that no DNS lookups should be performed and the IP address should be kept in numeric form. keep it plain, keep it local, we love a low-maintenance address. π
#define LIBNET_ERRBUF_SIZE 0x100
The libnet error buffer is 256 bytes long. roomy enough for your feelings AND your error messages. π
#define LIBNET_MAX_PACKET 0xffff
The biggest an IP packet can be β 65,535 bytes. that's the ceiling, bestie, and no, you cannot raise it. β¨
#define LIBNET_MAXOPTION_SIZE 0x28
IP and TCP options can be up to 40 bytes long. small but mighty, main character energy fr. π
#define LIBNET_OFF 1
Used several places, to specify 'on' or 'one'. π yes, the manpage says 'one'. we are simply passing the message along, no cap.
#define LIBNET_ON 0
Used several places, to specify 'on' or 'one'. same energy, opposite number. iconic pairing honestly. π«Ά
#define LIBNET_PR2 0
Used for libnet_get_prand() to specify function disposition. π
#define LIBNET_RESOLVE 1
Used for libnet's name resolution functions β specifies that a DNS lookup can be performed if needed to resolve the IP address to a canonical form. go forth and resolve, bestie. π¦
π Author π
Generated automatically by Doxygen for libnet from the source code. not a human, just a robot doing its little robot thing and we love it for that. π€π
okay that's the whole page!! mwah π this was Version 1.1, dated Thu Mar 29 2012 β a genuine vintage classic, still slaying, still #define-ing. stay locked (CQ_LOCK_READ at minimum π), stay iconic, and go read your other manpages. periodt. π
πβ
π¦ where this page comes from
- debian bookworm: libnet1-dev 1.1.6+dfsg-3.2 Β· BSD-2
- ubuntu jammy: libnet1-dev 1.1.6+dfsg-3.1build3 Β· BSD-2
- ubuntu noble: libnet1-dev 1.1.6+dfsg-3.2build1 Β· BSD-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms