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

vp_attach()

Attach to a Virtual Packet Interface

Synopsis:

#include <net/if_vp.h>

vpid_t vp_attach( int sd, 
                  int type,
                  pid_t inProxy );

Library:

vpack3r.lib, vpack3s.lib

Description:

The vp_attach() function is the first function called when a Virtual Packet Interface (VPI) is used. It calls the TCP/IP stack, obtains and initializes a spare VPI, and returns a unique virtual packet ID (vpid_t).

sd
A TCP/IP stack file descriptor. If -1 is specified, vp_attach() searches the stack itself.
type
One of:
VP_FILTER
Register as an IP filter.
VP_NI
Register a VPI as a network interface.
inProxy
A proxy that's triggered when the stack prepares a packet and sends it out though the VPI.

After successfully attaching to an interface, you can use ioctl() to set up your interface or your IP address.

Returns:

A virtual packet ID, or -1 if an error occurs.

Errors:

EAGAIN
All the interfaces are in use.
EINVAL
Invalid ID inProxy.
ENOMEM
Can't allocate memory.

Classification:

QNX 4

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

vp_detach()


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