aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h64
1 files changed, 32 insertions, 32 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 212b048de..77f1e0a44 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -123,35 +123,6 @@
123/* scary. better ideas? (but do *test* them first!) */ 123/* scary. better ideas? (but do *test* them first!) */
124#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1))) 124#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1)))
125 125
126/* This structure defines protocol families and their handlers. */
127struct aftype {
128 const char *name;
129 const char *title;
130 int af;
131 int alen;
132 char *(*print) (unsigned char *);
133 const char *(*sprint) (struct sockaddr *, int numeric);
134 int (*input) (/*int type,*/ const char *bufp, struct sockaddr *);
135 void (*herror) (char *text);
136 int (*rprint) (int options);
137 int (*rinput) (int typ, int ext, char **argv);
138
139 /* may modify src */
140 int (*getmask) (char *src, struct sockaddr * mask, char *name);
141};
142
143/* This structure defines hardware protocols and their handlers. */
144struct hwtype {
145 const char *name;
146 const char *title;
147 int type;
148 int alen;
149 char *(*print) (unsigned char *);
150 int (*input) (const char *, struct sockaddr *);
151 int (*activate) (int fd);
152 int suppress_null_addr;
153};
154
155/* Some useful definitions */ 126/* Some useful definitions */
156#undef FALSE 127#undef FALSE
157#define FALSE ((int) 0) 128#define FALSE ((int) 0)
@@ -504,6 +475,7 @@ void clear_username_cache(void);
504enum { USERNAME_MAX_SIZE = 16 - sizeof(int) }; 475enum { USERNAME_MAX_SIZE = 16 - sizeof(int) };
505 476
506 477
478struct bb_applet;
507int execable_file(const char *name); 479int execable_file(const char *name);
508char *find_execable(const char *filename); 480char *find_execable(const char *filename);
509int exists_execable(const char *filename); 481int exists_execable(const char *filename);
@@ -537,6 +509,8 @@ int wait_nohang(int *wstat);
537#define wait_exitcode(w) ((w) >> 8) 509#define wait_exitcode(w) ((w) >> 8)
538#define wait_stopsig(w) ((w) >> 8) 510#define wait_stopsig(w) ((w) >> 8)
539#define wait_stopped(w) (((w) & 127) == 127) 511#define wait_stopped(w) (((w) & 127) == 127)
512/* Does NOT check that applet is NOFORK, just blindly runs it */
513int run_nofork_applet(const struct bb_applet *a, char **argv);
540/* wait4pid(spawn(argv)) + NOFORK/NOEXEC (if configured) */ 514/* wait4pid(spawn(argv)) + NOFORK/NOEXEC (if configured) */
541int spawn_and_wait(char **argv); 515int spawn_and_wait(char **argv);
542 516
@@ -669,6 +643,33 @@ int bbunpack(char **argv,
669int create_icmp_socket(void); 643int create_icmp_socket(void);
670int create_icmp6_socket(void); 644int create_icmp6_socket(void);
671/* interface.c */ 645/* interface.c */
646/* This structure defines protocol families and their handlers. */
647struct aftype {
648 const char *name;
649 const char *title;
650 int af;
651 int alen;
652 char *(*print) (unsigned char *);
653 const char *(*sprint) (struct sockaddr *, int numeric);
654 int (*input) (/*int type,*/ const char *bufp, struct sockaddr *);
655 void (*herror) (char *text);
656 int (*rprint) (int options);
657 int (*rinput) (int typ, int ext, char **argv);
658
659 /* may modify src */
660 int (*getmask) (char *src, struct sockaddr * mask, char *name);
661};
662/* This structure defines hardware protocols and their handlers. */
663struct hwtype {
664 const char *name;
665 const char *title;
666 int type;
667 int alen;
668 char *(*print) (unsigned char *);
669 int (*input) (const char *, struct sockaddr *);
670 int (*activate) (int fd);
671 int suppress_null_addr;
672};
672extern int interface_opt_a; 673extern int interface_opt_a;
673int display_interfaces(char *ifname); 674int display_interfaces(char *ifname);
674const struct aftype *get_aftype(const char *name); 675const struct aftype *get_aftype(const char *name);
@@ -677,11 +678,10 @@ const struct hwtype *get_hwntype(int type);
677 678
678 679
679#ifndef BUILD_INDIVIDUAL 680#ifndef BUILD_INDIVIDUAL
680struct bb_applet;
681extern const struct bb_applet *find_applet_by_name(const char *name); 681extern const struct bb_applet *find_applet_by_name(const char *name);
682/* Returns only if applet is not found. */ 682/* Returns only if applet is not found. */
683extern void run_applet_and_exit(const char *name, int argc, char **argv); 683extern void run_applet_and_exit(const char *name, char **argv);
684extern void run_current_applet_and_exit(int argc, char **argv) ATTRIBUTE_NORETURN; 684extern void run_current_applet_and_exit(char **argv) ATTRIBUTE_NORETURN;
685#endif 685#endif
686 686
687extern int match_fstype(const struct mntent *mt, const char *fstypes); 687extern int match_fstype(const struct mntent *mt, const char *fstypes);