ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/netcompat.h
Revision: 1.6
Committed: Fri Oct 17 01:33:37 2003 UTC (20 years, 7 months ago) by pcg
Content type: text/plain
Branch: MAIN
CVS Tags: poll-based-iom, VPE_1_2, VPE_1_4, VPE_1_6, rel-1_7, VPE-1_6_1
Changes since 1.5: +4 -0 lines
Log Message:
*** empty log message ***

File Contents

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