pfil.c (92725) | pfil.c (109623) |
---|---|
1/* $FreeBSD: head/sys/net/pfil.c 92725 2002-03-19 21:54:18Z alfred $ */ | 1/* $FreeBSD: head/sys/net/pfil.c 109623 2003-01-21 08:56:16Z alfred $ */ |
2 3/* 4 * Copyright (c) 1996 Matthew R. Green 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 9 * are met: --- 46 unchanged lines hidden (view full) --- 56} 57 58/* 59 * pfil_add_hook() adds a function to the packet filter hook. the 60 * flags are: 61 * PFIL_IN call me on incoming packets 62 * PFIL_OUT call me on outgoing packets 63 * PFIL_ALL call me on all of the above | 2 3/* 4 * Copyright (c) 1996 Matthew R. Green 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 9 * are met: --- 46 unchanged lines hidden (view full) --- 56} 57 58/* 59 * pfil_add_hook() adds a function to the packet filter hook. the 60 * flags are: 61 * PFIL_IN call me on incoming packets 62 * PFIL_OUT call me on outgoing packets 63 * PFIL_ALL call me on all of the above |
64 * PFIL_WAITOK OK to call malloc with M_WAITOK. | 64 * PFIL_WAITOK OK to call malloc with 0. |
65 */ 66int 67pfil_add_hook(func, flags, ph) 68 int (*func)(void *, int, struct ifnet *, int, struct mbuf **); 69 int flags; 70 struct pfil_head *ph; 71{ 72 int err = 0; --- 19 unchanged lines hidden (view full) --- 92pfil_list_add(list, func, flags) 93 pfil_list_t *list; 94 int (*func)(void *, int, struct ifnet *, int, struct mbuf **); 95 int flags; 96{ 97 struct packet_filter_hook *pfh; 98 99 pfh = (struct packet_filter_hook *)malloc(sizeof(*pfh), M_IFADDR, | 65 */ 66int 67pfil_add_hook(func, flags, ph) 68 int (*func)(void *, int, struct ifnet *, int, struct mbuf **); 69 int flags; 70 struct pfil_head *ph; 71{ 72 int err = 0; --- 19 unchanged lines hidden (view full) --- 92pfil_list_add(list, func, flags) 93 pfil_list_t *list; 94 int (*func)(void *, int, struct ifnet *, int, struct mbuf **); 95 int flags; 96{ 97 struct packet_filter_hook *pfh; 98 99 pfh = (struct packet_filter_hook *)malloc(sizeof(*pfh), M_IFADDR, |
100 flags & PFIL_WAITOK ? M_WAITOK : M_NOWAIT); | 100 flags & PFIL_WAITOK ? 0 : M_NOWAIT); |
101 if (pfh == NULL) 102 return ENOMEM; 103 pfh->pfil_func = func; 104 /* 105 * insert the input list in reverse order of the output list 106 * so that the same path is followed in or out of the kernel. 107 */ 108 --- 63 unchanged lines hidden --- | 101 if (pfh == NULL) 102 return ENOMEM; 103 pfh->pfil_func = func; 104 /* 105 * insert the input list in reverse order of the output list 106 * so that the same path is followed in or out of the kernel. 107 */ 108 --- 63 unchanged lines hidden --- |