#include "netio.h"
#include "netio_private.h"
#include "berkeleyapi.h"
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include "util.h"
#include "debug.h"
Go to the source code of this file.
Functions | |
errorcode | readMsg (sock_t sd, comm_type_t type, void *buf, int buf_len) |
reads up to buf_len bytes into buf | |
errorcode | checkMsgLen (char *msg, int msg_len) |
checks that an message is as long as the length field says it is | |
errorcode | sendMsg (sock_t sd, long type, void *payload, long payload_len) |
creates a message from the type and payload and sents it |
Definition in file netio.c.
|
checks that an message is as long as the length field says it is
Definition at line 125 of file netio.c. References CHECK_NOT_NEG, COMM_LENGTH_LEN, COMM_TYPE_LEN, ERROR_NEG_ARG_2, ERROR_NULL_ARG_1, and errorcode. Referenced by readMsg(). |
|
|
creates a message from the type and payload and sents it
Definition at line 152 of file netio.c. References CHECK_NOT_NEG, COMM_HEADER_LEN, COMM_LENGTH_LEN, COMM_TYPE_LEN, DBG_NETWORK, DEBUG, ERROR_NEG_ARG_1, ERROR_NEG_ARG_4, errorcode, and safe_free(). Referenced by helper_fsm_buddy_alloc(), helper_fsm_buddy_port(), helper_fsm_conn2(), helper_fsm_end_buddy_bday(), helper_fsm_end_peer_bday(), helper_fsm_hello(), helper_fsm_start_buddy_bday(), helper_fsm_start_direct_conn(), helper_fsm_start_peer_bday(), peer_fsm_bday_synack_flood(), peer_fsm_buddy_alloc(), peer_fsm_check_port_pred(), peer_fsm_conn_again(), peer_fsm_end_bday(), peer_fsm_forge_syn_ack(), peer_fsm_hello(), peer_fsm_reply_bday(), peer_fsm_start_bday(), and peer_fsm_start_direct_conn(). |