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

Function ng_source_start

freebsd/netgraph/ng_source.c:683–705  ·  view source on GitHub ↗

* Start sending queued data out the output hook */

Source from the content-addressed store, hash-verified

681 * Start sending queued data out the output hook
682 */
683static int
684ng_source_start(sc_p sc, uint64_t packets)
685{
686 if (sc->output_ifp == NULL && sc->stats.maxPps == 0) {
687 printf("ng_source: start without iface or pps configured\n");
688 return (ENXIO);
689 }
690
691 if (sc->node->nd_flags & NG_SOURCE_ACTIVE)
692 return (EBUSY);
693
694 sc->node->nd_flags |= NG_SOURCE_ACTIVE;
695
696 sc->packets = packets;
697 timevalclear(&sc->stats.elapsedTime);
698 timevalclear(&sc->stats.endTime);
699 getmicrotime(&sc->stats.startTime);
700 getmicrotime(&sc->stats.lastTime);
701 ng_callout(&sc->intr_ch, sc->node, NULL, 0,
702 ng_source_intr, sc, 0);
703
704 return (0);
705}
706
707/*
708 * Stop sending queued data out the output hook

Callers 1

ng_source_rcvmsgFunction · 0.85

Calls 3

getmicrotimeFunction · 0.85
ng_calloutFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected