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

Function ng_ppp_rcvdata_decompress

freebsd/netgraph/ng_ppp.c:1188–1212  ·  view source on GitHub ↗

* Receive data on a hook decompress. */

Source from the content-addressed store, hash-verified

1186 * Receive data on a hook decompress.
1187 */
1188static int
1189ng_ppp_rcvdata_decompress(hook_p hook, item_p item)
1190{
1191 const node_p node = NG_HOOK_NODE(hook);
1192 const priv_p priv = NG_NODE_PRIVATE(node);
1193 uint16_t proto;
1194 struct mbuf *m;
1195
1196 if (!priv->conf.enableDecompression) {
1197 NG_FREE_ITEM(item);
1198 return (ENXIO);
1199 }
1200 NGI_GET_M(item, m);
1201 if ((m = ng_ppp_cutproto(m, &proto)) == NULL) {
1202 NG_FREE_ITEM(item);
1203 return (EIO);
1204 }
1205 NGI_M(item) = m;
1206 if (!PROT_VALID(proto)) {
1207 priv->bundleStats.badProtos++;
1208 NG_FREE_ITEM(item);
1209 return (EIO);
1210 }
1211 return (ng_ppp_hcomp_recv(node, item, proto, NG_PPP_BUNDLE_LINKNUM));
1212}
1213
1214/*
1215 * Encryption layer

Callers

nothing calls this directly

Calls 2

ng_ppp_cutprotoFunction · 0.85
ng_ppp_hcomp_recvFunction · 0.85

Tested by

no test coverage detected