---
name: "libnet-macros"
section: "3"
platform: "linux"
package: "libnet"
version: "2:1.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libnet-macros"
---

# libnet-macros(3)

libnet macros and symbolic constants

## NAME

libnet-macros.h - libnet macros and symbolic constants

## SYNOPSIS

### Macros

\#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\_MAX\_PACKET**   0xffff\
 \#define **LIBNET\_ERRBUF\_SIZE**   0x100\
 \#define **LIBNET\_MAXOPTION\_SIZE**   0x28\
 \#define **for\_each\_context\_in\_cq**(l)\

## Detailed Description

libnet macros and symbolic constants

## Macro Definition Documentation

### #define for\_each\_context\_in\_cq( l)

**Value:**

```
for (l = libnet_cq_head(); libnet_cq_last(); l = libnet_cq_next())
```

Provides an interface to iterate through the context queue of libnet contexts. Before calling this macro, be sure to set the queue using **libnet\_cq\_head()**.

### #define IN6ADDR\_ERROR\_INIT

**Value:**

```
{ { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
0xff, 0xff } } }
```

IPv6 error code

### #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.

### #define LIBNET\_ERRBUF\_SIZE 0x100

The libnet error buffer is 256 bytes long.

### #define LIBNET\_MAX\_PACKET 0xffff

The biggest an IP packet can be -- 65,535 bytes.

### #define LIBNET\_MAXOPTION\_SIZE 0x28

IP and TCP options can be up to 40 bytes long.

### #define LIBNET\_OFF 1

Used several places, to specify "on" or "one"

### #define LIBNET\_ON 0

Used several places, to specify "on" or "one"

### #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.

## SEE ALSO

.IX Header "SEE ALSO" [libnet(3)](/libnet/3.md)

## AUTHORS

The original author of libnet is Mike D. Schiffman.

libnet has been maintained and extensively enhanced since 2009 by Sam Roberts.

It is maintained by the Libnet Developer Community at GitHub.

```
 <https://github.com/libnet/libnet>
```

## BUGS

Suggestions, bug reports/fixes, and pull requests, see:

```
 <https://github.com/libnet/libnet/issues>
```

## COPYRIGHT

libnet is licensed under the 2-Clause BSD License.

## SEE ALSO

.IX Header "SEE ALSO" [libnet(3)](/libnet/3.md)

## AUTHORS

The original author of libnet is Mike D. Schiffman.

libnet has been maintained and extensively enhanced since 2009 by Sam Roberts.

It is maintained by the Libnet Developer Community at GitHub.

```
 <https://github.com/libnet/libnet>
```

## BUGS

Suggestions, bug reports/fixes, and pull requests, see:

```
 <https://github.com/libnet/libnet/issues>
```

## COPYRIGHT

libnet is licensed under the 2-Clause BSD License.

## SEE ALSO

.IX Header "SEE ALSO" [libnet(3)](/libnet/3.md)

## AUTHORS

The original author of libnet is Mike D. Schiffman.

libnet has been maintained and extensively enhanced since 2009 by Sam Roberts.

It is maintained by the Libnet Developer Community at GitHub.

```
 <https://github.com/libnet/libnet>
```

## BUGS

Suggestions, bug reports/fixes, and pull requests, see:

```
 <https://github.com/libnet/libnet/issues>
```

## COPYRIGHT

libnet is licensed under the 2-Clause BSD License.
