Example #1
0
/*
 * demand_unblock - set each enabled network protocol to pass packets.
 */
void
demand_unblock(void)
{
    int i;
    struct protent *protp;

    for (i = 0; (protp = protocols[i]) != NULL; ++i)
	if (protp->enabled_flag && protp->demand_conf != NULL)
	    sifnpmode(0, protp->protocol & ~0x8000, NPMODE_PASS);
}
/*
 * demand_unblock - set each enabled network protocol to pass packets.
 */
void
demand_unblock()
{
    int i;
    const struct protent *protp;

    for (i = 0; (protp = protocols[i]) != NULL; ++i)
	if (protp->demand_conf != NULL)
	    sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS);
}
Example #3
0
/*
 * demand_block - set each network protocol to block further packets.
 */
void
demand_block(void)
{
    int i;
    struct protent *protp;

    for (i = 0; (protp = protocols[i]) != NULL; ++i)
	if (protp->enabled_flag && protp->demand_conf != NULL)
	    sifnpmode(0, protp->protocol & ~0x8000, NPMODE_QUEUE);
    get_loop_output();
}
/*
 * demand_block - set each network protocol to block further packets.
 */
void
demand_block()
{
    int i;
    const struct protent *protp;

    for (i = 0; (protp = protocols[i]) != NULL; ++i)
	if (protp->demand_conf != NULL)
	    sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE);
    get_loop_output();
}
Example #5
0
/*
 * demand_discard - set each network protocol to discard packets
 * with an error.
 */
void
demand_discard(void)
{
    struct packet *pkt, *nextpkt;
    int i;
    struct protent *protp;

    for (i = 0; (protp = protocols[i]) != NULL; ++i)
	if (protp->enabled_flag && protp->demand_conf != NULL)
	    sifnpmode(0, protp->protocol & ~0x8000, NPMODE_ERROR);
    get_loop_output();

    /* discard all saved packets */
    for (pkt = pend_q; pkt != NULL; pkt = nextpkt) {
	nextpkt = pkt->next;
	free(pkt);
    }
    pend_q = NULL;
    framelen = 0;
    flush_flag = 0;
    escape_flag = 0;
    fcs = PPP_INITFCS;
}