Import version 1.8.3
[s390-tools.git] / qetharp / qetharp.h
blob54532f326b64faa838f294369ae28806caa3ae8a
1 /*
2 * File...........: qetharp.h
3 * Author(s)......: Thomas Spatzier <tspat@de.ibm.com>
4 * (adaptations to 2.6 kernel)
5 * originally written by: Frank Pavlic <pavlic@de.ibm.com>
6 *
7 * Copyright IBM Corp. 2001, 2006.
9 */
10 #ifndef __QETHARP_H__
11 #define __QETHARP_H__
13 #include <linux/types.h>
14 #include <linux/if.h>
15 #include "qeth26.h"
17 #define ifr_name ifr_ifrn.ifrn_name /* interface name */
18 #define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
19 #define ifr_addr ifr_ifru.ifru_addr /* address */
20 #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
21 #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
22 #define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
23 #define ifr_flags ifr_ifru.ifru_flags /* flags */
24 #define ifr_metric ifr_ifru.ifru_ivalue /* metric */
25 #define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
26 #define ifr_map ifr_ifru.ifru_map /* device map */
27 #define ifr_slave ifr_ifru.ifru_slave /* slave device */
28 #define ifr_data ifr_ifru.ifru_data /* for use by interface */
29 #define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
30 #define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
31 #define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */
32 #define ifr_newname ifr_ifru.ifru_newname /* New name */
35 /*****************************************************
36 * Declarations for OSA Relevant Things *
37 *****************************************************/
40 #define DATA_SIZE 20000
41 #define HIPERSOCKET_FLAGS 5
42 #define OSACARD_FLAGS 7
43 #define OSA_TR_FLAGS 0xf
45 #define MAC_LENGTH 6
46 #define IPV4_LENGTH 4
47 #define IPV6_LENGTH 16
48 #define IP_VERSION_4 1
50 /*****************************************************
51 * Declarations for parsing options *
52 *****************************************************/
54 #define QETHARP_GETOPT_STRING "p:q:a:d:i:m:nchv"
56 #define OPTION_INFO_QUERY 1
57 #define OPTION_INFO_PURGE 1
58 #define OPTION_INFO_HOST_RESOLUTION 1
59 #define OPTION_INFO_COMPACT_OUTPUT 1
60 #define OPTION_INFO_ADD 1
61 #define OPTION_INFO_DELETE 1
62 #define OPTION_INFO_IP 1
63 #define OPTION_INFO_MAC 1
65 /*****************************************************
66 * Declarations for version string *
67 *****************************************************/
68 #define COPYRIGHT "Copyright IBM Corp. 2003, 2006"
70 static struct option qetharp_options[]=
72 { "query", 1, 0, 'q'},
73 { "purge", 1, 0, 'p'},
74 { "numeric", 0, 0, 'n'},
75 { "compact", 0, 0, 'c'},
76 { "add", 1, 0, 'a'},
77 { "delete", 1, 0, 'd'},
78 { "ip", 1, 0, 'i'},
79 { "mac", 1, 0, 'm'},
80 { "help", 0, 0, 'h'},
81 { "version", 0, 0, 'v'},
82 {0,0,0,0}
85 struct option_info {
86 int purge_flag;
87 int query_flag;
88 int host_resolution;
89 int compact_output;
90 int add_flag;
91 int delete_flag;
92 int ip_flag;
93 int mac_flag;
94 char *dev_name;
95 char *ip_addr;
96 char *mac_addr;
99 #endif /* __QETHARP_H__ */