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

Function lltable_calc_llheader

freebsd/net/if_llatbl.c:365–387  ·  view source on GitHub ↗

* Helper function used to pre-compute full/partial link-layer * header data suitable for feeding into if_output(). */

Source from the content-addressed store, hash-verified

363 * header data suitable for feeding into if_output().
364 */
365int
366lltable_calc_llheader(struct ifnet *ifp, int family, char *lladdr,
367 char *buf, size_t *bufsize, int *lladdr_off)
368{
369 struct if_encap_req ereq;
370 int error;
371
372 bzero(buf, *bufsize);
373 bzero(&ereq, sizeof(ereq));
374 ereq.buf = buf;
375 ereq.bufsize = *bufsize;
376 ereq.rtype = IFENCAP_LL;
377 ereq.family = family;
378 ereq.lladdr = lladdr;
379 ereq.lladdr_len = ifp->if_addrlen;
380 error = ifp->if_requestencap(ifp, &ereq);
381 if (error == 0) {
382 *bufsize = ereq.bufsize;
383 *lladdr_off = ereq.lladdr_off;
384 }
385
386 return (error);
387}
388
389/*
390 * Update link-layer header for given @lle after

Callers 8

in_arpinputFunction · 0.85
arp_check_update_lleFunction · 0.85
in_lltable_allocFunction · 0.85
in6_lltable_allocFunction · 0.85
nd6_cache_lladdrFunction · 0.85
nd6_na_inputFunction · 0.85
llentry_update_ifaddrFunction · 0.85
lla_rt_outputFunction · 0.85

Calls 1

bzeroFunction · 0.85

Tested by

no test coverage detected