direct-io.hg

view tools/vnet/vnetd/vnetd.h @ 5517:10e9028c8e3d

bitkeeper revision 1.1718.1.10 (42b7b19aqOS_1M8I4pIOFjiTPYWV-g)

Merge bk://xenbits.xensource.com/xen-unstable.bk
into spot.cl.cam.ac.uk:C:/Documents and Settings/iap10/xen-unstable.bk
author iap10@spot.cl.cam.ac.uk
date Tue Jun 21 06:20:10 2005 +0000 (2005-06-21)
parents 0a4b76b6b5a0
children 6bad5eb72ce0 dfaf788ab18c
line source
1 /*
2 * Copyright (C) 2004 Mike Wray <mike.wray@hp.com>.
3 *
4 * This library is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2.1 of the
7 * License, or (at your option) any later version. This library is
8 * distributed in the hope that it will be useful, but WITHOUT ANY
9 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE.
11 * See the GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17 #ifndef _VNET_VNETD_H_
18 #define _VNET_VNETD_H_
20 #include <asm/types.h>
21 #include <linux/if_ether.h>
22 #include "if_varp.h"
24 #include "connection.h"
25 #include "sxpr.h"
27 /** Vnetd udp port in host order. */
28 #define VNETD_PORT VARP_PORT
30 /** Vnetd peer port in host order. */
31 #define VNETD_PEER_PORT (VARP_PORT + 1)
33 typedef struct VnetMsgVarp {
34 VarpHdr varph;
35 } VnetMsgVarp;
37 #define VNET_FWD_MAX (1500 + 200)
39 typedef struct VnetMsgFwd {
40 VnetMsgHdr;
41 uint16_t protocol;
42 uint16_t len;
43 uint8_t data[VNET_FWD_MAX];
44 } __attribute__((packed)) VnetMsgFwd;
46 typedef union VnetMsg {
47 VnetMsgHdr hdr;
48 VnetMsgVarp varp;
49 VnetMsgFwd fwd;
50 } VnetMsg;
52 enum {
53 VNET_VARP_ID = VARP_ID,
54 VNET_FWD_ID = 200,
55 };
57 typedef struct Vnetd {
58 unsigned long port;
59 unsigned long peer_port;
60 int verbose;
62 int esp_sock;
63 int etherip_sock;
65 struct sockaddr_in addr;
66 struct sockaddr_in mcast_addr;
68 Sxpr peers;
70 Conn *listen_conn;
71 Conn *udp_conn;
72 Conn *bcast_conn;
74 ConnList *connections;
76 } Vnetd;
78 extern Vnetd *vnetd;
80 #endif /* ! _VNET_VNETD_H_ */