"Fossies" - the Fresh Open Source Software Archive

Member "argus-3.0.8.2/include/argus/cons_out.h" (14 Apr 2015, 4368 Bytes) of package /linux/misc/argus-3.0.8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "cons_out.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3.0.8_vs_3.0.8.1.

    1 /*
    2  * Argus Software.  Common include files. cons_out.h
    3  * Copyright (c) 2000-2015 QoSient, LLC
    4  * All rights reserved.
    5  *
    6  * This program is free software; you can redistribute it and/or modify
    7  * it under the terms of the GNU General Public License as published by
    8  * the Free Software Foundation; either version 2, or (at your option)
    9  * any later version.
   10  
   11  * This program is distributed in the hope that it will be useful,
   12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14  * GNU General Public License for more details.
   15 
   16  * You should have received a copy of the GNU General Public License
   17  * along with this program; if not, write to the Free Software
   18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   19  *
   20  */
   21 
   22 /* 
   23  * $Id: //depot/argus/argus/include/argus/cons_out.h#7 $
   24  * $DateTime: 2015/04/06 10:38:44 $
   25  * $Change: 2973 $
   26  */
   27 
   28 
   29 #if !defined(cons_out_h)
   30 #define cons_out_h
   31 
   32 #if !defined(__OpenBSD__) || !defined(_NET_IF_H_)
   33 #define _NET_IF_H_
   34 #include <net/if.h>
   35 #endif
   36 
   37 #include <netinet/in.h>
   38 
   39 #if !defined(__OpenBSD__) || !defined(_NETINET_IF_ETHER_H_)
   40 #define _NETINET_IP_ETHER_H_
   41 #include <netinet/if_ether.h>
   42 #endif
   43 
   44 struct THA_OBJECT {
   45    arg_int32 size;
   46    unsigned char *buffer;
   47 };
   48 
   49 struct tha {
   50    struct in_addr src;
   51    struct in_addr dst;
   52    arg_uint16 sport;
   53    arg_uint16 dport;
   54 };
   55 
   56 struct icmptha {
   57    struct in_addr src;
   58    struct in_addr dst;
   59    arg_uint32 port;
   60    arg_uint32 addr;
   61 };
   62 
   63 
   64 struct writeStruct {
   65    arg_uint32 status;
   66    struct argtimeval startime, lasttime;
   67    struct ether_addr ethersrc;
   68    struct ether_addr etherdst;
   69    struct tha addr;
   70    arg_int32 src_count, dst_count;
   71    arg_int32 src_bytes, dst_bytes;
   72 };
   73 
   74 
   75 struct inittcpWriteStruct {
   76    arg_int32 src_count, dst_count;
   77    arg_uint32 addr, seq;
   78 };
   79 
   80 struct tcpWriteStruct {
   81    arg_int32 src_count, dst_count;
   82    arg_int32 src_bytes, dst_bytes;
   83 };
   84 
   85 struct udpWriteStruct {
   86    arg_int32 src_count, dst_count;
   87    arg_int32 src_bytes, dst_bytes;
   88 };
   89 
   90 struct icmpWriteStruct {
   91    arg_uint8 type, code;
   92    arg_uint16 data;
   93    struct in_addr srcaddr, dstaddr, gwaddr;
   94 };
   95 
   96 struct fragWriteStruct {
   97    int fragnum, frag_id;
   98    unsigned short status, totlen, currlen, maxfraglen;
   99 };
  100 
  101 struct physWriteStruct {
  102    struct ether_addr ethersrc;
  103    struct ether_addr etherdst;
  104 };
  105 
  106 struct arpWriteStruct {
  107    struct argtimeval time;
  108    struct physWriteStruct phys;
  109    struct ether_arp arp;
  110 };
  111 
  112 struct  ipWriteStruct {
  113    struct argtimeval startime, lasttime;
  114    struct physWriteStruct ws_phys;
  115    struct in_addr src;
  116    struct in_addr dst;
  117    arg_uint16 sport;
  118    arg_uint16 dport;
  119    union {
  120       struct inittcpWriteStruct inittcp;
  121       struct  tcpWriteStruct  tcp;
  122       struct  udpWriteStruct  udp;
  123       struct icmpWriteStruct icmp;
  124       struct fragWriteStruct frag;
  125    } ipws_trans_union;
  126 };
  127 
  128 struct manInitStruct {
  129    struct argtimeval startime, now;
  130    arg_int8 initString[20];
  131    arg_uint32 localnet, netmask; 
  132    arg_uint16 reportInterval, dflagInterval; 
  133    arg_uint8 interfaceType, interfaceStatus;
  134 };
  135 
  136 struct manStatStruct {
  137    struct argtimeval startime, now;
  138    arg_uint16 reportInterval, dflagInterval;
  139    arg_uint8 interfaceType, interfaceStatus;
  140    arg_uint32 pktsRcvd, bytesRcvd, pktsDrop;
  141    arg_uint16 actTCPcons, cloTCPcons;
  142    arg_uint16 actUDPcons, cloUDPcons;
  143    arg_uint16 actIPcons,  cloIPcons;
  144    arg_uint16 actICMPcons,  cloICMPcons;
  145    arg_uint16 actFRAGcons,  cloFRAGcons;
  146 };
  147 
  148 struct WriteStruct {
  149    arg_uint32 status;
  150    union {
  151       struct    ipWriteStruct ip;
  152       struct   arpWriteStruct arp;
  153       struct   manInitStruct man_init;
  154       struct   manStatStruct man_stat;
  155    } ws_trans_union;
  156 };
  157 
  158 #define ws_ip   ws_trans_union.ip
  159 #define ws_arp  ws_trans_union.arp
  160 #define ws_init ws_trans_union.man_init
  161 #define ws_stat ws_trans_union.man_stat
  162 
  163 #define ws_ip_phys     ws_trans_union.ip.ws_phys
  164 #define ws_ip_src      ws_trans_union.ip.src
  165 #define ws_ip_dst      ws_trans_union.ip.dst
  166 #define ws_ip_port     ws_trans_union.ip.port
  167 #define ws_ip_inittcp  ws_trans_union.ip.ipws_trans_union.inittcp
  168 #define ws_ip_tcp      ws_trans_union.ip.ipws_trans_union.tcp
  169 #define ws_ip_udp      ws_trans_union.ip.ipws_trans_union.udp
  170 #define ws_ip_icmp     ws_trans_union.ip.ipws_trans_union.icmp
  171 #define ws_ip_frag     ws_trans_union.ip.ipws_trans_union.frag
  172 
  173 #endif