initial checkin
[util-vserver.git] / util-vserver / kernel / network.h
1 #ifndef _VX_NETWORK_H
2 #define _VX_NETWORK_H
3
4
5 #define NB_IPV4ROOT     16
6
7 #ifdef  __KERNEL__
8
9 #include <linux/list.h>
10 #include <linux/spinlock.h>
11 #include <linux/utsname.h>
12 #include <asm/resource.h>
13 #include <asm/atomic.h>
14
15
16 struct ip_info {
17         struct list_head ip_list;               /* linked list of ipinfos */
18         atomic_t ip_refcount;
19         int nbipv4;
20         __u32 ipv4[NB_IPV4ROOT];/* Process can only bind to these IPs */
21                                 /* The first one is used to connect */
22                                 /* and for bind any service */
23                                 /* The other must be used explicity when */
24                                 /* binding */
25         __u32 mask[NB_IPV4ROOT];/* Netmask for each ipv4 */
26                                 /* Used to select the proper source address */
27                                 /* for sockets */
28         __u32 v4_bcast; /* Broadcast address used to receive UDP packets */
29 };
30
31
32 extern spinlock_t iplist_lock;
33 extern struct list_head ip_infos;
34
35
36 void free_ip_info(struct ip_info *);
37 struct ip_info *create_ip_info(void);
38
39 #endif  /* __KERNEL__ */
40 #endif  /* _VX_NETWORK_H */