28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: net.h,v 1.11 2005/03/14 19:14:03 debug Exp $ |
* $Id: net.h,v 1.12 2005/06/17 21:00:04 debug Exp $ |
32 |
* |
* |
33 |
* Emulated network support. (See net.c for more info.) |
* Emulated network support. (See net.c for more info.) |
34 |
*/ |
*/ |
39 |
|
|
40 |
struct emul; |
struct emul; |
41 |
struct ethernet_packet_link; |
struct ethernet_packet_link; |
42 |
|
struct remote_net; |
43 |
|
|
44 |
|
|
45 |
/*****************************************************************************/ |
/*****************************************************************************/ |
129 |
|
|
130 |
struct udp_connection udp_connections[MAX_UDP_CONNECTIONS]; |
struct udp_connection udp_connections[MAX_UDP_CONNECTIONS]; |
131 |
struct tcp_connection tcp_connections[MAX_TCP_CONNECTIONS]; |
struct tcp_connection tcp_connections[MAX_TCP_CONNECTIONS]; |
132 |
|
|
133 |
|
/* Distributed network: */ |
134 |
|
int local_port; |
135 |
|
int local_port_socket; |
136 |
|
struct remote_net *remote_nets; |
137 |
}; |
}; |
138 |
|
|
139 |
/* net.c: */ |
/* net.c: */ |
146 |
void net_dumpinfo(struct net *net); |
void net_dumpinfo(struct net *net); |
147 |
void net_add_nic(struct net *net, void *extra, unsigned char *macaddr); |
void net_add_nic(struct net *net, void *extra, unsigned char *macaddr); |
148 |
struct net *net_init(struct emul *emul, int init_flags, |
struct net *net_init(struct emul *emul, int init_flags, |
149 |
char *ipv4addr, int netipv4len); |
char *ipv4addr, int netipv4len, char **remote, int n_remote, |
150 |
|
int local_port); |
151 |
|
|
152 |
/* Flag used to signify that this net should have a gateway: */ |
/* Flag used to signify that this net should have a gateway: */ |
153 |
#define NET_INIT_FLAG_GATEWAY 1 |
#define NET_INIT_FLAG_GATEWAY 1 |
156 |
/* |
/* |
157 |
* This is for internal use in src/net.c: |
* This is for internal use in src/net.c: |
158 |
*/ |
*/ |
|
|
|
159 |
struct ethernet_packet_link { |
struct ethernet_packet_link { |
160 |
struct ethernet_packet_link *prev; |
struct ethernet_packet_link *prev; |
161 |
struct ethernet_packet_link *next; |
struct ethernet_packet_link *next; |
165 |
int len; |
int len; |
166 |
}; |
}; |
167 |
|
|
168 |
|
struct remote_net { |
169 |
|
struct remote_net *next; |
170 |
|
|
171 |
|
char *name; |
172 |
|
struct in_addr ipv4_addr; |
173 |
|
int portnr; |
174 |
|
}; |
175 |
|
|
176 |
#define TCP_OUTSIDE_TRYINGTOCONNECT 1 |
#define TCP_OUTSIDE_TRYINGTOCONNECT 1 |
177 |
#define TCP_OUTSIDE_CONNECTED 2 |
#define TCP_OUTSIDE_CONNECTED 2 |
180 |
|
|
181 |
#define TCP_INCOMING_BUF_LEN 2000 |
#define TCP_INCOMING_BUF_LEN 2000 |
182 |
|
|
|
|
|
183 |
#endif /* NET_H */ |
#endif /* NET_H */ |