Lines Matching defs:proto
131 nl_verify_proto(int proto)
133 if (proto < 0 || proto >= NL_MAX_HANDLERS) {
136 int handler_defined = nl_handlers[proto].cb != NULL;
141 nl_get_proto_name(int proto)
143 return (nl_handlers[proto].proto_name);
147 netlink_register_proto(int proto, const char *proto_name, nl_handler_f handler)
149 if ((proto < 0) || (proto >= NL_MAX_HANDLERS))
152 KASSERT((nl_handlers[proto].cb == NULL), ("netlink handler %d is already set", proto));
153 nl_handlers[proto].cb = handler;
154 nl_handlers[proto].proto_name = proto_name;
156 NL_LOG(LOG_DEBUG2, "Registered netlink %s(%d) handler", proto_name, proto);
161 netlink_unregister_proto(int proto)
163 if ((proto < 0) || (proto >= NL_MAX_HANDLERS))
166 KASSERT((nl_handlers[proto].cb != NULL), ("netlink handler %d is not set", proto));
167 nl_handlers[proto].cb = NULL;
168 nl_handlers[proto].proto_name = NULL;
170 NL_LOG(LOG_DEBUG2, "Unregistered netlink proto %d handler", proto);