* Start sending queued data out the output hook */
| 681 | * Start sending queued data out the output hook |
| 682 | */ |
| 683 | static int |
| 684 | ng_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 |
no test coverage detected