Move /var/svc/log to /var/log/svc
[unleashed/lotheac.git] / usr / src / cmd / ipf / lib / common / tcpflags.c
blobd4d6145c2707a70ec51a2a3be2394d786b78eca2
1 /*
2 * Copyright (C) 1993-2001 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * $Id: tcpflags.c,v 1.3 2002/11/02 07:18:01 darrenr Exp $
7 */
9 #include "ipf.h"
13 * ECN is a new addition to TCP - RFC 2481
15 #ifndef TH_ECN
16 # define TH_ECN 0x40
17 #endif
18 #ifndef TH_CWR
19 # define TH_CWR 0x80
20 #endif
22 extern char flagset[];
23 extern u_char flags[];
26 u_char tcpflags(flgs)
27 char *flgs;
29 u_char tcpf = 0;
30 char *s, *t;
32 for (s = flgs; *s; s++) {
33 if (*s == 'W')
34 tcpf |= TH_CWR;
35 else {
36 if (!(t = strchr(flagset, *s))) {
37 return 0;
39 tcpf |= flags[t - flagset];
42 return tcpf;