Make the UDP senddata() methods return a status code.

udp_connect() now follows the standard BSD sockets semantics and simply
sets the default address for outgoing packets; it doesn't filter incoming
packets.
This commit is contained in:
Michael Brown
2006-08-03 23:10:14 +00:00
parent a0a872f7f1
commit ffe0e24249
4 changed files with 19 additions and 36 deletions

View File

@@ -48,6 +48,7 @@ struct udp_operations {
* @v conn UDP connection
* @v buf Temporary data buffer
* @v len Length of temporary data buffer
* @ret rc Return status code
*
* The application may use the temporary data buffer to
* construct the data to be sent. Note that merely filling
@@ -56,8 +57,8 @@ struct udp_operations {
* the buffer is not compulsory; the application may call
* udp_send() on any block of data.
*/
void ( * senddata ) ( struct udp_connection *conn, void *buf,
size_t len );
int ( * senddata ) ( struct udp_connection *conn, void *buf,
size_t len );
/**
* New data received
*
@@ -98,7 +99,6 @@ extern int udp_bind ( struct udp_connection *conn, uint16_t local_port );
extern void udp_bind_promisc ( struct udp_connection *conn );
extern void udp_connect ( struct udp_connection *conn,
struct sockaddr_tcpip *peer );
extern void udp_connect_promisc ( struct udp_connection *conn );
extern int udp_open ( struct udp_connection *conn, uint16_t local_port );
extern void udp_close ( struct udp_connection *conn );