src/netio.c File Reference

#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"

Include dependency graph for netio.c:

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


Typedef Documentation

typedef int socklen_t

Definition at line 75 of file netio.c.


Function Documentation

static int pack_netnum ( struct netnum packed,
rdd_count_t  num 
) [static]

Definition at line 88 of file netio.c.

References netnum::hi, netnum::lo, RDD_BADARG, and RDD_OK.

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

static int unpack_netnum ( struct netnum packed,
rdd_count_t num 
) [static]

Definition at line 99 of file netio.c.

References netnum::hi, netnum::lo, RDD_BADARG, and RDD_OK.


Variable Documentation

char copyright[] [static]

Initial value:

"@(#) Copyright (c) 2002\n\
    Netherlands Forensic Institute.  All rights reserved.\n"

Definition at line 39 of file netio.c.

int net_verbose [static]

Definition at line 85 of file netio.c.


Generated on Sun Feb 6 12:36:17 2011 for rdd by  doxygen 1.5.6