| @@ -1,39 +1,39 @@ | | | @@ -1,39 +1,39 @@ |
1 | /* $NetBSD: pf-linux2.c,v 1.1 2016/06/08 01:11:49 christos Exp $ */ | | 1 | /* $NetBSD: pf-linux2.c,v 1.2 2020/10/27 17:07:14 abs Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * General Purpose AppleTalk Packet Filter Interface | | 4 | * General Purpose AppleTalk Packet Filter Interface |
5 | * | | 5 | * |
6 | * Copyright (c) 1992-1995, The University of Melbourne. | | 6 | * Copyright (c) 1992-1995, The University of Melbourne. |
7 | * All Rights Reserved. Permission to redistribute or | | 7 | * All Rights Reserved. Permission to redistribute or |
8 | * use any part of this software for any purpose must | | 8 | * use any part of this software for any purpose must |
9 | * be obtained in writing from the copyright owner. | | 9 | * be obtained in writing from the copyright owner. |
10 | * | | 10 | * |
11 | * This software is supplied "as is" without express | | 11 | * This software is supplied "as is" without express |
12 | * or implied warranty. | | 12 | * or implied warranty. |
13 | * | | 13 | * |
14 | * djh@munnari.OZ.AU | | 14 | * djh@munnari.OZ.AU |
15 | * | | 15 | * |
16 | * Supports: | | 16 | * Supports: |
17 | * Linux SOCK_PACKET | | 17 | * Linux SOCK_PACKET |
18 | * | | 18 | * |
19 | * | | 19 | * |
20 | * Modified for use with the linux-mopd port by Karl Maftoum | | 20 | * Modified for use with the linux-mopd port by Karl Maftoum |
21 | * u963870@student.canberra.edu.au | | 21 | * u963870@student.canberra.edu.au |
22 | * | | 22 | * |
23 | */ | | 23 | */ |
24 | | | 24 | |
25 | #include "port.h" | | 25 | #include "port.h" |
26 | __RCSID("$NetBSD: pf-linux2.c,v 1.1 2016/06/08 01:11:49 christos Exp $"); | | 26 | __RCSID("$NetBSD: pf-linux2.c,v 1.2 2020/10/27 17:07:14 abs Exp $"); |
27 | | | 27 | |
28 | /* | | 28 | /* |
29 | * include header files | | 29 | * include header files |
30 | * | | 30 | * |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <stdio.h> | | 33 | #include <stdio.h> |
34 | #include <fcntl.h> | | 34 | #include <fcntl.h> |
35 | #include <unistd.h> | | 35 | #include <unistd.h> |
36 | #include <sys/types.h> | | 36 | #include <sys/types.h> |
37 | #include <sys/time.h> | | 37 | #include <sys/time.h> |
38 | #include <sys/ioctl.h> | | 38 | #include <sys/ioctl.h> |
39 | #include <sys/file.h> | | 39 | #include <sys/file.h> |
| @@ -76,27 +76,27 @@ extern int errno; | | | @@ -76,27 +76,27 @@ extern int errno; |
76 | extern int promisc; | | 76 | extern int promisc; |
77 | | | 77 | |
78 | struct RDS RDS[NUMRDS]; | | 78 | struct RDS RDS[NUMRDS]; |
79 | static int setup_pf(int, int, u_short); | | 79 | static int setup_pf(int, int, u_short); |
80 | | | 80 | |
81 | /* | | 81 | /* |
82 | * Open and initialize packet filter | | 82 | * Open and initialize packet filter |
83 | * for a particular protocol type. | | 83 | * for a particular protocol type. |
84 | * | | 84 | * |
85 | */ | | 85 | */ |
86 | | | 86 | |
87 | | | 87 | |
88 | int | | 88 | int |
89 | pfInit(char *interface, u_short protocol, int typ, int mode) | | 89 | pfInit(char *interface, int mode, u_short protocol, int typ) |
90 | { | | 90 | { |
91 | int s; | | 91 | int s; |
92 | int ioarg; | | 92 | int ioarg; |
93 | char device[64]; | | 93 | char device[64]; |
94 | unsigned long if_flags; | | 94 | unsigned long if_flags; |
95 | | | 95 | |
96 | | | 96 | |
97 | { u_short prot; | | 97 | { u_short prot; |
98 | | | 98 | |
99 | prot = ((typ == TRANS_8023) ? htons(ETH_P_802_2) : htons(protocol)); | | 99 | prot = ((typ == TRANS_8023) ? htons(ETH_P_802_2) : htons(protocol)); |
100 | if ((s = socket(AF_INET, SOCK_PACKET, prot)) < 0) { | | 100 | if ((s = socket(AF_INET, SOCK_PACKET, prot)) < 0) { |
101 | perror(interface); | | 101 | perror(interface); |
102 | return(-1); | | 102 | return(-1); |