tools: apply ng_ether_attach_command.diff

This commit is contained in:
Franco Fichtner 2014-11-09 15:44:56 +01:00
parent ab9084b61d
commit 530e648b95
2 changed files with 25 additions and 0 deletions

View file

@ -64,6 +64,10 @@
#include <sys/unistd.h>
#include <machine/cpu.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/netisr.h>
#include <net/vnet.h>
@ -240,6 +244,8 @@ int ng_path_parse(char *addr, char **node, char **path, char **hook);
void ng_rmnode(node_p node, hook_p dummy1, void *dummy2, int dummy3);
void ng_unname(node_p node);
extern void (*ng_ether_attach_p)(struct ifnet *ifp);
/* Our own netgraph malloc type */
MALLOC_DEFINE(M_NETGRAPH, "netgraph", "netgraph structures and ctrl messages");
MALLOC_DEFINE(M_NETGRAPH_MSG, "netgraph_msg", "netgraph name storage");
@ -574,6 +580,13 @@ static const struct ng_cmdlist ng_generic_cmds[] = {
&ng_parse_ng_mesg_type,
&ng_parse_ng_mesg_type
},
{
NGM_GENERIC_COOKIE,
NGM_ETHER_ATTACH,
"attach",
&ng_parse_string_type,
NULL
},
{ 0 }
};
@ -2908,6 +2921,17 @@ ng_generic_msg(node_p here, item_p item, hook_p lasthook)
break;
}
case NGM_ETHER_ATTACH:
{
struct ifnet *ifp;
ifp = ifunit((char *)msg->data);
if (ifp && ng_ether_attach_p != NULL) {
ng_ether_attach_p(ifp);
}
break;
}
case NGM_TEXT_CONFIG:
case NGM_TEXT_STATUS:
/*

View file

@ -138,6 +138,7 @@ enum {
NGM_ASCII2BINARY= (13|NGM_READONLY|NGM_HASREPLY),
/* (optional) Get/set text config. */
NGM_TEXT_CONFIG = 14,
NGM_ETHER_ATTACH = 15,
};
/*