ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/netcompat.h
Revision: 1.9
Committed: Tue Apr 26 00:55:56 2005 UTC (19 years, 1 month ago) by pcg
Content type: text/plain
Branch: MAIN
CVS Tags: rel-2_01, rel-2_0
Changes since 1.8: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.1 /*
2     netcompat.h -- network compatibility header
3 pcg 1.7 Copyright (C) 2003 Marc Lehmann <gvpe@schmorp.de>
4 pcg 1.1
5 pcg 1.7 This file is part of GVPE.
6    
7     GVPE is free software; you can redistribute it and/or modify
8 pcg 1.1 it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11    
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     GNU General Public License for more details.
16    
17     You should have received a copy of the GNU General Public License
18 pcg 1.7 along with gvpe; if not, write to the Free Software
19 pcg 1.9 Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 pcg 1.1 */
21    
22 pcg 1.8 #ifndef GVPE_NETCOMPAT_H
23     #define GVPE_NETCOMPAT_H
24 pcg 1.1
25 pcg 1.5 #include <sys/types.h>
26 pcg 1.1 #include <sys/socket.h>
27     #ifdef HAVE_NETINET_IN_H
28     # include <netinet/in.h>
29     #endif
30 pcg 1.2 #ifdef HAVE_ARPA_INET_H
31     # include <arpa/inet.h>
32     #endif
33 pcg 1.1 #include <net/if.h>
34     #ifdef HAVE_NETINET_IN_SYSTM_H
35     # include <netinet/in_systm.h>
36     #endif
37     #ifdef HAVE_NETINET_IP_H
38     # include <netinet/ip.h>
39     #endif
40    
41 pcg 1.4 #ifndef IPTOS_MINCOST
42     # define IPTOS_MINCOST 0x02
43 pcg 1.1 #endif
44     #ifndef IPTOS_RELIABILITY
45     # define IPTOS_RELIABILITY 0x04
46     #endif
47     #ifndef IPTOS_THROUGHPUT
48     # define IPTOS_THROUGHPUT 0x08
49     #endif
50     #ifndef IPTOS_LOWDELAY
51     # define IPTOS_LOWDELAY 0x10
52     #endif
53    
54     #ifndef IPTOS_TOS_MASK
55     # define IPTOS_TOS_MASK (IPTOS_LOWDELAY | IPTOS_THROUGHPUT | IPTOS_RELIABILITY | IPTOS_MINCOST)
56     #endif
57    
58     #if !defined(SOL_IP) && defined(IPPROTO_IP)
59     # define SOL_IP IPPROTO_IP
60     #endif
61    
62     #ifndef IPPROTO_GRE
63     # define IPPROTO_GRE 47
64     #endif
65    
66 pcg 1.6 #ifndef ICMP_ECHOREPLY
67     # define ICMP_ECHOREPLY 0
68     #endif
69    
70 pcg 1.1 #ifndef HAVE_SOCKLEN_T
71     typedef int socklen_t;
72     #endif
73    
74     #if ENABLE_ICMP
75     # include <netinet/ip_icmp.h>
76     struct icmp_header {
77     u8 type;
78     u8 code;
79     u16 checksum;
80     union {
81     struct {
82     u16 id;
83     u16 sequence;
84     } echo;
85     u32 gateway;
86     struct {
87     u16 unused;
88     u16 mtu;
89     } frag;
90     } un;
91     };
92     #endif
93    
94     #endif
95