Xenomai  3.0.8
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 
31 struct ipv4_cmd {
32  struct rtnet_ioctl_head head;
33 
34  union {
35  /*** rtroute ***/
36  struct {
37  __u32 ip_addr;
38  } solicit;
39 
40  struct {
41  __u8 dev_addr[DEV_ADDR_LEN];
42  __u32 ip_addr;
43  } gethost;
44 
45  struct {
46  __u8 dev_addr[DEV_ADDR_LEN];
47  __u32 ip_addr;
48  } addhost;
49 
50  struct {
51  __u32 ip_addr;
52  } delhost;
53 
54  struct {
55  __u32 net_addr;
56  __u32 net_mask;
57  __u32 gw_addr;
58  } addnet;
59 
60  struct {
61  __u32 net_addr;
62  __u32 net_mask;
63  } delnet;
64 
65  /*** rtping ***/
66  struct {
67  __u32 ip_addr;
68  __u16 id;
69  __u16 sequence;
70  __u32 msg_size;
71  __u32 timeout;
72  __s64 rtt;
73  } ping;
74 
75  __u64 __padding[8];
76  } args;
77 };
78 
79 
80 #define IOC_RT_HOST_ROUTE_ADD _IOW(RTNET_IOC_TYPE_IPV4, 0, \
81  struct ipv4_cmd)
82 #define IOC_RT_HOST_ROUTE_SOLICIT _IOW(RTNET_IOC_TYPE_IPV4, 1, \
83  struct ipv4_cmd)
84 #define IOC_RT_HOST_ROUTE_DELETE _IOW(RTNET_IOC_TYPE_IPV4, 2 | \
85  RTNET_IOC_NODEV_PARAM, \
86  struct ipv4_cmd)
87 #define IOC_RT_NET_ROUTE_ADD _IOW(RTNET_IOC_TYPE_IPV4, 3 | \
88  RTNET_IOC_NODEV_PARAM, \
89  struct ipv4_cmd)
90 #define IOC_RT_NET_ROUTE_DELETE _IOW(RTNET_IOC_TYPE_IPV4, 4 | \
91  RTNET_IOC_NODEV_PARAM, \
92  struct ipv4_cmd)
93 #define IOC_RT_PING _IOWR(RTNET_IOC_TYPE_IPV4, 5 | \
94  RTNET_IOC_NODEV_PARAM, \
95  struct ipv4_cmd)
96 #define IOC_RT_HOST_ROUTE_DELETE_DEV _IOW(RTNET_IOC_TYPE_IPV4, 6, \
97  struct ipv4_cmd)
98 #define IOC_RT_HOST_ROUTE_GET _IOWR(RTNET_IOC_TYPE_IPV4, 7 | \
99  RTNET_IOC_NODEV_PARAM, \
100  struct ipv4_cmd)
101 #define IOC_RT_HOST_ROUTE_GET_DEV _IOWR(RTNET_IOC_TYPE_IPV4, 8, \
102  struct ipv4_cmd)
103 
104 #endif /* __IPV4_H_ */