diff options
author | Ruslan Ermilov <ru@FreeBSD.org> | 2004-03-07 23:00:44 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@FreeBSD.org> | 2004-03-07 23:00:44 +0000 |
commit | 1164db57e40de8efae073eba01ba85bb26ae5a8d (patch) | |
tree | a8def910e7ab0c280b72a24183328b78ed465d00 /sys/netgraph/ng_iface.c | |
parent | 8c423a998e0c87de5060fffedc42871d14c3ea63 (diff) | |
download | src-1164db57e40de8efae073eba01ba85bb26ae5a8d.tar.gz src-1164db57e40de8efae073eba01ba85bb26ae5a8d.zip |
Implemented the "getifindex" control message.
PR: kern/63864
Submitted by: Gleb Smirnoff
Notes
Notes:
svn path=/head/; revision=126730
Diffstat (limited to 'sys/netgraph/ng_iface.c')
-rw-r--r-- | sys/netgraph/ng_iface.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 430e0e650155..38845fc33298 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -186,6 +186,13 @@ static const struct ng_cmdlist ng_iface_cmds[] = { NULL, &ng_cisco_ipaddr_type }, + { + NGM_IFACE_COOKIE, + NGM_IFACE_GET_IFINDEX, + "getifindex", + NULL, + &ng_parse_uint32_type + }, { 0 } }; @@ -667,6 +674,15 @@ ng_iface_rcvmsg(node_p node, item_p item, hook_p lasthook) break; } + case NGM_IFACE_GET_IFINDEX: + NG_MKRESPONSE(resp, msg, sizeof(uint32_t), M_NOWAIT); + if (resp == NULL) { + error = ENOMEM; + break; + } + *((uint32_t *)resp->data) = priv->ifp->if_index; + break; + default: error = EINVAL; break; |