/branches/network/uspace/srv/net/tl/udp/udp_module.h |
---|
31,6 → 31,8 |
*/ |
/** @file |
* UDP module functions. |
* The functions are used as UDP module entry points. |
*/ |
#ifndef __NET_UDP_MODULE_H__ |
39,7 → 41,23 |
#include <async.h> |
#include <ipc/ipc.h> |
/** Initializes the UDP module. |
* @param client_connection The client connection processing function. The module skeleton propagates its own one. Input parameter. |
* @returns EOK on success. |
* @returns ENOMEM if there is not enough memory left. |
*/ |
int udp_initialize( async_client_conn_t client_connection ); |
/** Processes the UDP message. |
* @param callid The message identifier. Input parameter. |
* @param call The message parameters. Input parameter. |
* @param answer The message answer parameters. Output parameter. |
* @param answer_count The last parameter for the actual answer in the answer parameter. Output parameter. |
* @returns EOK on success. |
* @returns ENOTSUP if the message is not known. |
* @see udp_interface.h |
* @see IS_NET_UDP_MESSAGE() |
*/ |
int udp_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ); |
#endif |
/branches/network/uspace/srv/net/tl/udp/udp_header.h |
---|
31,7 → 31,7 |
*/ |
/** @file |
* User datagram protocol header and options definitions. |
* UDP header definition. |
* Names according to the linux src/include/linux/udp.h header file. |
*/ |
/branches/network/uspace/srv/net/tl/udp/udp.h |
---|
31,6 → 31,7 |
*/ |
/** @file |
* UDP module. |
*/ |
#ifndef __NET_UDP_H__ |
40,17 → 41,40 |
#include "../../socket/socket_core.h" |
/** Type definition of the UDP global data. |
* @see udp_globals |
*/ |
typedef struct udp_globals udp_globals_t; |
/** UDP global data. |
*/ |
struct udp_globals{ |
/** IP module phone. |
*/ |
int ip_phone; |
size_t addr_len; |
/** Reserved packet prefix length. |
*/ |
size_t prefix; |
/** Maximal packet content length. |
*/ |
size_t content; |
/** Reserved packet suffix length. |
*/ |
size_t suffix; |
/** Packet address length. |
*/ |
size_t addr_len; |
/** Networking module phone. |
*/ |
int net_phone; |
/** Last used free port. |
*/ |
int last_used_port; |
/** Active sockets. |
*/ |
socket_ports_t sockets; |
/** Safety lock. |
*/ |
fibril_rwlock_t lock; |
}; |
/branches/network/uspace/srv/net/tl/udp/udp_module.c |
---|
31,6 → 31,10 |
*/ |
/** @file |
* UDP standalone module implementation. |
* Contains skeleton module functions mapping. |
* The functions are used by the module skeleton as module specific entry points. |
* @see module.c |
*/ |
#include <async.h> |
49,12 → 53,36 |
#include "udp.h" |
#include "udp_module.h" |
/** UDP module name. |
*/ |
#define NAME "UDP protocol" |
/** Prints the module name. |
* @see NAME |
*/ |
void module_print_name( void ); |
/** Starts the UDP module. |
* Initializes the client connection serving function, initializes the module, registers the module service and starts the async manager, processing IPC messages in an infinite loop. |
* @param client_connection The client connection processing function. The module skeleton propagates its own one. Input parameter. |
* @returns EOK on successful module termination. |
* @returns Other error codes as defined for the arp_initialize() function. |
* @returns Other error codes as defined for the REGISTER_ME() macro function. |
*/ |
int module_start( async_client_conn_t client_connection ); |
/** Processes the UDP message. |
* @param callid The message identifier. Input parameter. |
* @param call The message parameters. Input parameter. |
* @param answer The message answer parameters. Output parameter. |
* @param answer_count The last parameter for the actual answer in the answer parameter. Output parameter. |
* @returns EOK on success. |
* @returns Other error codes as defined for the udp_message() function. |
*/ |
int module_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ); |
/** UDP module global data. |
*/ |
extern udp_globals_t udp_globals; |
void module_print_name( void ){ |