[insert project logo here (125x200px max)] Navigator Mailinglists Please report any errors or ommissions you find to our `Help' mailinglist, or post a message in the Forums. Copyright and Licensing Information Snap is (c) Jonathan T. Moore, 1999-2002 and licensed under the GNU General Public License (GPL). All other parts of Splash are (c) Willem de Bruijn, 2002-2003 and licensed under the BSD Open Source License. All sourcecode is made publicly available. Acknowledgement Splash and the Splash website are hosted by SourceForge.net |
Splash - DocumentationSNMP Plus a Lightweight API for SNAP Handlingsnap-1.1-wjdb/lib/net-support.hGo to the documentation of this file.00001 /* 00002 * lib/support.h This file contains the definitions of what is in the 00003 * support library. Most of all, it defines structures 00004 * for accessing support modules, and the function proto- 00005 * types. 00006 * 00007 * NET-LIB A collection of functions used from the base set of the 00008 * NET-3 Networking Distribution for the LINUX operating 00009 * system. (net-tools, net-drivers) 00010 * 00011 * Version: lib/net-support.h 1.34 (1996-04-13) 00012 * 00013 * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de> 00014 * 00015 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> 00016 * Copyright 1993 MicroWalt Corporation 00017 * 00018 * Modifications: 00019 *960125 {1.20} Bernd Eckenfels: reformated, layout 00020 *960202 {1.30} Bernd Eckenfels: rprint in aftype 00021 *960206 {1.31} Bernd Eckenfels: route_init 00022 *960219 {1.32} Bernd Eckenfels: type for ap->input() 00023 *960322 {1.33} Bernd Eckenfels: activate_ld and const in get_hwtype 00024 *960413 {1.34} Bernd Eckenfels: new RTACTION suport 00025 * 00026 * This program is free software; you can redistribute it 00027 * and/or modify it under the terms of the GNU General 00028 * Public License as published by the Free Software 00029 * Foundation; either version 2 of the License, or (at 00030 * your option) any later version. 00031 */ 00032 #include <sys/socket.h> 00033 00034 /* This structure defines protocol families and their handlers. */ 00035 struct aftype { 00036 char *name; 00037 char *title; 00038 int af; 00039 int alen; 00040 char *(*print) (unsigned char *); 00041 char *(*sprint) (struct sockaddr *, int numeric); 00042 int (*input) (int type, char *bufp, struct sockaddr *); 00043 void (*herror) (char *text); 00044 int (*rprint) (int options); 00045 int (*rinput) (int typ, int ext, char **argv); 00046 00047 /* may modify src */ 00048 int (*getmask) (char *src, struct sockaddr *mask, char *name); 00049 00050 }; 00051 00052 00053 /* This structure defines hardware protocols and their handlers. */ 00054 struct hwtype { 00055 char *name; 00056 char *title; 00057 int type; 00058 int alen; 00059 char *(*print) (unsigned char *); 00060 char *(*sprint) (struct sockaddr *); 00061 int (*input) (char *, struct sockaddr *); 00062 int (*activate) (int fd); 00063 }; 00064 00065 00066 extern struct hwtype *get_hwtype(const char *name); 00067 extern struct hwtype *get_hwntype(int type); 00068 extern struct aftype *get_aftype(const char *name); 00069 extern struct aftype *get_afntype(int type); 00070 00071 extern int getargs(char *string, char *arguments[]); 00072 00073 extern void getroute_init(void); 00074 extern void setroute_init(void); 00075 extern void activate_init(void); 00076 extern int route_info(const char *afname, int flags); 00077 extern int route_edit(int action, const char *afname, int flags, char **argv); 00078 extern int activate_ld(const char *hwname, int fd); 00079 00080 #define RTACTION_ADD 1 00081 #define RTACTION_DEL 2 00082 #define RTACTION_HELP 3 00083 #define RTACTION_FLUSH 4 00084 #define RTACTION_SHOW 5 00085 00086 #define FLAG_EXT 3 /* AND-Mask */ 00087 #define FLAG_NUM 4 00088 #define FLAG_SYM 8 00089 #define FLAG_CACHE 16 00090 #define FLAG_FIB 32 00091 #define FLAG_VERBOSE 64 00092 00093 extern int ip_masq_info(int numeric, int ext); 00094 00095 extern int INET_rprint(int options); 00096 extern int INET6_rprint(int options); 00097 extern int DDP_rprint(int options); 00098 extern int IPX_rprint(int options); 00099 extern int NETROM_rprint(int options); 00100 extern int AX25_rprint(int options); 00101 00102 extern int INET_rinput(int action, int flags, char **argv); 00103 extern int INET6_rinput(int action, int flags, char **argv); 00104 extern int DDP_rinput(int action, int flags, char **argv); 00105 extern int IPX_rinput(int action, int flags, char **argv); 00106 extern int NETROM_rinput(int action, int flags, char **argv); 00107 extern int AX25_rinput(int action, int flags, char **argv); 00108 00109 int aftrans_opt (const char *arg); 00110 void aftrans_def (char *tool, char *argv0, char *dflt); 00111 00112 char * get_sname(int socknumber, char *proto, int numeric); 00113 00114 extern int flag_unx; 00115 extern int flag_ipx; 00116 extern int flag_ax25; 00117 extern int flag_ddp; 00118 extern int flag_netrom; 00119 extern int flag_inet; 00120 extern int flag_inet6; 00121 00122 extern char afname[]; 00123 00124 #define AFTRANS_OPTS \ 00125 {"ax25", 0, 0, 1}, \ 00126 {"ip", 0, 0, 1}, \ 00127 {"ipx", 0, 0, 1}, \ 00128 {"appletalk", 0, 0, 1}, \ 00129 {"netrom", 0, 0, 1}, \ 00130 {"inet", 0, 0, 1}, \ 00131 {"ddp", 0, 0, 1}, \ 00132 {"unix", 0, 0, 1}, \ 00133 {"tcpip", 0, 0, 1} 00134 #define AFTRANS_CNT 9 00135 00136 #define EINTERN(file, text) fprintf(stderr, \ 00137 "%s: Internal Error `%s'.\n",file,text); 00138 00139 #define ENOSUPP(A,B) fprintf(stderr,\ 00140 _("%s: feature `%s' not supported.\n" \ 00141 "Please recompile `net-tools' with "\ 00142 "newer kernel source or full configuration.\n"),A,B) 00143 00144 #define ESYSNOT(A,B) fprintf(stderr, _("%s: no support for `%s' on this system.\n"),A,B) 00145 00146 #define E_NOTFOUND 8 00147 #define E_SOCK 7 00148 #define E_LOOKUP 6 00149 #define E_VERSION 5 00150 #define E_USAGE 4 00151 #define E_OPTERR 3 00152 #define E_INTERN 2 00153 #define E_NOSUPP 1 00154 00155 /* End of lib/support.h */ |