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.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{ |
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) |
250 printf("bad src/dst port syntax: %s\n", *argv); |
251 return(0); 252} 253 254char *opname[] = { "none", "eq", "gt", "lt" }; 255 256static int 257Parse(argc, argv, ofp) 258int argc; --- 238 unchanged lines hidden --- |