`libpcapnav` Manual
Prev |  | Next

# pcapnav_macros

## Name

pcapnav_macros --

## Synopsis

    #define     MAX                             (a, b)
    #define     MIN                             (a, b)
    #define     NEW                             (X)
    #define     FREE                            (X)
    #define     MAXPATHLEN
    #define     SWAPLONG                        (y)
    #define     SWAPSHORT                       (y)
    #define     TCPDUMP_MAGIC
    #define     PATCHED_TCPDUMP_MAGIC
    #define     PCAP_VERSION_MAJOR
    #define     PCAP_VERSION_MINOR
    #define     MAX_REASONABLE_FILE_SPAN
    #define     MAX_REASONABLE_PACKET_LENGTH
    #define     MAX_PACKET_SIZE                 (pn)
    #define     MAX_BYTES_FOR_DEFINITE_HEADER   (pn)
    #define     MAX_REASONABLE_HDR_SEPARATION
    #define     STRAIGHT_SCAN_THRESHOLD         (pn)
    #define     MAX_CHAIN_LENGTH

## Description

## Details

### MAX()

    #define MAX(a, b)  (((a) > (b)) ? (a) : (b))

`a` :

`b` :

### MIN()

    #define MIN(a, b)  (((a) < (b)) ? (a) : (b))

`a` :

`b` :

### NEW()

    #define NEW(X)    ((X*) calloc(1, sizeof(X)))

`X` :

### FREE()

    #define FREE(X)   { if (X) { free(X); X = NULL; } }

`X` :

### MAXPATHLEN

    #define MAXPATHLEN 4096

### SWAPLONG()

    #define     SWAPLONG(y)

`y` :

### SWAPSHORT()

    #define     SWAPSHORT(y)

`y` :

### TCPDUMP_MAGIC

    #define TCPDUMP_MAGIC 0xa1b2c3d4

### PATCHED_TCPDUMP_MAGIC

    #define PATCHED_TCPDUMP_MAGIC 0xa1b2cd34

### PCAP_VERSION_MAJOR

    #define PCAP_VERSION_MAJOR 2

### PCAP_VERSION_MINOR

    #define PCAP_VERSION_MINOR 4

### MAX_REASONABLE_FILE_SPAN

    #define MAX_REASONABLE_FILE_SPAN (3600*24*366)	/* one year */

### MAX_REASONABLE_PACKET_LENGTH

    #define MAX_REASONABLE_PACKET_LENGTH 65535

### MAX_PACKET_SIZE()

    #define MAX_PACKET_SIZE(pn) (pn->trace.pkthdr_size + pn->trace.filehdr.snaplen)

`pn` :

### MAX_BYTES_FOR_DEFINITE_HEADER()

    #define MAX_BYTES_FOR_DEFINITE_HEADER(pn) (3 * MAX_PACKET_SIZE(pn))

`pn` :

### MAX_REASONABLE_HDR_SEPARATION

    #define MAX_REASONABLE_HDR_SEPARATION (3600 * 24 * 7)	/* one week */

### STRAIGHT_SCAN_THRESHOLD()

    #define STRAIGHT_SCAN_THRESHOLD(pn) (100 * MAX_PACKET_SIZE(pn))

`pn` :

### MAX_CHAIN_LENGTH

    #define MAX_CHAIN_LENGTH 20

Prev | Home | Next
pcapnav_debug | Up | Appendix