Annotation of embedaddon/mpd/src/ngfunc.h, revision 1.1
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);
! 75: extern int NgFuncGetStats(Bund b, u_int16_t linkNum,
! 76: struct ng_ppp_link_stat *s);
! 77: extern int NgFuncGetStats64(Bund b, u_int16_t linkNum,
! 78: struct ng_ppp_link_stat64 *s);
! 79: extern int NgFuncSendQuery(const char *path, int cookie, int cmd,
! 80: const void *args, size_t arglen, struct ng_mesg *rbuf,
! 81: size_t replen, char *raddr);
! 82:
! 83: extern int NgFuncConnect(int csock, char *label, const char *path, const char *hook,
! 84: const char *path2, const char *hook2);
! 85: extern int NgFuncDisconnect(int csock, char *label, const char *path, const char *hook);
! 86: extern int NgFuncShutdownNode(int csock, const char *label, const char *path);
! 87:
! 88: extern void NgFuncErrx(const char *fmt, ...);
! 89: extern void NgFuncErr(const char *fmt, ...);
! 90:
! 91: #ifdef USE_NG_NETFLOW
! 92: extern int NgFuncInitGlobalNetflow(void);
! 93: #endif
! 94:
! 95: extern int NgFuncCreateIface(Bund b, char *buf, int max);
! 96: extern ng_ID_t NgGetNodeID(int csock, const char *path);
! 97:
! 98: #endif
! 99:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>