+#ifdef BSD_KERNEL_PRIVATE
+
+#pragma pack(4)
+struct ip_fw_32{
+ u_int32_t version; /* Version of this structure. MUST be set */
+ /* by clients. Should always be */
+ /* set to IP_FW_CURRENT_API_VERSION. */
+ user32_addr_t context; /* Context that is usable by user processes to */
+ /* identify this rule. */
+ user32_addr_t next; /* linked list of rules */
+ user32_addr_t next_rule;/* ptr to next [skipto] rule */
+ /* 'next_rule' is used to pass up 'set_disable' status */
+
+ u_int16_t act_ofs; /* offset of action in 32-bit units */
+ u_int16_t cmd_len; /* # of 32-bit words in cmd */
+ u_int16_t rulenum; /* rule number */
+ u_int8_t set; /* rule set (0..31) */
+ u_int32_t set_masks[2]; /* masks for manipulating sets atomically */
+#define RESVD_SET 31 /* set for default and persistent rules */
+ u_int8_t _pad; /* padding */
+
+ /* These fields are present in all rules. */
+ u_int64_t pcnt; /* Packet counter */
+ u_int64_t bcnt; /* Byte counter */
+ u_int32_t timestamp; /* tv_sec of last match */
+
+ u_int32_t reserved_1; /* reserved - set to 0 */
+ u_int32_t reserved_2; /* reserved - set to 0 */
+
+ ipfw_insn cmd[1]; /* storage for commands */
+};
+
+#pragma pack()
+
+struct ip_fw_64{
+ u_int32_t version; /* Version of this structure. MUST be set */
+ /* by clients. Should always be */
+ /* set to IP_FW_CURRENT_API_VERSION. */
+ __uint64_t context __attribute__((aligned(8))); /* Context that is usable by user processes to */
+ /* identify this rule. */
+ user64_addr_t next; /* linked list of rules */
+ user64_addr_t next_rule; /* ptr to next [skipto] rule */
+ /* 'next_rule' is used to pass up 'set_disable' status */
+
+ u_int16_t act_ofs; /* offset of action in 32-bit units */
+ u_int16_t cmd_len; /* # of 32-bit words in cmd */
+ u_int16_t rulenum; /* rule number */
+ u_int8_t set; /* rule set (0..31) */
+ u_int32_t set_masks[2]; /* masks for manipulating sets atomically */
+#define RESVD_SET 31 /* set for default and persistent rules */
+ u_int8_t _pad; /* padding */
+
+ /* These fields are present in all rules. */
+ u_int64_t pcnt __attribute__((aligned(8))); /* Packet counter */
+ u_int64_t bcnt __attribute__((aligned(8))); /* Byte counter */
+ u_int32_t timestamp; /* tv_sec of last match */
+
+ u_int32_t reserved_1; /* reserved - set to 0 */
+ u_int32_t reserved_2; /* reserved - set to 0 */
+
+ ipfw_insn cmd[1]; /* storage for commands */
+};
+
+
+typedef struct _ipfw_dyn_rule_64 ipfw_dyn_rule_64;
+typedef struct _ipfw_dyn_rule_32 ipfw_dyn_rule_32;
+
+#pragma pack(4)
+struct _ipfw_dyn_rule_32 {
+ user32_addr_t next; /* linked list of rules. */
+ user32_addr_t rule; /* pointer to rule */
+ /* 'rule' is used to pass up the rule number (from the parent) */
+
+ user32_addr_t parent; /* pointer to parent rule */
+ u_int64_t pcnt; /* packet match counter */
+ u_int64_t bcnt; /* byte match counter */
+ struct ipfw_flow_id id; /* (masked) flow id */
+ u_int32_t expire; /* expire time */
+ u_int32_t bucket; /* which bucket in hash table */
+ u_int32_t state; /* state of this rule (typically a
+ * combination of TCP flags)
+ */
+ u_int32_t ack_fwd; /* most recent ACKs in forward */
+ u_int32_t ack_rev; /* and reverse directions (used */
+ /* to generate keepalives) */
+ u_int16_t dyn_type; /* rule type */
+ u_int16_t count; /* refcount */
+};
+
+#pragma pack()
+
+struct _ipfw_dyn_rule_64 {
+ user64_addr_t next; /* linked list of rules. */
+ user64_addr_t rule; /* pointer to rule */
+ /* 'rule' is used to pass up the rule number (from the parent) */
+
+ user64_addr_t parent; /* pointer to parent rule */
+ u_int64_t pcnt; /* packet match counter */
+ u_int64_t bcnt; /* byte match counter */
+ struct ipfw_flow_id id; /* (masked) flow id */
+ u_int32_t expire; /* expire time */
+ u_int32_t bucket; /* which bucket in hash table */
+ u_int32_t state; /* state of this rule (typically a
+ * combination of TCP flags)
+ */
+ u_int32_t ack_fwd; /* most recent ACKs in forward */
+ u_int32_t ack_rev; /* and reverse directions (used */
+ /* to generate keepalives) */
+ u_int16_t dyn_type; /* rule type */
+ u_int16_t count; /* refcount */
+};
+
+
+typedef struct _ipfw_insn_pipe_64 {
+ ipfw_insn o;
+ user64_addr_t pipe_ptr; /* XXX */
+} ipfw_insn_pipe_64;
+
+typedef struct _ipfw_insn_pipe_32{
+ ipfw_insn o;
+ user32_addr_t pipe_ptr; /* XXX */
+} ipfw_insn_pipe_32;
+
+
+#define IPFW_DEFAULT_RULE 65535
+