Send and receive raw packets.
More...
|
devcall | rawClose (device *devptr) |
|
devcall | rawControl (device *devptr, int func, long arg1, long arg2) |
|
struct raw * | rawDemux (struct netaddr *src, struct netaddr *dst, ushort proto) |
|
devcall | rawInit (device *devptr) |
|
devcall | rawOpen (device *devptr, va_list ap) |
|
devcall | rawRead (device *devptr, void *buf, uint len) |
|
syscall | rawRecv (struct packet *pkt, struct netaddr *src, struct netaddr *dst, ushort proto) |
|
syscall | rawSend (struct raw *rawptr, void *buf, uint len) |
|
devcall | rawWrite (device *devptr, void *buf, uint len) |
|
Send and receive raw packets.
devcall rawClose |
( |
device * |
devptr | ) |
|
Close a raw socket device.
- Parameters
-
devptr | RAW device table entry |
- Returns
- OK if raw socket is closed properly, otherwise SYSERR
devcall rawControl |
( |
device * |
devptr, |
|
|
int |
func, |
|
|
long |
arg1, |
|
|
long |
arg2 |
|
) |
| |
Control function for raw sockets.
- Parameters
-
devptr | RAW device table entry |
func | control function to execute |
arg1 | first argument for the control function |
arg2 | second argument for the control function |
- Returns
- the result of the control function
struct raw* rawDemux |
( |
struct netaddr * |
src, |
|
|
struct netaddr * |
dst, |
|
|
ushort |
proto |
|
) |
| |
Locate the raw socket for a packet
- Parameters
-
src | source IP address of the packet |
dst | destination IP address of the packet |
proto | protocol of the packet |
- Returns
- most completely matched socket, NULL if no match
devcall rawInit |
( |
device * |
devptr | ) |
|
Initialize raw socket structures.
- Parameters
-
devptr | RAW device table entry |
- Returns
- OK if device is initialized
devcall rawOpen |
( |
device * |
devptr, |
|
|
va_list |
ap |
|
) |
| |
Open a raw socket.
- Parameters
-
devptr | RAW device table entry |
ap | 2nd argument is the local IP address 3rd argument is the remote IP address 4th argument is the IP protocol |
- Returns
- OK if raw socket is opened properly, otherwise SYSERR
devcall rawRead |
( |
device * |
devptr, |
|
|
void * |
buf, |
|
|
uint |
len |
|
) |
| |
Read a packet from a raw socket.
- Parameters
-
devptr | pointer to RAW device |
buf | buffer for read packet |
len | size of the buffer |
- Returns
- number of octets read, SYSERR if error occurred
syscall rawRecv |
( |
struct packet * |
pkt, |
|
|
struct netaddr * |
src, |
|
|
struct netaddr * |
dst, |
|
|
ushort |
proto |
|
) |
| |
Process an incoming protocol other than UDP or TCP.
- Parameters
-
pkt | pointer to the incoming packet |
- Returns
- OK if packet was processed succesfully, otherwise SYSERR
syscall rawSend |
( |
struct raw * |
rawptr, |
|
|
void * |
buf, |
|
|
uint |
len |
|
) |
| |
Send an outgoing packet of protocol other than UDP or TCP.
- Parameters
-
rawptr | pointer to the raw socket control block |
buf | buffer to semd |
len | size of the buffer |
- Returns
- OK if packet was sent succesfully, otherwise SYSERR
devcall rawWrite |
( |
device * |
devptr, |
|
|
void * |
buf, |
|
|
uint |
len |
|
) |
| |
Write a packet to a raw socket.
- Parameters
-
devptr | pointer to RAW device |
buf | buffer to write |
len | size of the buffer |
- Returns
- number of octets written, SYSERR if error occurred