[Previous] [Contents] [Index] [Next]

vp_putpkt()

Send a packet to the stack

Synopsis:

#include <net/if_vp.h>

int vp_putpkt( vpid_t id,
               struct mbuf * m, 
               void * info );

Library:

vpack3r.lib, vpack3s.lib

Description:

The vp_putpkt() function does the opposite of vp_getpkt(): it sends a packet to the stack. The mbuf chain must contain IP packets only. All addresses in the chain are converted to TCP/IP stack address spaces so your application doesn't need to worry about them.

id
A virtual packet ID returned by vp_attach().
info
For a network interface, info is ignored. For an IP filter, info points to struct flt_pktinfo.

struct flt_pktinfo
{
    short flag;
    char ifname[IFNAMSIZ];
    struct timeval tstamp;
};
       
flag
PACKET_INPUT treats the packet as inbound, PACKET_OUTPUT treats it as outbound. PACKET_FAST tells the TCP/IP stack not to pass the packet to any further filters and to process the packet (as inbound or outbound).
ifname
The original interface name where the packet came from (inbound) or is going to (outbound). Ignored by the TCP/IP stack, changing ifname is useful to other IP filters only.
tstamp
The timestamp recorded by the stack indicates the first time a packet entered the stack.

Caution:

Any mbuf chain sent to the stack must first be allocated by one of: vp_mclget(), vp_mfree(), vp_mfreem(), vp_mget(), vp_mgethdr().


Returns:

0
Success. The mbuf chain was successfully sent to the TCP/IP stack.
-1
An error occurred.

Errors:

EINVAL
An address in the mbuf chain couldn't be converted to a TCP/IP stack address space.

Classification:

QNX 4

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

vp_getpkt()


[Previous] [Contents] [Index] [Next]