Xenomai  3.1
ipv4_chrdev.h
1 /***
2  *
3  * include/ipv4.h
4  *
5  * Real-Time IP/UDP/ICMP stack
6  *
7  * Copyright (C) 2004 Jan Kiszka <jan.kiszka@web.de>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  *
23  */
24 
25 #ifndef __IPV4_H_
26 #define __RTCFG_H_
27 
28 #include <rtnet_chrdev.h>
29 
30 struct ipv4_cmd {
31  struct rtnet_ioctl_head head;
32 
33  union {
34  /*** rtroute ***/
35  struct {
36  __u32 ip_addr;
37  } solicit;
38 
39  struct {
40  __u8 dev_addr[DEV_ADDR_LEN];
41  __u32 ip_addr;
42  } gethost;
43 
44  struct {
45  __u8 dev_addr[DEV_ADDR_LEN];
46  __u32 ip_addr;
47  } addhost;
48 
49  struct {
50  __u32 ip_addr;
51  } delhost;
52 
53  struct {
54  __u32 net_addr;
55  __u32 net_mask;
56  __u32 gw_addr;
57  } addnet;
58 
59  struct {
60  __u32 net_addr;
61  __u32 net_mask;
62  } delnet;
63 
64  /*** rtping ***/
65  struct {
66  __u32 ip_addr;
67  __u16 id;
68  __u16 sequence;
69  __u32 msg_size;
70  __u32 timeout;
71  __s64 rtt;
72  } ping;
73 
74  __u64 __padding[8];
75  } args;
76 };
77 
78 #define IOC_RT_HOST_ROUTE_ADD _IOW(RTNET_IOC_TYPE_IPV4, 0, struct ipv4_cmd)
79 #define IOC_RT_HOST_ROUTE_SOLICIT _IOW(RTNET_IOC_TYPE_IPV4, 1, struct ipv4_cmd)
80 #define IOC_RT_HOST_ROUTE_DELETE \
81  _IOW(RTNET_IOC_TYPE_IPV4, 2 | RTNET_IOC_NODEV_PARAM, struct ipv4_cmd)
82 #define IOC_RT_NET_ROUTE_ADD \
83  _IOW(RTNET_IOC_TYPE_IPV4, 3 | RTNET_IOC_NODEV_PARAM, struct ipv4_cmd)
84 #define IOC_RT_NET_ROUTE_DELETE \
85  _IOW(RTNET_IOC_TYPE_IPV4, 4 | RTNET_IOC_NODEV_PARAM, struct ipv4_cmd)
86 #define IOC_RT_PING \
87  _IOWR(RTNET_IOC_TYPE_IPV4, 5 | RTNET_IOC_NODEV_PARAM, struct ipv4_cmd)
88 #define IOC_RT_HOST_ROUTE_DELETE_DEV \
89  _IOW(RTNET_IOC_TYPE_IPV4, 6, struct ipv4_cmd)
90 #define IOC_RT_HOST_ROUTE_GET \
91  _IOWR(RTNET_IOC_TYPE_IPV4, 7 | RTNET_IOC_NODEV_PARAM, struct ipv4_cmd)
92 #define IOC_RT_HOST_ROUTE_GET_DEV _IOWR(RTNET_IOC_TYPE_IPV4, 8, struct ipv4_cmd)
93 
94 #endif /* __IPV4_H_ */