OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [userland/] [route/] [include/] [util-ank.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 745 simons
#ifndef __UTILS_H__
2
#define __UTILS_H__ 1
3
 
4
#include <asm/types.h>
5
 
6
extern int preferred_family;
7
extern int show_stats;
8
extern int show_details;
9
extern int show_raw;
10
extern int resolve_hosts;
11
 
12
#ifndef IPPROTO_ESP
13
#define IPPROTO_ESP     50
14
#endif
15
#ifndef IPPROTO_AH
16
#define IPPROTO_AH      51
17
#endif
18
 
19
#define SPRINT_BSIZE 64
20
#define SPRINT_BUF(x)   char x[SPRINT_BSIZE]
21
 
22
 
23
#define NEXT_ARG() \
24
argv++; \
25
if (--argc <= 0) \
26
        usage();
27
 
28
typedef struct
29
{
30
        __u8 family;
31
        __u8 bytelen;
32
        __s16 bitlen;
33
        __u32 data[4];
34
} inet_prefix;
35
 
36
extern __u32 get_addr32(char *name);
37
extern int get_addr_1(inet_prefix *dst, char *arg, int family);
38
extern int get_prefix_1(inet_prefix *dst, char *arg, int family);
39
extern int get_addr(inet_prefix *dst, char *arg, int family);
40
extern int get_prefix(inet_prefix *dst, char *arg, int family);
41
 
42
extern int scan_number(char *arg, unsigned *val);
43
 
44
extern int get_integer(int *val, char *arg, int base);
45
extern int get_unsigned(unsigned *val, char *arg, int base);
46
#define get_byte get_u8
47
#define get_ushort get_u16
48
#define get_short get_s16
49
extern int get_u32(__u32 *val, char *arg, int base);
50
extern int get_u16(__u16 *val, char *arg, int base);
51
extern int get_s16(__s16 *val, char *arg, int base);
52
extern int get_u8(__u8 *val, char *arg, int base);
53
extern int get_s8(__s8 *val, char *arg, int base);
54
 
55
extern int get_tc_classid(__u32 *h, char *str);
56
extern int print_tc_classid(char *buf, int len, __u32 h);
57
extern char * sprint_tc_classid(__u32 h, char *buf);
58
 
59
/* static void usage(void) __attribute__((noreturn)); */
60
void invarg(char *) __attribute__((noreturn));
61
int matches(char *arg, char *pattern);
62
extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits);
63
 
64
extern int ipaddr_list(int argc, char **argv);
65
extern int iproute_monitor(int argc, char **argv);
66
extern int do_ipaddr(int argc, char **argv);
67
extern int do_iproute(int argc, char **argv);
68
extern int do_iprule(int argc, char **argv);
69
extern int do_ipneigh(int argc, char **argv);
70
extern int do_iptunnel(int argc, char **argv);
71
extern int do_iplink(int argc, char **argv);
72
extern int do_ipmonitor(int argc, char **argv);
73
extern int do_multiaddr(int argc, char **argv);
74
extern int do_qdisc(int argc, char **argv);
75
extern int do_class(int argc, char **argv);
76
extern int do_filter(int argc, char **argv);
77
 
78
extern const char *format_host(int af, void *addr, __u8 *abuf, int alen);
79
 
80
#endif /* __UTILS_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.