Send a packet to the stack
#include <net/if_vp.h>
int vp_putpkt( vpid_t id,
struct mbuf * m,
void * info );
vpack3r.lib, vpack3s.lib
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.
- 0
- Success. The mbuf chain was successfully sent to the TCP/IP stack.
- -1
- An error occurred.
- EINVAL
- An address in the mbuf chain couldn't be converted to a TCP/IP stack address space.
QNX 4
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
vp_getpkt()