• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/netgraph/

Lines Matching defs:tag

311  * Return the location where the next tag can be put
321 * Look for a tag of a specific type.
333 * Keep processing tags while a tag header will still fit.
337 * If the tag data would go past the end of the packet, abort.
341 CTR2(KTR_NET, "%20s: invalid length for tag %d",
346 CTR2(KTR_NET, "%20s: found tag %d", __func__, idx);
353 CTR2(KTR_NET, "%20s: not found tag %d", __func__, idx);
358 * Inlines to initialise or add tags to a session's tag list.
361 * Initialise the session's tag list.
397 const struct pppoe_tag **tag;
408 for (count = 0, tag = sp->neg->tags;
410 tag++, count++) {
411 tlen = ntohs((*tag)->tag_len) + sizeof(**tag);
417 bcopy(*tag, (char *)dp, tlen);
440 pppoe_match_svc(node_p node, const struct pppoe_tag *tag)
457 if (neg->service_len != ntohs(tag->tag_len))
460 if (strncmp((const char *)(tag + 1), neg->service.data,
461 ntohs(tag->tag_len)) == 0)
465 sp?sp->hook:NULL, (const char *)(tag + 1));
473 * tag is received. Client should receive PADOs with all
604 pppoe_finduniq(node_p node, const struct pppoe_tag *tag)
618 if (sp->neg->host_uniq_len == ntohs(tag->tag_len) &&
619 bcmp(sp->neg->host_uniq.data, (const char *)(tag + 1),
629 pppoe_findcookie(node_p node, const struct pppoe_tag *tag)
634 bcopy(tag + 1, cookie.bytes, sizeof(void *));
1146 struct pppoe_tag *tag;
1166 tag = (void *)(&wh->ph + 1);
1167 tag->tag_type = PTT_HURL;
1168 tag->tag_len = htons(ourmsg->data_len);
1169 strncpy((char *)(tag + 1), ourmsg->data, ourmsg->data_len);
1170 m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) +
1172 wh->ph.length = htons(sizeof(*tag) + ourmsg->data_len);
1191 struct pppoe_tag *tag;
1211 tag = (void *)(&wh->ph + 1);
1212 tag->tag_type = PTT_MOTM;
1213 tag->tag_len = htons(ourmsg->data_len);
1214 strncpy((char *)(tag + 1), ourmsg->data, ourmsg->data_len);
1215 m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) +
1217 wh->ph.length = htons(sizeof(*tag) + ourmsg->data_len);
1299 send_acname(sessp sp, const struct pppoe_tag *tag)
1313 tlen = min(NG_HOOKSIZ - 1, ntohs(tag->tag_len));
1314 strncpy(sts->hook, (const char *)(tag + 1), tlen);
1341 send_maxp(sessp sp, const struct pppoe_tag *tag)
1356 maxp->data = ntohs(((const struct maxptag *)tag)->data);
1363 send_hurl(sessp sp, const struct pppoe_tag *tag)
1377 tlen = min(PPPOE_PADM_VALUE_SIZE - 1, ntohs(tag->tag_len));
1378 strncpy(padm->msg, (const char *)(tag + 1), tlen);
1386 send_motm(sessp sp, const struct pppoe_tag *tag)
1400 tlen = min(PPPOE_PADM_VALUE_SIZE - 1, ntohs(tag->tag_len));
1401 strncpy(padm->msg, (const char *)(tag + 1), tlen);
1461 const struct pppoe_tag *tag;
1511 if ((tag = get_tag(ph, PTT_SRV_NAME)))
1512 insert_tag(sp, tag); /* return service */
1516 * then also add a tag for the extra service.
1520 if (((tag == NULL) || (tag->tag_len == 0)) &&
1524 if ((tag = get_tag(ph, PTT_HOST_UNIQ)))
1525 insert_tag(sp, tag); /* returned hostunique */
1564 const struct pppoe_tag *utag = NULL, *tag = NULL;
1600 * We need to try to make sure that the tag area
1654 tag = get_tag(ph, PTT_SRV_NAME);
1655 if (tag == NULL)
1656 tag = &sntag;
1664 sendhook = pppoe_match_svc(node, tag);
1668 ntohs(tag->tag_len) == 0)
1676 * Use the host_uniq tag to find the hook this is in
1711 tag = get_tag(ph, PTT_AC_NAME);
1712 if (!tag) {
1716 if (neg->ac_name_len != htons(tag->tag_len) ||
1718 (const char *)(tag + 1),
1739 if ((tag = get_tag(ph, PTT_AC_COOKIE)))
1740 insert_tag(sp, tag); /* return cookie */
1741 if ((tag = get_tag(ph, PTT_AC_NAME))) {
1742 insert_tag(sp, tag); /* return it */
1743 send_acname(sp, tag);
1745 if ((tag = get_tag(ph, PTT_MAX_PAYL)) &&
1747 insert_tag(sp, tag); /* return it */
1762 * Use the ac_cookie tag to find the
1804 if ((tag = get_tag(ph, PTT_SRV_NAME)))
1805 insert_tag(sp, tag);/* return service */
1806 if ((tag = get_tag(ph, PTT_HOST_UNIQ)))
1807 insert_tag(sp, tag); /* return it */
1841 * Use the host_uniq tag to find the hook this is in
1885 if ((tag = get_tag(ph, PTT_MAX_PAYL)) &&
1887 send_maxp(sp, tag);
1908 if ((tag = get_tag(ph, PTT_HURL)))
1909 send_hurl(sp, tag);
1910 if ((tag = get_tag(ph, PTT_MOTM)))
1911 send_motm(sp, tag);
2041 struct pppoe_tag *tag;
2063 tag = (void *)(&wh->ph + 1);
2064 tag->tag_type = PTT_GEN_ERR;
2065 tag->tag_len = htons((u_int16_t)msglen);
2066 strncpy((char *)(tag + 1), SIGNOFF, msglen);
2067 m->m_pkthdr.len = m->m_len = sizeof(*wh) + sizeof(*tag) +
2069 wh->ph.length = htons(sizeof(*tag) + msglen);
2158 * Keep processing tags while a tag header will still fit.
2164 * If the tag data would go past the end of the packet, abort.