#include <sys/param.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/syslog.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/ng_lmi.h>
Go to the source code of this file.
|
static int | nglmi_checkdata (hook_p hook, struct mbuf *m) |
|
| NETGRAPH_INIT (lmi, &typestruct) |
|
static void | LMI_ticker (node_p node, hook_p hook, void *arg1, int arg2) |
|
static void | nglmi_startup_fixed (sc_p sc, hook_p hook) |
|
static void | nglmi_startup_auto (sc_p sc) |
|
static void | nglmi_startup (sc_p sc) |
|
static void | nglmi_inquire (sc_p sc, int full) |
|
static void | ngauto_state_machine (sc_p sc) |
|
static int | nglmi_constructor (node_p node) |
|
static int | nglmi_newhook (node_p node, hook_p hook, const char *name) |
|
static int | nglmi_rcvmsg (node_p node, item_p item, hook_p lasthook) |
|
static int | nglmi_rcvdata (hook_p hook, item_p item) |
|
static int | nglmi_shutdown (node_p node) |
|
static int | nglmi_disconnect (hook_p hook) |
|
◆ ANNEXA
◆ ANNEXD
◆ DLCI_DOWN
◆ DLCI_NULL
◆ DLCI_UP
◆ GROUP4
◆ LMI_MIN_LENGTH
#define LMI_MIN_LENGTH 8 /* XXX verify */ |
◆ LMI_PATIENCE
#define LMI_PATIENCE 8 /* declare all DLCI DOWN after N LMI failures */ |
◆ LMIPOLLSIZE
◆ MAX_DLCIS
◆ MAXDLCI
◆ NAME_ANNEXA
◆ NAME_ANNEXD
◆ NAME_GROUP4
◆ NAME_NONE
◆ NOPROTO
◆ SCF_ANNEX_A
#define SCF_ANNEX_A 0x08 /* running annex A mode */ |
◆ SCF_ANNEX_D
#define SCF_ANNEX_D 0x10 /* running annex D mode */ |
◆ SCF_AUTO
#define SCF_AUTO 0x02 /* we are auto-detecting */ |
◆ SCF_CONNECTED
#define SCF_CONNECTED 0x01 /* connected to something */ |
◆ SCF_FIXED
#define SCF_FIXED 0x04 /* we are fixed from the start */ |
◆ SCF_GROUP4
#define SCF_GROUP4 0x18 /* running group of 4 */ |
◆ SCF_LMITYPE
#define SCF_LMITYPE 0x18 /* mask for determining Annex mode */ |
◆ SCF_NOLMI
#define SCF_NOLMI 0x00 /* no LMI type selected yet */ |
◆ SETLMITYPE
#define SETLMITYPE |
( |
|
sc, |
|
|
|
annex |
|
) |
| |
Value:do { \
(sc)->
flags |= (annex); \
} while (0)
Definition at line 166 of file ng_lmi.c.
◆ STEPBY
#define STEPBY |
( |
|
stepsize | ) |
|
Value: do { \
packetlen -= (stepsize); \
data += (stepsize); \
} while (0)
Definition at line 542 of file ng_lmi.c.
◆ sc_p
◆ LMI_ticker()
static void LMI_ticker |
( |
node_p |
node, |
|
|
hook_p |
hook, |
|
|
void * |
arg1, |
|
|
int |
arg2 |
|
) |
| |
|
static |
◆ NETGRAPH_INIT()
NETGRAPH_INIT |
( |
lmi |
, |
|
|
& |
typestruct |
|
) |
| |
◆ ngauto_state_machine()
static void ngauto_state_machine |
( |
sc_p |
sc | ) |
|
|
static |
◆ nglmi_checkdata()
static int nglmi_checkdata |
( |
hook_p |
hook, |
|
|
struct mbuf * |
m |
|
) |
| |
|
static |
Definition at line 735 of file ng_lmi.c.
References ANNEXD, data, dlci, GROUP4, NG_FREE_M, NG_HOOK_NODE, NG_NODE_PRIVATE, SCF_ANNEX_A, SCF_ANNEX_D, SCF_AUTO, SCF_GROUP4, SCF_NOLMI, SETLMITYPE, STEPBY, and type.
Referenced by nglmi_rcvdata().
◆ nglmi_constructor()
static int nglmi_constructor |
( |
node_p |
node | ) |
|
|
static |
◆ nglmi_disconnect()
static int nglmi_disconnect |
( |
hook_p |
hook | ) |
|
|
static |
◆ nglmi_inquire()
static void nglmi_inquire |
( |
sc_p |
sc, |
|
|
int |
full |
|
) |
| |
|
static |
Definition at line 311 of file ng_lmi.c.
References ANNEXA, ANNEXD, count, ng_tag_prio::discardability, DLCI_DOWN, DLCI_UP, GROUP4, LMI_PATIENCE, MAXDLCI, NG_PRIO_LINKSTATE, NG_SEND_DATA_ONLY, NG_TAG_PRIO, NGM_GENERIC_COOKIE, ng_tag_prio::priority, and ng_tag_prio::tag.
Referenced by LMI_ticker(), and ngauto_state_machine().
◆ nglmi_newhook()
static int nglmi_newhook |
( |
node_p |
node, |
|
|
hook_p |
hook, |
|
|
const char * |
name |
|
) |
| |
|
static |
Definition at line 205 of file ng_lmi.c.
References name, NAME_ANNEXA, NAME_ANNEXD, NAME_GROUP4, NAME_NONE, NG_HOOK_SET_PRIVATE, NG_LMI_HOOK_ANNEXA, NG_LMI_HOOK_ANNEXD, NG_LMI_HOOK_AUTO0, NG_LMI_HOOK_AUTO1023, NG_LMI_HOOK_DEBUG, NG_LMI_HOOK_GROUPOF4, NG_NODE_PRIVATE, nglmi_startup_auto(), nglmi_startup_fixed(), nglmi_softc::node, SCF_ANNEX_A, SCF_ANNEX_D, SCF_CONNECTED, SCF_GROUP4, and SETLMITYPE.
◆ nglmi_rcvdata()
Definition at line 553 of file ng_lmi.c.
References ANNEXA, ANNEXD, count, data, dlci, DLCI_DOWN, DLCI_UP, GROUP4, nglmistat::hook, MAXDLCI, NAME_ANNEXA, NAME_ANNEXD, NAME_GROUP4, NG_FREE_ITEM, NG_FREE_M, NG_HOOK_NODE, NG_HOOK_PRIVATE, NG_NODE_PRIVATE, NGI_GET_M, nglmi_checkdata(), SCF_AUTO, and STEPBY.
◆ nglmi_rcvmsg()
Definition at line 441 of file ng_lmi.c.
References ng_mesg::ng_msghdr::arglen, nglmistat::autod, ng_mesg::ng_msghdr::cmd, count, ng_mesg::data, DLCI_DOWN, DLCI_UP, nglmistat::fixed, ng_mesg::header, nglmistat::hook, MAXDLCI, NG_FREE_MSG, NG_MKRESPONSE, NG_NODE_PRIVATE, NG_RESPOND_MSG, NG_TEXTRESPONSE, NGI_GET_MSG, NGM_GENERIC_COOKIE, NGM_LMI_COOKIE, NGM_LMI_GET_STATUS, NGM_TEXT_STATUS, nglmistat::proto, SCF_AUTO, SCF_FIXED, nglmistat::seen, ng_mesg::ng_msghdr::typecookie, and nglmistat::up.
◆ nglmi_shutdown()
static int nglmi_shutdown |
( |
node_p |
node | ) |
|
|
static |
◆ nglmi_startup()
static void nglmi_startup |
( |
sc_p |
sc | ) |
|
|
static |
◆ nglmi_startup_auto()
static void nglmi_startup_auto |
( |
sc_p |
sc | ) |
|
|
static |
◆ nglmi_startup_fixed()
static void nglmi_startup_fixed |
( |
sc_p |
sc, |
|
|
hook_p |
hook |
|
) |
| |
|
static |
◆ nglmi_constructor
◆ nglmi_disconnect
◆ nglmi_newhook
◆ nglmi_rcvdata
◆ nglmi_rcvmsg
◆ nglmi_shutdown
◆ typestruct
Initial value:= {
}
static ng_disconnect_t nglmi_disconnect
static ng_shutdown_t nglmi_shutdown
static ng_newhook_t nglmi_newhook
static ng_rcvmsg_t nglmi_rcvmsg
static ng_constructor_t nglmi_constructor
static ng_rcvdata_t nglmi_rcvdata
Definition at line 101 of file ng_lmi.c.