GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  UDPREAD (3)

NAME

udpread, udpwrite - read and write UDP packets

CONTENTS

Synopsis
Description
Source
See Also

SYNOPSIS

#include <u.h>

#include <libc.h>

#include <ip.h>


typedef struct Udphdr Udphdr;
struct Udphdr
{
    uchar   raddr[IPaddrlen];/* remote address and port */
    uchar   laddr[IPaddrlen];/* local address and port */
    uchar   rport[2];
    uchar   lport[2];
};

long        udpread(int fd, Udphdr *hdr, void *data, long n)

long udpwrite(int fd, Udphdr *hdr, void *data, long n)

DESCRIPTION

Udpread and udpwrite read and write UDP packets from the UDP network connection established on file descriptor fd.

Udpread reads at most n bytes of packet body into data , stores the header in hdr, and returns the number of bytes stored in data.

Udpwrite writes the n bytes stored in data in a UDP packet with header hdr.

Note that the Udphdr frames the addresses as local and remote instead of source and destination. Thus the hdr filled in for a packet read by udpread can be used unchanged in udpwrite to send a response back to the sender of the original packet.

SOURCE

/usr/local/plan9/src/lib9/udp.c

SEE ALSO

ip(3)
Search for    or go to Top of page |  Section 3 |  Main Index


UDPREAD (3) -->

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.