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

Function pf_enable_altq

freebsd/netpfil/pf/pf_ioctl.c:754–775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

752}
753
754static int
755pf_enable_altq(struct pf_altq *altq)
756{
757 struct ifnet *ifp;
758 struct tb_profile tb;
759 int error = 0;
760
761 if ((ifp = ifunit(altq->ifname)) == NULL)
762 return (EINVAL);
763
764 if (ifp->if_snd.altq_type != ALTQT_NONE)
765 error = altq_enable(&ifp->if_snd);
766
767 /* set tokenbucket regulator */
768 if (error == 0 && ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) {
769 tb.rate = altq->ifbandwidth;
770 tb.depth = altq->tbrsize;
771 error = tbr_set(&ifp->if_snd, &tb);
772 }
773
774 return (error);
775}
776
777static int
778pf_disable_altq(struct pf_altq *altq)

Callers 2

pf_commit_altqFunction · 0.85
pfioctlFunction · 0.85

Calls 3

ifunitFunction · 0.85
altq_enableFunction · 0.85
tbr_setFunction · 0.85

Tested by

no test coverage detected