#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include "rdd.h"
#include "rdd_internals.h"
#include "error.h"
#include "msgprinter.h"
#include "reader.h"
#include "writer.h"
#include "netio.h"
Go to the source code of this file.
Data Structures | |
struct | netnum |
Typedefs | |
typedef int | socklen_t |
Functions | |
static int | pack_netnum (struct netnum *packed, rdd_count_t num) |
int | rdd_await_connection (RDD_MSGPRINTER *printer, int server_sock, int *client_sock) |
int | rdd_init_server (RDD_MSGPRINTER *printer, unsigned int port, int *server_sock) |
int | rdd_recv_info (RDD_READER *reader, char **file_name, rdd_count_t *file_size, rdd_count_t *block_size, rdd_count_t *split_size, int *ewf, unsigned *flagp) |
int | rdd_send_info (RDD_WRITER *writer, char *file_name, rdd_count_t file_size, rdd_count_t block_size, rdd_count_t split_size, int ewf, unsigned flags) |
static int | receive (RDD_READER *reader, unsigned char *buf, unsigned buflen) |
static int | unpack_netnum (struct netnum *packed, rdd_count_t *num) |
Variables | |
static char | copyright [] |
static int | net_verbose |
static int pack_netnum | ( | struct netnum * | packed, | |
rdd_count_t | num | |||
) | [static] |
int rdd_await_connection | ( | RDD_MSGPRINTER * | printer, | |
int | server_sock, | |||
int * | client_sock | |||
) |
Definition at line 382 of file netio.c.
References error(), net_verbose, RDD_BADARG, RDD_EOPEN, rdd_mp_message(), rdd_mp_unixmsg(), RDD_MSG_ERROR, RDD_MSG_INFO, and RDD_OK.
int rdd_init_server | ( | RDD_MSGPRINTER * | printer, | |
unsigned int | port, | |||
int * | server_sock | |||
) |
Definition at line 326 of file netio.c.
References error(), RDD_BADARG, RDD_EOPEN, rdd_mp_unixmsg(), RDD_MSG_ERROR, and RDD_OK.
int rdd_recv_info | ( | RDD_READER * | reader, | |
char ** | file_name, | |||
rdd_count_t * | file_size, | |||
rdd_count_t * | block_size, | |||
rdd_count_t * | split_size, | |||
int * | ewf, | |||
unsigned * | flagp | |||
) |
Definition at line 225 of file netio.c.
References RDD_BADARG, RDD_ERANGE, RDD_ESYNTAX, RDD_MAX_FILENAMESIZE, RDD_NOMEM, RDD_OK, receive(), and unpack_netnum().
int rdd_send_info | ( | RDD_WRITER * | writer, | |
char * | file_name, | |||
rdd_count_t | file_size, | |||
rdd_count_t | block_size, | |||
rdd_count_t | split_size, | |||
int | ewf, | |||
unsigned | flags | |||
) |
Definition at line 129 of file netio.c.
References pack_netnum(), RDD_BADARG, RDD_ERANGE, RDD_MAX_FILENAMESIZE, RDD_OK, and rdd_writer_write().
static int receive | ( | RDD_READER * | reader, | |
unsigned char * | buf, | |||
unsigned | buflen | |||
) | [static] |
Definition at line 196 of file netio.c.
References RDD_BADARG, RDD_ESYNTAX, RDD_OK, and rdd_reader_read().
static int unpack_netnum | ( | struct netnum * | packed, | |
rdd_count_t * | num | |||
) | [static] |
char copyright[] [static] |
int net_verbose [static] |