- compat layer extended through the full BSD API surface pf_ioctl/pf_lb/ pf_if/pf_norm/pf_table/pf_ruleset/radix/md5/sha2 need (all compile): cpumem/counters model, ifaddr/ifg groups, cred view, endian+in6 names, NAT46/64, SipHash24, mbuf_list, frag6 helpers, ip6 forward/checksum, tcp options/FSM names, taskqueue & sysctl shims (documented in docs/porting-notes.md) - pfsrc/divert_sock.c: real BSD divert(4) as runtime-registered PF_DIVERT=32 socket family inside the module (sock_register; NPROTO=AF_MAX=45 -> zero core patches); divert_packet/divert6_packet wired for pf.c - compat/pfk_ifq.c: OpenBSD 8.0 ifq framework with priq back end; hfsc and fq_codel aliases pending M5 (recorded in feature matrix as pending) - design + plan updated for the divert decision (user-requested) - stage-port.sh: single deterministic rename program for headers and .c
30 lines
893 B
C
30 lines
893 B
C
/* PFLINUX compat: <crypto/siphash.h> — SipHash-2-4 (Aumasson–Bernstein)
|
||
* API compatible with OpenBSD's SIPHASH_CTX/KEY usage in pf_syncookies.c.
|
||
* Implementation: compat/siphash.c (ISC 2026). */
|
||
#ifndef _PFK_SIPHASH_H
|
||
#define _PFK_SIPHASH_H
|
||
#include <linux/types.h>
|
||
|
||
#define SIPHASH_KEY_LENGTH 16
|
||
|
||
typedef struct {
|
||
__u64 v[2];
|
||
} SIPHASH_KEY;
|
||
|
||
typedef struct {
|
||
__u64 v[3];
|
||
__u64 total_len;
|
||
unsigned char block[8];
|
||
unsigned char block_len;
|
||
} SIPHASH_CTX;
|
||
|
||
void SipHash24_Init(SIPHASH_CTX *ctx, const SIPHASH_KEY *key);
|
||
void SipHash24_Update(SIPHASH_CTX *ctx, const void *in, __u64 inlen);
|
||
void SipHash24_Final(void *out, SIPHASH_CTX *ctx);
|
||
void SipHash24_Generate(const SIPHASH_KEY *key, const void *in, __u64 inlen,
|
||
unsigned char *out);
|
||
/* OpenBSD's one-shot helper: returns the 64-bit hash value */
|
||
__u64 SipHash24(const SIPHASH_KEY *key, const void *in, __u64 inlen);
|
||
|
||
#endif
|