Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_pfsync.h
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _NET_IF_PFSYNC_H_ | #ifndef _NET_IF_PFSYNC_H_ | ||||
#define _NET_IF_PFSYNC_H_ | #define _NET_IF_PFSYNC_H_ | ||||
#define PFSYNC_VERSION 5 | #define PFSYNC_VERSION 5 | ||||
#define PFSYNC_REVISION 1 | |||||
#define PFSYNC_DFLTTL 255 | #define PFSYNC_DFLTTL 255 | ||||
#define PFSYNC_ACT_CLR 0 /* clear all states */ | #define PFSYNC_ACT_CLR 0 /* clear all states */ | ||||
#define PFSYNC_ACT_INS 1 /* insert state */ | #define PFSYNC_ACT_INS 1 /* insert state */ | ||||
#define PFSYNC_ACT_INS_ACK 2 /* ack of insterted state */ | #define PFSYNC_ACT_INS_ACK 2 /* ack of insterted state */ | ||||
#define PFSYNC_ACT_UPD 3 /* update state */ | #define PFSYNC_ACT_UPD 3 /* update state */ | ||||
#define PFSYNC_ACT_UPD_C 4 /* "compressed" update state */ | #define PFSYNC_ACT_UPD_C 4 /* "compressed" update state */ | ||||
#define PFSYNC_ACT_UPD_REQ 5 /* request "uncompressed" state */ | #define PFSYNC_ACT_UPD_REQ 5 /* request "uncompressed" state */ | ||||
Show All 33 Lines | |||||
*/ | */ | ||||
/* | /* | ||||
* Frame header | * Frame header | ||||
*/ | */ | ||||
struct pfsync_header { | struct pfsync_header { | ||||
u_int8_t version; | u_int8_t version; | ||||
u_int8_t _pad; | u_int8_t revision; | ||||
u_int16_t len; | u_int16_t len; | ||||
u_int8_t pfcksum[PF_MD5_DIGEST_LENGTH]; | u_int8_t pfcksum[PF_MD5_DIGEST_LENGTH]; | ||||
} __packed; | } __packed; | ||||
/* | /* | ||||
* Frame region subheader | * Frame region subheader | ||||
*/ | */ | ||||
struct pfsync_subheader { | struct pfsync_subheader { | ||||
u_int8_t action; | u_int8_t action; | ||||
u_int8_t _pad; | u_int8_t size; /* Structure size in 16-bits. */ | ||||
u_int16_t count; | u_int16_t count; /* Number of structures. */ | ||||
jhb: Hmm, I find "word" a bit ambiguous as I don't always associate it with uint16_t. Instead, I… | |||||
} __packed; | } __packed; | ||||
/* | /* | ||||
* CLR | * CLR | ||||
*/ | */ | ||||
struct pfsync_clr { | struct pfsync_clr { | ||||
char ifname[IFNAMSIZ]; | char ifname[IFNAMSIZ]; | ||||
▲ Show 20 Lines • Show All 143 Lines • Show Last 20 Lines |
Hmm, I find "word" a bit ambiguous as I don't always associate it with uint16_t. Instead, I think of it as the "natural" integer size of a processor (basically the size of a GP register). Even though Intel refers to 32-bits as DWORDS for legacy 16-bit compat reasons, I think of the word size on i386 to be 32-bits and on amd64 as 64-bits, etc. I would just suggest making this comment more explicit, e.g. "Size of structure in 16-bit units."