Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

datagram.h

00001 /*
00002 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
00003 Copyright (C) 2005- The University of Notre Dame
00004 This software is distributed under a BSD-style license.
00005 See the file COPYING for details.
00006 */
00007 
00008 #ifndef DATAGRAM_H
00009 #define DATAGRAM_H
00010 
00011 /* Maximum number of characters in a text formatted datagram address.  Note that this must be enough characters to accomodate an IPv6 address. */
00012 #define DATAGRAM_ADDRESS_MAX 48
00013 
00014 /* Maximum number of bytes in a datagram payload */
00015 #define DATAGRAM_PAYLOAD_MAX 65536
00016 
00017 /* The port value for receiving from any process. */
00018 #define DATAGRAM_PORT_ANY 0
00019 
00020 /* The address to send to for broadcasting. */
00021 #define DATAGRAM_ADDRESS_BROADCAST "255.255.255.255"
00022 
00023 struct datagram * datagram_create( int port );
00024 void datagram_delete( struct datagram *d );
00025 
00026 int datagram_recv( struct datagram *d, char *data, int length, char *addr, int *port, int timeout );
00027 int datagram_send( struct datagram *d, const char *data, int length, const char *addr, int port );
00028 int datagram_fd( struct datagram *d );
00029 
00030 #endif

Generated on Thu Jul 23 09:26:51 2009 for cctools by  doxygen 1.3.9.1