Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


xt_osf.h
001: /*
002:  * Copyright (c) 2003+ Evgeniy Polyakov <johnpol@2ka.mxt.ru>
003:  *
004:  *
005:  * This program is free software; you can redistribute it and/or modify
006:  * it under the terms of the GNU General Public License as published by
007:  * the Free Software Foundation; either version 2 of the License, or
008:  * (at your option) any later version.
009:  *
010:  * This program is distributed in the hope that it will be useful,
011:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013:  * GNU General Public License for more details.
014:  *
015:  * You should have received a copy of the GNU General Public License
016:  * along with this program; if not, write to the Free Software
017:  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018:  */
019: 
020: #ifndef _XT_OSF_H
021: #define _XT_OSF_H
022: 
023: #include <linux/types.h>
024: 
025: #define MAXGENRELEN             32
026: 
027: #define XT_OSF_GENRE            (1<<0)
028: #define XT_OSF_TTL              (1<<1)
029: #define XT_OSF_LOG              (1<<2)
030: #define XT_OSF_INVERT           (1<<3)
031: 
032: #define XT_OSF_LOGLEVEL_ALL     0       /* log all matched fingerprints */
033: #define XT_OSF_LOGLEVEL_FIRST   1       /* log only the first matced fingerprint */
034: #define XT_OSF_LOGLEVEL_ALL_KNOWN       2 /* do not log unknown packets */
035: 
036: #define XT_OSF_TTL_TRUE         0       /* True ip and fingerprint TTL comparison */
037: #define XT_OSF_TTL_LESS         1       /* Check if ip TTL is less than fingerprint one */
038: #define XT_OSF_TTL_NOCHECK      2       /* Do not compare ip and fingerprint TTL at all */
039: 
040: struct xt_osf_info {
041:         char                    genre[MAXGENRELEN];
042:         __u32                   len;
043:         __u32                   flags;
044:         __u32                   loglevel;
045:         __u32                   ttl;
046: };
047: 
048: /*
049:  * Wildcard MSS (kind of).
050:  * It is used to implement a state machine for the different wildcard values
051:  * of the MSS and window sizes.
052:  */
053: struct xt_osf_wc {
054:         __u32                   wc;
055:         __u32                   val;
056: };
057: 
058: /*
059:  * This struct represents IANA options
060:  * http://www.iana.org/assignments/tcp-parameters
061:  */
062: struct xt_osf_opt {
063:         __u16                   kind, length;
064:         struct xt_osf_wc        wc;
065: };
066: 
067: struct xt_osf_user_finger {
068:         struct xt_osf_wc        wss;
069: 
070:         __u8                    ttl, df;
071:         __u16                   ss, mss;
072:         __u16                   opt_num;
073: 
074:         char                    genre[MAXGENRELEN];
075:         char                    version[MAXGENRELEN];
076:         char                    subtype[MAXGENRELEN];
077: 
078:         /* MAX_IPOPTLEN is maximum if all options are NOPs or EOLs */
079:         struct xt_osf_opt       opt[MAX_IPOPTLEN];
080: };
081: 
082: struct xt_osf_nlmsg {
083:         struct xt_osf_user_finger       f;
084:         struct iphdr            ip;
085:         struct tcphdr           tcp;
086: };
087: 
088: /* Defines for IANA option kinds */
089: 
090: enum iana_options {
091:         OSFOPT_EOL = 0,         /* End of options */
092:         OSFOPT_NOP,             /* NOP */
093:         OSFOPT_MSS,             /* Maximum segment size */
094:         OSFOPT_WSO,             /* Window scale option */
095:         OSFOPT_SACKP,           /* SACK permitted */
096:         OSFOPT_SACK,            /* SACK */
097:         OSFOPT_ECHO,
098:         OSFOPT_ECHOREPLY,
099:         OSFOPT_TS,              /* Timestamp option */
100:         OSFOPT_POCP,            /* Partial Order Connection Permitted */
101:         OSFOPT_POSP,            /* Partial Order Service Profile */
102: 
103:         /* Others are not used in the current OSF */
104:         OSFOPT_EMPTY = 255,
105: };
106: 
107: /*
108:  * Initial window size option state machine: multiple of mss, mtu or
109:  * plain numeric value. Can also be made as plain numeric value which
110:  * is not a multiple of specified value.
111:  */
112: enum xt_osf_window_size_options {
113:         OSF_WSS_PLAIN   = 0,
114:         OSF_WSS_MSS,
115:         OSF_WSS_MTU,
116:         OSF_WSS_MODULO,
117:         OSF_WSS_MAX,
118: };
119: 
120: /*
121:  * Add/remove fingerprint from the kernel.
122:  */
123: enum xt_osf_msg_types {
124:         OSF_MSG_ADD,
125:         OSF_MSG_REMOVE,
126:         OSF_MSG_MAX,
127: };
128: 
129: enum xt_osf_attr_type {
130:         OSF_ATTR_UNSPEC,
131:         OSF_ATTR_FINGER,
132:         OSF_ATTR_MAX,
133: };
134: 
135: #endif                          /* _XT_OSF_H */
136: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/