Deleted Added
full compact
pfil.h (316458) pfil.h (317042)
1/* $FreeBSD: stable/11/sys/net/pfil.h 316458 2017-04-03 13:04:36Z ae $ */
1/* $FreeBSD: stable/11/sys/net/pfil.h 317042 2017-04-17 09:34:09Z ae $ */
2/* $NetBSD: pfil.h,v 1.22 2003/06/23 12:57:08 martin Exp $ */
3
4/*-
5 * Copyright (c) 1996 Matthew R. Green
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

33#define _NET_PFIL_H_
34
35#include <sys/systm.h>
36#include <sys/queue.h>
37#include <sys/_lock.h>
38#include <sys/_mutex.h>
39#include <sys/lock.h>
40#include <sys/rmlock.h>
2/* $NetBSD: pfil.h,v 1.22 2003/06/23 12:57:08 martin Exp $ */
3
4/*-
5 * Copyright (c) 1996 Matthew R. Green
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

33#define _NET_PFIL_H_
34
35#include <sys/systm.h>
36#include <sys/queue.h>
37#include <sys/_lock.h>
38#include <sys/_mutex.h>
39#include <sys/lock.h>
40#include <sys/rmlock.h>
41#include <net/vnet.h>
41
42struct mbuf;
43struct ifnet;
44struct inpcb;
45
46typedef int (*pfil_func_t)(void *, struct mbuf **, struct ifnet *, int,
47 struct inpcb *);
48

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

89 u_long phu_val;
90 void *phu_ptr;
91 } ph_un;
92#define ph_af ph_un.phu_val
93#define ph_ifnet ph_un.phu_ptr
94 LIST_ENTRY(pfil_head) ph_list;
95};
96
42
43struct mbuf;
44struct ifnet;
45struct inpcb;
46
47typedef int (*pfil_func_t)(void *, struct mbuf **, struct ifnet *, int,
48 struct inpcb *);
49

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

90 u_long phu_val;
91 void *phu_ptr;
92 } ph_un;
93#define ph_af ph_un.phu_val
94#define ph_ifnet ph_un.phu_ptr
95 LIST_ENTRY(pfil_head) ph_list;
96};
97
98VNET_DECLARE(struct rmlock, pfil_lock);
99#define V_pfil_lock VNET(pfil_lock)
100
97/* Public functions for pfil hook management by packet filters. */
98struct pfil_head *pfil_head_get(int, u_long);
99int pfil_add_hook(pfil_func_t, void *, int, struct pfil_head *);
100int pfil_remove_hook(pfil_func_t, void *, int, struct pfil_head *);
101#define PFIL_HOOKED(p) ((p)->ph_nhooks > 0)
102
103/* Public functions to run the packet inspection by protocols. */
104int pfil_run_hooks(struct pfil_head *, struct mbuf **, struct ifnet *,

--- 15 unchanged lines hidden ---
101/* Public functions for pfil hook management by packet filters. */
102struct pfil_head *pfil_head_get(int, u_long);
103int pfil_add_hook(pfil_func_t, void *, int, struct pfil_head *);
104int pfil_remove_hook(pfil_func_t, void *, int, struct pfil_head *);
105#define PFIL_HOOKED(p) ((p)->ph_nhooks > 0)
106
107/* Public functions to run the packet inspection by protocols. */
108int pfil_run_hooks(struct pfil_head *, struct mbuf **, struct ifnet *,

--- 15 unchanged lines hidden ---