Deleted Added
full compact
filter.c (10858) filter.c (13379)
1/*
2 * PPP Filter command Interface
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
1/*
2 * PPP Filter command Interface
3 *
4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp)
5 *
6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
7 *
8 * Redistribution and use in source and binary forms are permitted
9 * provided that the above copyright notice and this paragraph are
10 * duplicated in all such forms and that any documentation,
11 * advertising materials, and other materials related to such
12 * distribution and use acknowledge that the software was developed
13 * by the Internet Initiative Japan. The name of the
14 * IIJ may not be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 * $Id: filter.c,v 1.4 1995/05/30 03:50:31 rgrimes Exp $
20 * $Id: filter.c,v 1.5 1995/09/17 16:14:45 amurai Exp $
21 *
22 * TODO: Shoud send ICMP error message when we discard packets.
23 */
24
25#include <sys/types.h>
26#include <sys/socket.h>
27#include <sys/param.h>
28#include <netinet/in.h>

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

195 * UDP Syntax: [src op port] [dst op port]
196 */
197static int
198ParseUdpOrTcp(argc, argv, proto)
199int argc;
200char **argv;
201int proto;
202{
21 *
22 * TODO: Shoud send ICMP error message when we discard packets.
23 */
24
25#include <sys/types.h>
26#include <sys/socket.h>
27#include <sys/param.h>
28#include <netinet/in.h>

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

195 * UDP Syntax: [src op port] [dst op port]
196 */
197static int
198ParseUdpOrTcp(argc, argv, proto)
199int argc;
200char **argv;
201int proto;
202{
203 int port;
204 char *cp;
205
206 if (argc == 0) {
207 /* permit/deny all tcp traffic */
208 filterdata.opt.srcop = filterdata.opt.dstop = A_NONE;
209 return(1);
210 }
211 if (argc < 3) {
212#ifdef notdef

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

244 if (STREQ(*argv, "estab")) {
245 filterdata.opt.estab = 1;
246 return(1);
247 }
248 printf("estab is expected: %s\n", *argv);
249 return(0);
250 }
251 if (argc > 0)
203
204 if (argc == 0) {
205 /* permit/deny all tcp traffic */
206 filterdata.opt.srcop = filterdata.opt.dstop = A_NONE;
207 return(1);
208 }
209 if (argc < 3) {
210#ifdef notdef

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

242 if (STREQ(*argv, "estab")) {
243 filterdata.opt.estab = 1;
244 return(1);
245 }
246 printf("estab is expected: %s\n", *argv);
247 return(0);
248 }
249 if (argc > 0)
252 printf("bad %s src/dst port syntax: %s\n", *argv);
250 printf("bad src/dst port syntax: %s\n", *argv);
253 return(0);
254}
255
256char *opname[] = { "none", "eq", "gt", "lt" };
257
258static int
259Parse(argc, argv, ofp)
260int argc;

--- 238 unchanged lines hidden ---
251 return(0);
252}
253
254char *opname[] = { "none", "eq", "gt", "lt" };
255
256static int
257Parse(argc, argv, ofp)
258int argc;

--- 238 unchanged lines hidden ---