diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/applets.h | 1 | ||||
-rw-r--r-- | include/libbb.h | 37 | ||||
-rw-r--r-- | include/usage.h | 20 |
3 files changed, 58 insertions, 0 deletions
diff --git a/include/applets.h b/include/applets.h index 8586ffc86..465ecdbdd 100644 --- a/include/applets.h +++ b/include/applets.h | |||
@@ -56,6 +56,7 @@ USE_ADDGROUP(APPLET(addgroup, _BB_DIR_BIN, _BB_SUID_NEVER)) | |||
56 | USE_ADDUSER(APPLET(adduser, _BB_DIR_BIN, _BB_SUID_NEVER)) | 56 | USE_ADDUSER(APPLET(adduser, _BB_DIR_BIN, _BB_SUID_NEVER)) |
57 | USE_ADJTIMEX(APPLET(adjtimex, _BB_DIR_SBIN, _BB_SUID_NEVER)) | 57 | USE_ADJTIMEX(APPLET(adjtimex, _BB_DIR_SBIN, _BB_SUID_NEVER)) |
58 | USE_AR(APPLET(ar, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | 58 | USE_AR(APPLET(ar, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) |
59 | USE_ARP(APPLET(arp, _BB_DIR_SBIN, _BB_SUID_NEVER)) | ||
59 | USE_ARPING(APPLET(arping, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | 60 | USE_ARPING(APPLET(arping, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) |
60 | USE_ASH(APPLET_NOUSAGE(ash, ash, _BB_DIR_BIN, _BB_SUID_NEVER)) | 61 | USE_ASH(APPLET_NOUSAGE(ash, ash, _BB_DIR_BIN, _BB_SUID_NEVER)) |
61 | USE_AWK(APPLET(awk, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | 62 | USE_AWK(APPLET(awk, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) |
diff --git a/include/libbb.h b/include/libbb.h index e92e4db1c..6f66c8545 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -121,6 +121,38 @@ | |||
121 | /* scary. better ideas? (but do *test* them first!) */ | 121 | /* scary. better ideas? (but do *test* them first!) */ |
122 | #define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1))) | 122 | #define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1))) |
123 | 123 | ||
124 | /* This structure defines protocol families and their handlers. */ | ||
125 | struct aftype { | ||
126 | char *name; | ||
127 | char *title; | ||
128 | int af; | ||
129 | int alen; | ||
130 | char *(*print) (unsigned char *); | ||
131 | char *(*sprint) (struct sockaddr *, int numeric); | ||
132 | int (*input) (int type, char *bufp, struct sockaddr *); | ||
133 | void (*herror) (char *text); | ||
134 | int (*rprint) (int options); | ||
135 | int (*rinput) (int typ, int ext, char **argv); | ||
136 | |||
137 | /* may modify src */ | ||
138 | int (*getmask) (char *src, struct sockaddr * mask, char *name); | ||
139 | |||
140 | int fd; | ||
141 | char *flag_file; | ||
142 | }; | ||
143 | |||
144 | /* This structure defines hardware protocols and their handlers. */ | ||
145 | struct hwtype { | ||
146 | char *name; | ||
147 | char *title; | ||
148 | int type; | ||
149 | int alen; | ||
150 | char *(*print) (unsigned char *); | ||
151 | int (*input) (char *, struct sockaddr *); | ||
152 | int (*activate) (int fd); | ||
153 | int suppress_null_addr; | ||
154 | }; | ||
155 | |||
124 | /* Some useful definitions */ | 156 | /* Some useful definitions */ |
125 | #undef FALSE | 157 | #undef FALSE |
126 | #define FALSE ((int) 0) | 158 | #define FALSE ((int) 0) |
@@ -426,8 +458,13 @@ extern int bb_test(int argc, char** argv); | |||
426 | int create_icmp_socket(void); | 458 | int create_icmp_socket(void); |
427 | int create_icmp6_socket(void); | 459 | int create_icmp6_socket(void); |
428 | /* interface.c */ | 460 | /* interface.c */ |
461 | struct aftype; | ||
462 | struct hwtype; | ||
429 | extern int interface_opt_a; | 463 | extern int interface_opt_a; |
430 | int display_interfaces(char *ifname); | 464 | int display_interfaces(char *ifname); |
465 | struct aftype *get_aftype(const char *name); | ||
466 | const struct hwtype *get_hwtype(const char *name); | ||
467 | const struct hwtype *get_hwntype(int type); | ||
431 | 468 | ||
432 | 469 | ||
433 | #ifndef BUILD_INDIVIDUAL | 470 | #ifndef BUILD_INDIVIDUAL |
diff --git a/include/usage.h b/include/usage.h index ae03d5431..cfae4e1e1 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -55,6 +55,26 @@ | |||
55 | " -x Extract\n" \ | 55 | " -x Extract\n" \ |
56 | " -v Verbosely list files processed" | 56 | " -v Verbosely list files processed" |
57 | 57 | ||
58 | #define arp_trivial_usage \ | ||
59 | "\n" \ | ||
60 | "[-vn] [-H type] [-i if] -a [hostname]\n" \ | ||
61 | "[-v] [-i if] -d hostname [pub]\n" \ | ||
62 | "[-v] [-H type] [-i if] -s hostname hw_addr [temp]\n" \ | ||
63 | "[-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub\n" \ | ||
64 | "[-v] [-H type] [-i if] -Ds hostname ifa [netmask nm] pub\n" | ||
65 | #define arp_full_usage \ | ||
66 | "Manipulate the system ARP cache" \ | ||
67 | "\n\nOptions:" \ | ||
68 | "\n -a Display (all) hosts" \ | ||
69 | "\n -s Set a new ARP entry" \ | ||
70 | "\n -d Delete a specified entry" \ | ||
71 | "\n -v Verbose" \ | ||
72 | "\n -n Don't resolve names" \ | ||
73 | "\n -i if Specify network interface (e.g. eth0)" \ | ||
74 | "\n -D Read <hwaddr> from given device" \ | ||
75 | "\n -A, -p Specify protocol family" \ | ||
76 | "\n -H hwtype Specify hardware address type" | ||
77 | |||
58 | #define arping_trivial_usage \ | 78 | #define arping_trivial_usage \ |
59 | "[-fqbDUA] [-c count] [-w timeout] [-i device] [-s sender] target" | 79 | "[-fqbDUA] [-c count] [-w timeout] [-i device] [-s sender] target" |
60 | #define arping_full_usage \ | 80 | #define arping_full_usage \ |