Annotation of embedaddon/mpd/src/ngfunc.h, revision 1.1.1.3

1.1       misho       1: 
                      2: /*
                      3:  * ngfunc.h
                      4:  *
                      5:  * Written by Archie Cobbs <archie@freebsd.org>
                      6:  * Copyright (c) 1995-1999 Whistle Communications, Inc. All rights reserved.
                      7:  * See ``COPYRIGHT.whistle''
                      8:  */
                      9: 
                     10: #ifndef _NGFUNC_H_
                     11: #define _NGFUNC_H_
                     12: 
                     13: #include "defs.h"
                     14: #include "bund.h"
                     15: 
                     16: #include <netgraph/ng_message.h>
                     17: #include <netgraph/ng_ppp.h>
                     18: 
                     19: /*
                     20:  * DEFINITIONS
                     21:  */
                     22: 
                     23:   /*
                     24:    * The "mssfix-in"/"mssfix-out" hooks are used for TCP SYN segments,
                     25:    * if userland tcpmssfix is on.
                     26:    */
                     27: 
                     28:   #ifndef USE_NG_TCPMSS
                     29:   #define MPD_HOOK_TCPMSS_IN   "tcpmss-in"
                     30:   #define MPD_HOOK_TCPMSS_OUT  "tcpmss-out"
                     31:   #endif
                     32: 
                     33:   #define BPF_HOOK_PPP         "ppp"
                     34:   #define BPF_HOOK_IFACE       "iface"
                     35:   #define BPF_HOOK_MPD         "mpd"
                     36: 
                     37:   #define BPF_MODE_OFF         0       /* no BPF node traffic gets through */
                     38:   #define BPF_MODE_ON          1       /* normal BPF node traffic flow */
                     39:   #define BPF_MODE_DEMAND      2       /* block traffic; redirect demand */
                     40:   #define BPF_MODE_MSSFIX      3       /* redirect all TCP SYN packets */
                     41:   #define BPF_MODE_MSSFIX_IN   4       /* redirect incoming TCP SYN packets */
                     42:   #define BPF_MODE_MSSFIX_OUT  5       /* redirect outgoing TCP SYN packets */
                     43: 
                     44: /*
                     45:  * VARIABLES
                     46:  */
                     47: 
                     48:   #ifdef USE_NG_TCPMSS
                     49:   extern u_char gTcpMSSNode;
                     50:   #endif
                     51:   #ifdef USE_NG_NETFLOW
                     52:   extern const struct cmdtab NetflowSetCmds[];
                     53:   
                     54:   extern u_char gNetflowNode;
                     55:   extern u_char gNetflowNodeShutdown;
                     56:   extern char gNetflowNodeName[64];
                     57:   extern ng_ID_t gNetflowNodeID;
                     58:   extern u_int gNetflowIface;
                     59:   extern struct sockaddr_storage gNetflowExport;
                     60:   extern struct sockaddr_storage gNetflowSource;
                     61:   extern uint32_t gNetflowInactive;
                     62:   extern uint32_t gNetflowActive;
                     63:   #endif
                     64:   
                     65: /*
                     66:  * FUNCTIONS
                     67:  */
                     68: 
                     69:   extern void  NgFuncShutdownGlobal(void);
                     70:   extern void  NgFuncSetConfig(Bund b);
                     71:   extern int   NgFuncWritePppFrame(Bund b, int linkNum, int proto, Mbuf bp);
                     72:   extern int   NgFuncWritePppFrameLink(Link l, int proto, Mbuf bp);
                     73:   extern int   NgFuncWriteFrame(int dsock, const char *hookname, const char *label, Mbuf bp);
                     74:   extern int   NgFuncClrStats(Bund b, u_int16_t linkNum);
1.1.1.3 ! misho      75: #ifndef NG_PPP_STATS64
1.1       misho      76:   extern int   NgFuncGetStats(Bund b, u_int16_t linkNum,
                     77:                        struct ng_ppp_link_stat *s);
1.1.1.3 ! misho      78: #else
1.1       misho      79:   extern int   NgFuncGetStats64(Bund b, u_int16_t linkNum,
                     80:                        struct ng_ppp_link_stat64 *s);
1.1.1.3 ! misho      81: #endif
1.1       misho      82:   extern int   NgFuncSendQuery(const char *path, int cookie, int cmd,
                     83:                        const void *args, size_t arglen, struct ng_mesg *rbuf,
                     84:                        size_t replen, char *raddr);
                     85: 
                     86:   extern int   NgFuncConnect(int csock, char *label, const char *path, const char *hook,
                     87:                        const char *path2, const char *hook2);
                     88:   extern int   NgFuncDisconnect(int csock, char *label, const char *path, const char *hook);
                     89:   extern int   NgFuncShutdownNode(int csock, const char *label, const char *path);
                     90: 
                     91:   extern void  NgFuncErrx(const char *fmt, ...);
                     92:   extern void  NgFuncErr(const char *fmt, ...);
                     93: 
                     94:   #ifdef USE_NG_NETFLOW
                     95:   extern int   NgFuncInitGlobalNetflow(void);
1.1.1.3 ! misho      96:   extern int   ShowNetflow(Context ctx, int ac, const char *const av[], const void *arg);
1.1       misho      97:   #endif
                     98:   
                     99:   extern int   NgFuncCreateIface(Bund b, char *buf, int max);
                    100:   extern ng_ID_t       NgGetNodeID(int csock, const char *path);
                    101: 
                    102: #endif
                    103: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>