- code cleanup in network and config

- moved packet_t members to private, added getter and setters
This commit is contained in:
Martin Willi
2005-12-06 16:00:07 +00:00
parent 4b41a0d404
commit 2b54748131
28 changed files with 345 additions and 170 deletions
+15 -7
View File
@@ -31,7 +31,7 @@
/**
* @brief Maximum size of a packet.
*
* 3000 Bytes should be sufficient, see IKEv2 draft
* 3000 Bytes should be sufficient, see IKEv2 draft.
*
* @ingroup network
*/
@@ -45,6 +45,13 @@ typedef struct socket_t socket_t;
*
* Receiver reads from here, sender writes to here.
*
* @b Constructors:
* - socket_create()
*
* @todo add IPv6 support
*
* @todo allow listening/sending to multiple sockets, depending on address
*
* @ingroup network
*/
struct socket_t {
@@ -57,8 +64,9 @@ struct socket_t {
*
* @param sock socket_t object to work on
* @param packet pinter gets address from allocated packet_t
* @return FAILED when unable to receive
* SUCCESS when packet successfully received
* @return
* - SUCCESS when packet successfully received
* - FAILED when unable to receive
*/
status_t (*receive) (socket_t *sock, packet_t **packet);
@@ -70,8 +78,9 @@ struct socket_t {
*
* @param sock socket_t object to work on
* @param packet[out] packet_t to send
* @return FAILED when unable to send
* SUCCESS when packet successfully sent
* @return
* - SUCCESS when packet successfully sent
* - FAILED when unable to send
*/
status_t (*send) (socket_t *sock, packet_t *packet);
@@ -81,7 +90,6 @@ struct socket_t {
* close sockets and destroy socket_t object
*
* @param sock socket_t to destroy
* @return SUCCESS
*/
void (*destroy) (socket_t *sock);
};
@@ -93,7 +101,7 @@ struct socket_t {
* on port.
*
* @param port port to bind socket to
* @return the created socket, or NULL on error
* @return socket_t object
*
* @ingroup network
*/