proto_v4.h

Go to the documentation of this file.
00001 /*
00002  ** Copyright (C) 2002-2006 INL
00003  ** Written by Eric Leblond <eric@regit.org>
00004  **            Vincent Deffontaines <vincent@gryzor.com>
00005  ** INL http://www.inl.fr/
00006  **
00007  ** $Id: proto_v4.h 5285 2008-11-21 15:39:55Z pollux $
00008  **
00009  ** This program is free software; you can redistribute it and/or modify
00010  ** it under the terms of the GNU General Public License as published by
00011  ** the Free Software Foundation, version 3 of the License.
00012  **
00013  ** This program is distributed in the hope that it will be useful,
00014  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  ** GNU General Public License for more details.
00017  **
00018  ** You should have received a copy of the GNU General Public License
00019  ** along with this program; if not, write to the Free Software
00020  ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00021  */
00022 
00023 #ifndef NUFW_PROTOCOL_V4_H
00024 #define NUFW_PROTOCOL_V4_H
00025 
00026 #include <netinet/in.h>         /* struct in6addr */
00027 #ifdef LINUX
00028 #   ifdef USE_NFQUEUE
00029 #       include <linux/if.h>
00030 #   else
00031 #       define IFNAMSIZ 16
00032 #   endif
00033 #else
00034 #define IFNAMSIZ 16
00035 #endif
00036 
00043 /* 
00044  * Protocol 4 definition 
00045  */
00046 
00052 #define aligned_u64 unsigned long long __attribute__((aligned(8)))
00053 
00054 struct nuv4_conntrack_message_t {
00055         /* Copy/paste nufw_to_nuauth_message_header_t content */
00056         uint8_t protocol_version;       
00057         uint8_t msg_type;       
00058         uint16_t msg_length;    
00060         /* Conntrack fields */
00061         uint32_t timeout;       
00062         struct in6_addr ip_src; 
00063         struct in6_addr ip_dst; 
00064         uint8_t ip_protocol;    
00065         uint16_t src_port;      
00066         uint16_t dest_port;     
00068         /* mark field */
00069         u_int32_t mark;
00070 
00071         /* counters fields */
00072         aligned_u64 packets_in;
00073         aligned_u64 bytes_in;
00074         aligned_u64 packets_out;
00075         aligned_u64 bytes_out;
00076 
00077 };
00078 
00083 typedef struct {
00084         /* Copy/paste nufw_to_nuauth_message_header_t content */
00085         uint8_t protocol_version;       
00086         uint8_t msg_type;       
00087         uint16_t msg_length;    
00089         /* Authentification fields */
00090         uint32_t packet_id;     
00091         uint32_t timestamp;     
00093         u_int32_t mark;
00094         char indev[IFNAMSIZ];
00095         char physindev[IFNAMSIZ];
00096         char outdev[IFNAMSIZ];
00097         char physoutdev[IFNAMSIZ];
00098 
00099         /* (...): packet content (maybe truncated) */
00100 } nuv4_nufw_to_nuauth_auth_message_t;
00101 
00105 typedef struct {
00106         uint8_t protocol_version;       
00107         uint8_t msg_type;       
00108         u_int8_t decision;      
00109         u_int8_t priority;      
00110         uint32_t packet_id;     
00111         u_int32_t tcmark;       
00112         uint16_t payload_len;   
00115         uint16_t padding;       
00116 } nuv4_nuauth_decision_response_t;
00117 
00118 #endif

Generated on Sat Nov 22 04:00:37 2008 for NuFW by  doxygen 1.4.7