#include <sys/param.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/kernel.h>
#include <sys/socket.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/syslog.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/ng_parse.h>
#include <netgraph/ng_cisco.h>
Go to the source code of this file.
|
static int | cisco_input (sc_p sc, item_p item) |
|
static void | cisco_keepalive (node_p node, hook_p hook, void *arg1, int arg2) |
|
static int | cisco_send (sc_p sc, int type, long par1, long par2) |
|
static void | cisco_notify (sc_p sc, uint32_t cmd) |
|
| NETGRAPH_INIT (cisco, &typestruct) |
|
static int | cisco_constructor (node_p node) |
|
static int | cisco_newhook (node_p node, hook_p hook, const char *name) |
|
static int | cisco_rcvmsg (node_p node, item_p item, hook_p lasthook) |
|
static int | cisco_rcvdata (hook_p hook, item_p item) |
|
static int | cisco_shutdown (node_p node) |
|
static int | cisco_disconnect (hook_p hook) |
|
◆ CISCO_ADDR_REPLY
#define CISCO_ADDR_REPLY 1 /* Cisco address reply */ |
◆ CISCO_ADDR_REQ
#define CISCO_ADDR_REQ 0 /* Cisco address request */ |
◆ CISCO_HEADER_LEN
◆ CISCO_KEEPALIVE
#define CISCO_KEEPALIVE 0x8035 /* Cisco keepalive protocol */ |
◆ CISCO_KEEPALIVE_REQ
#define CISCO_KEEPALIVE_REQ 2 /* Cisco keepalive request */ |
◆ CISCO_MULTICAST
#define CISCO_MULTICAST 0x8f /* Cisco multicast address */ |
◆ CISCO_PACKET_LEN
◆ CISCO_UNICAST
#define CISCO_UNICAST 0x0f /* Cisco unicast address */ |
◆ KEEPALIVE_SECS
#define KEEPALIVE_SECS 10 |
◆ sc_p
◆ cisco_constructor()
static int cisco_constructor |
( |
node_p |
node | ) |
|
|
static |
◆ cisco_disconnect()
static int cisco_disconnect |
( |
hook_p |
hook | ) |
|
|
static |
◆ cisco_input()
Definition at line 439 of file ng_cisco.c.
References cisco_header::address, CISCO_ADDR_REPLY, CISCO_ADDR_REQ, CISCO_KEEPALIVE, CISCO_KEEPALIVE_REQ, CISCO_MULTICAST, cisco_notify(), cisco_send(), CISCO_UNICAST, protoent::hook, NG_FREE_ITEM, NG_FWD_NEW_DATA, NG_MKMESSAGE, NG_SEND_MSG_HOOK, NGI_M, NGM_CISCO_COOKIE, NGM_CISCO_GET_IPADDR, NGM_LINK_IS_UP, ng_async_private::node, cisco_packet::par1, cisco_packet::par2, cisco_header::protocol, and cisco_packet::type.
Referenced by cisco_rcvdata().
◆ cisco_keepalive()
static void cisco_keepalive |
( |
node_p |
node, |
|
|
hook_p |
hook, |
|
|
void * |
arg1, |
|
|
int |
arg2 |
|
) |
| |
|
static |
◆ cisco_newhook()
static int cisco_newhook |
( |
node_p |
node, |
|
|
hook_p |
hook, |
|
|
const char * |
name |
|
) |
| |
|
static |
Definition at line 210 of file ng_cisco.c.
References cisco_keepalive(), KEEPALIVE_SECS, name, ng_callout(), NG_CISCO_HOOK_APPLETALK, NG_CISCO_HOOK_DEBUG, NG_CISCO_HOOK_DOWNSTREAM, NG_CISCO_HOOK_INET, NG_CISCO_HOOK_INET6, NG_CISCO_HOOK_IPX, NG_HOOK_SET_PRIVATE, and NG_NODE_PRIVATE.
◆ cisco_notify()
static void cisco_notify |
( |
sc_p |
sc, |
|
|
uint32_t |
cmd |
|
) |
| |
|
static |
◆ cisco_rcvdata()
Definition at line 340 of file ng_cisco.c.
References cisco_header::address, protoent::af, CISCO_HEADER_LEN, cisco_input(), CISCO_UNICAST, cisco_header::control, NG_FREE_ITEM, NG_FWD_NEW_DATA, NG_HOOK_NODE, NG_HOOK_PRIVATE, NG_NODE_PRIVATE, NGI_GET_M, NGI_M, and cisco_header::protocol.
◆ cisco_rcvmsg()
Definition at line 244 of file ng_cisco.c.
References ng_mesg::ng_msghdr::arglen, ng_mesg::ng_msghdr::cmd, ng_mesg::data, ng_mesg::ng_msghdr::flags, ng_mesg::header, KEEPALIVE_SECS, ng_cisco_stats::keepAlivePeriod, NG_FREE_MSG, NG_MKRESPONSE, NG_NODE_PRIVATE, NG_RESPOND_MSG, NG_TEXTRESPONSE, NGF_RESP, NGI_GET_MSG, NGM_CISCO_COOKIE, NGM_CISCO_GET_IPADDR, NGM_CISCO_GET_STATUS, NGM_CISCO_SET_IPADDR, NGM_GENERIC_COOKIE, NGM_TEXT_STATUS, ng_cisco_stats::seqRetries, and ng_mesg::ng_msghdr::typecookie.
◆ cisco_send()
static int cisco_send |
( |
sc_p |
sc, |
|
|
int |
type, |
|
|
long |
par1, |
|
|
long |
par2 |
|
) |
| |
|
static |
Definition at line 594 of file ng_cisco.c.
References cisco_header::address, CISCO_HEADER_LEN, CISCO_KEEPALIVE, CISCO_MULTICAST, CISCO_PACKET_LEN, cisco_header::control, NG_SEND_DATA_ONLY, cisco_packet::par1, cisco_packet::par2, cisco_header::protocol, cisco_packet::rel, cisco_packet::time0, cisco_packet::time1, type, and cisco_packet::type.
Referenced by cisco_input(), and cisco_keepalive().
◆ cisco_shutdown()
static int cisco_shutdown |
( |
node_p |
node | ) |
|
|
static |
◆ NETGRAPH_INIT()
NETGRAPH_INIT |
( |
cisco |
, |
|
|
& |
typestruct |
|
) |
| |
◆ __packed
◆ cisco_constructor
◆ cisco_disconnect
◆ cisco_newhook
◆ cisco_rcvdata
◆ cisco_rcvmsg
◆ cisco_shutdown
◆ ng_cisco_cmdlist
Initial value:= {
{
"setipaddr",
NULL
},
{
"getipaddr",
NULL,
},
{
"getstats",
NULL,
},
{ 0 }
}
static const struct ng_parse_type ng_cisco_stats_type
static const struct ng_parse_type ng_cisco_ipaddr_type
Definition at line 144 of file ng_cisco.c.
◆ ng_cisco_ipaddr_type
Initial value:= {
}
static const struct ng_parse_struct_field ng_cisco_ipaddr_type_fields[]
const struct ng_parse_type ng_parse_struct_type
Definition at line 130 of file ng_cisco.c.
◆ ng_cisco_ipaddr_type_fields
◆ ng_cisco_stats_type
Initial value:= {
}
static const struct ng_parse_struct_field ng_cisco_stats_type_fields[]
Definition at line 138 of file ng_cisco.c.
◆ ng_cisco_stats_type_fields
◆ typestruct
Initial value:= {
}
static const struct ng_cmdlist ng_cisco_cmdlist[]
static ng_shutdown_t cisco_shutdown
static ng_newhook_t cisco_newhook
static ng_rcvdata_t cisco_rcvdata
static ng_constructor_t cisco_constructor
static ng_disconnect_t cisco_disconnect
static ng_rcvmsg_t cisco_rcvmsg
#define NG_CISCO_NODE_TYPE
Definition at line 170 of file ng_cisco.c.