* Node type constructor * The NODE part is assumed to be all set up. * There is already a reference to the node for us. */
| 510 | * There is already a reference to the node for us. |
| 511 | */ |
| 512 | static int |
| 513 | ng_ksocket_constructor(node_p node) |
| 514 | { |
| 515 | priv_p priv; |
| 516 | |
| 517 | /* Allocate private structure */ |
| 518 | priv = malloc(sizeof(*priv), M_NETGRAPH_KSOCKET, M_NOWAIT | M_ZERO); |
| 519 | if (priv == NULL) |
| 520 | return (ENOMEM); |
| 521 | |
| 522 | LIST_INIT(&priv->embryos); |
| 523 | /* cross link them */ |
| 524 | priv->node = node; |
| 525 | NG_NODE_SET_PRIVATE(node, priv); |
| 526 | |
| 527 | /* Done */ |
| 528 | return (0); |
| 529 | } |
| 530 | |
| 531 | /* |
| 532 | * Give our OK for a hook to be added. The hook name is of the |
no test coverage detected