cctools
datagram.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2005- The University of Notre Dame
4 This software is distributed under the GNU General Public License.
5 See the file COPYING for details.
6 */
7 
8 #ifndef DATAGRAM_H
9 #define DATAGRAM_H
10 
61 #define DATAGRAM_ADDRESS_MAX 48
62 
64 #define DATAGRAM_PAYLOAD_MAX 65536
65 
67 #define DATAGRAM_PORT_ANY 0
68 
70 #define DATAGRAM_ADDRESS_BROADCAST "255.255.255.255"
71 
76 struct datagram *datagram_create(int port);
77 
81 void datagram_delete(struct datagram *d);
82 
92 int datagram_recv(struct datagram *d, char *data, int length, char *addr, int *port, int timeout);
93 
102 int datagram_send(struct datagram *d, const char *data, int length, const char *addr, int port);
103 
108 int datagram_fd(struct datagram *d);
109 
110 #endif