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

Function send_acname

freebsd/netgraph/ng_pppoe.c:1298–1319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1296}
1297
1298static int
1299send_acname(sessp sp, const struct pppoe_tag *tag)
1300{
1301 int error, tlen;
1302 struct ng_mesg *msg;
1303 struct ngpppoe_sts *sts;
1304
1305 CTR2(KTR_NET, "%20s: called %d", __func__, sp->Session_ID);
1306
1307 NG_MKMESSAGE(msg, NGM_PPPOE_COOKIE, NGM_PPPOE_ACNAME,
1308 sizeof(struct ngpppoe_sts), M_NOWAIT);
1309 if (msg == NULL)
1310 return (ENOMEM);
1311
1312 sts = (struct ngpppoe_sts *)msg->data;
1313 tlen = min(NG_HOOKSIZ - 1, ntohs(tag->tag_len));
1314 strncpy(sts->hook, (const char *)(tag + 1), tlen);
1315 sts->hook[tlen] = '\0';
1316 NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0);
1317
1318 return (error);
1319}
1320
1321static int
1322send_sessionid(sessp sp)

Callers 1

ng_pppoe_rcvdata_etherFunction · 0.85

Calls 2

minFunction · 0.85
strncpyFunction · 0.85

Tested by

no test coverage detected