if_pfsync.h (cdc231bd49498481801686913872c361dbc01f95) if_pfsync.h (4bf98559d9d6fa7c3571d26ed6f2b18823e3a30b)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2001 Michael Shalayeff
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 45 unchanged lines hidden (view full) ---

54
55#include <net/if.h>
56#include <net/pfvar.h>
57#include <netpfil/pf/pf.h>
58
59#define PFSYNC_VERSION 5
60#define PFSYNC_DFLTTL 255
61
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2001 Michael Shalayeff
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 45 unchanged lines hidden (view full) ---

54
55#include <net/if.h>
56#include <net/pfvar.h>
57#include <netpfil/pf/pf.h>
58
59#define PFSYNC_VERSION 5
60#define PFSYNC_DFLTTL 255
61
62enum pfsync_msg_versions {
63 PFSYNC_MSG_VERSION_UNSPECIFIED = 0,
64 PFSYNC_MSG_VERSION_1301 = 1301,
65 PFSYNC_MSG_VERSION_1400 = 1400,
66};
67
68#define PFSYNC_MSG_VERSION_DEFAULT PFSYNC_MSG_VERSION_1400
69
62#define PFSYNC_ACT_CLR 0 /* clear all states */
70#define PFSYNC_ACT_CLR 0 /* clear all states */
63#define PFSYNC_ACT_INS 1 /* insert state */
71#define PFSYNC_ACT_INS_1301 1 /* insert state */
64#define PFSYNC_ACT_INS_ACK 2 /* ack of inserted state */
72#define PFSYNC_ACT_INS_ACK 2 /* ack of inserted state */
65#define PFSYNC_ACT_UPD 3 /* update state */
73#define PFSYNC_ACT_UPD_1301 3 /* update state */
66#define PFSYNC_ACT_UPD_C 4 /* "compressed" update state */
67#define PFSYNC_ACT_UPD_REQ 5 /* request "uncompressed" state */
68#define PFSYNC_ACT_DEL 6 /* delete state */
69#define PFSYNC_ACT_DEL_C 7 /* "compressed" delete state */
70#define PFSYNC_ACT_INS_F 8 /* insert fragment */
71#define PFSYNC_ACT_DEL_F 9 /* delete fragments */
72#define PFSYNC_ACT_BUS 10 /* bulk update status */
73#define PFSYNC_ACT_TDB 11 /* TDB replay counter update */
74#define PFSYNC_ACT_EOF 12 /* end of frame */
74#define PFSYNC_ACT_UPD_C 4 /* "compressed" update state */
75#define PFSYNC_ACT_UPD_REQ 5 /* request "uncompressed" state */
76#define PFSYNC_ACT_DEL 6 /* delete state */
77#define PFSYNC_ACT_DEL_C 7 /* "compressed" delete state */
78#define PFSYNC_ACT_INS_F 8 /* insert fragment */
79#define PFSYNC_ACT_DEL_F 9 /* delete fragments */
80#define PFSYNC_ACT_BUS 10 /* bulk update status */
81#define PFSYNC_ACT_TDB 11 /* TDB replay counter update */
82#define PFSYNC_ACT_EOF 12 /* end of frame */
75#define PFSYNC_ACT_MAX 13
83#define PFSYNC_ACT_INS_1400 13 /* insert state */
84#define PFSYNC_ACT_UPD_1400 14 /* update state */
85#define PFSYNC_ACT_MAX 15
76
77/*
78 * A pfsync frame is built from a header followed by several sections which
79 * are all prefixed with their own subheaders. Frames must be terminated with
80 * an EOF subheader.
81 *
82 * | ... |
83 * | IP header |

--- 162 unchanged lines hidden (view full) ---

246#define PFSYNCF_DEFER 0x00000002
247 int pfsyncr_defer;
248};
249
250struct pfsync_kstatus {
251 char syncdev[IFNAMSIZ];
252 struct sockaddr_storage syncpeer;
253 int maxupdates;
86
87/*
88 * A pfsync frame is built from a header followed by several sections which
89 * are all prefixed with their own subheaders. Frames must be terminated with
90 * an EOF subheader.
91 *
92 * | ... |
93 * | IP header |

--- 162 unchanged lines hidden (view full) ---

256#define PFSYNCF_DEFER 0x00000002
257 int pfsyncr_defer;
258};
259
260struct pfsync_kstatus {
261 char syncdev[IFNAMSIZ];
262 struct sockaddr_storage syncpeer;
263 int maxupdates;
264 int version;
254 int flags;
255};
256
257struct pfsyncioc_nv {
258 void *data;
259 size_t len; /* The length of the nvlist data. */
260 size_t size; /* The total size of the data buffer. */
261};
262
263#define SIOCSETPFSYNC _IOW('i', 247, struct ifreq)
264#define SIOCGETPFSYNC _IOWR('i', 248, struct ifreq)
265#define SIOCSETPFSYNCNV _IOW('i', 249, struct ifreq)
266#define SIOCGETPFSYNCNV _IOWR('i', 250, struct ifreq)
267
268#ifdef _KERNEL
269
270/*
271 * this shows where a pf state is with respect to the syncing.
265 int flags;
266};
267
268struct pfsyncioc_nv {
269 void *data;
270 size_t len; /* The length of the nvlist data. */
271 size_t size; /* The total size of the data buffer. */
272};
273
274#define SIOCSETPFSYNC _IOW('i', 247, struct ifreq)
275#define SIOCGETPFSYNC _IOWR('i', 248, struct ifreq)
276#define SIOCSETPFSYNCNV _IOW('i', 249, struct ifreq)
277#define SIOCGETPFSYNCNV _IOWR('i', 250, struct ifreq)
278
279#ifdef _KERNEL
280
281/*
282 * this shows where a pf state is with respect to the syncing.
283 * pf_kstate->sync_state
272 */
273#define PFSYNC_S_INS 0x00
274#define PFSYNC_S_IACK 0x01
275#define PFSYNC_S_UPD 0x02
276#define PFSYNC_S_UPD_C 0x03
277#define PFSYNC_S_DEL_C 0x04
284 */
285#define PFSYNC_S_INS 0x00
286#define PFSYNC_S_IACK 0x01
287#define PFSYNC_S_UPD 0x02
288#define PFSYNC_S_UPD_C 0x03
289#define PFSYNC_S_DEL_C 0x04
278#define PFSYNC_S_COUNT 0x05
279
280#define PFSYNC_S_DEFER 0xfe
281#define PFSYNC_S_NONE 0xff
282
283#define PFSYNC_SI_IOCTL 0x01
284#define PFSYNC_SI_CKSUM 0x02
285#define PFSYNC_SI_ACK 0x04
286
287#endif /* _KERNEL */
288
289#endif /* _NET_IF_PFSYNC_H_ */
290
291#define PFSYNC_S_DEFER 0xfe
292#define PFSYNC_S_NONE 0xff
293
294#define PFSYNC_SI_IOCTL 0x01
295#define PFSYNC_SI_CKSUM 0x02
296#define PFSYNC_SI_ACK 0x04
297
298#endif /* _KERNEL */
299
300#endif /* _NET_IF_PFSYNC_H_ */