+static clib_error_t *
+punt_socket_register_ip_proto (vlib_main_t * vm,
+ ip_address_family_t af,
+ ip_protocol_t proto, char *client_pathname)
+{
+ punt_main_t *pm = &punt_main;
+ punt_client_t *c;
+
+ c = punt_client_ip_proto_get (af, proto);
+
+ if (NULL == c)
+ {
+ pool_get_zero (pm->punt_client_pool, c);
+ punt_client_ip_proto_db_add (af, proto, c - pm->punt_client_pool);
+ }
+
+ memcpy (c->caddr.sun_path, client_pathname, sizeof (c->caddr.sun_path));
+ c->caddr.sun_family = AF_UNIX;
+ c->reg.type = PUNT_TYPE_IP_PROTO;
+ c->reg.punt.ip_proto.protocol = proto;
+ c->reg.punt.ip_proto.af = af;
+
+ if (af == AF_IP4)
+ ip4_register_protocol (proto, ip4_proto_punt_socket_node.index);
+ else
+ ip6_register_protocol (proto, ip6_proto_punt_socket_node.index);
+
+ return (NULL);
+}
+