MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_ppp_bypass

Function ng_ppp_bypass

freebsd/netgraph/ng_ppp.c:890–917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

888}
889
890static int
891ng_ppp_bypass(node_p node, item_p item, uint16_t proto, uint16_t linkNum)
892{
893 const priv_p priv = NG_NODE_PRIVATE(node);
894 uint16_t hdr[2];
895 struct mbuf *m;
896 int error;
897
898 if (priv->hooks[HOOK_INDEX_BYPASS] == NULL) {
899 NG_FREE_ITEM(item);
900 return (ENXIO);
901 }
902
903 /* Add 4-byte bypass header. */
904 hdr[0] = htons(linkNum);
905 hdr[1] = htons(proto);
906
907 NGI_GET_M(item, m);
908 if ((m = ng_ppp_prepend(m, &hdr, 4)) == NULL) {
909 NG_FREE_ITEM(item);
910 return (ENOBUFS);
911 }
912 NGI_M(item) = m;
913
914 /* Send packet out hook. */
915 NG_FWD_ITEM_HOOK(error, item, priv->hooks[HOOK_INDEX_BYPASS]);
916 return (error);
917}
918
919static int
920ng_ppp_proto_recv(node_p node, item_p item, uint16_t proto, uint16_t linkNum)

Callers 4

ng_ppp_proto_recvFunction · 0.85
ng_ppp_comp_recvFunction · 0.85
ng_ppp_crypt_recvFunction · 0.85
ng_ppp_rcvdataFunction · 0.85

Calls 1

ng_ppp_prependFunction · 0.85

Tested by

no test coverage detected