src/tcpwriter.c File Reference

#include <stdarg.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 <stdio.h>
#include <sys/un.h>
#include "rdd.h"
#include "writer.h"

Include dependency graph for tcpwriter.c:

Go to the source code of this file.

Data Structures

struct  _RDD_TCP_WRITER

Typedefs

typedef struct _RDD_TCP_WRITER RDD_TCP_WRITER

Functions

static int compare_sockaddr (struct sockaddr *address1, struct sockaddr *address2)
static int compare_sockaddr_in (struct sockaddr_in *address1, struct sockaddr_in *address2)
static int compare_sockaddr_in6 (struct sockaddr_in6 *address1, struct sockaddr_in6 *address2)
static int compare_sockaddr_un (struct sockaddr_un *address1, struct sockaddr_un *address2)
static int compare_writer_address (RDD_WRITER *w, struct addrinfo *address)
static int connect_tcp_writer (RDD_WRITER *w)
static int create_tcp_writer (RDD_WRITER **self)
int rdd_get_address (const char *host, unsigned int port, struct addrinfo **addr)
 Retrieves the addrinfo address for the given host and port.
int rdd_open_tcp_writer (RDD_WRITER **self, const char *host, unsigned int port)
static int set_writer_address (RDD_WRITER *w, struct addrinfo *addr)
static int tcp_close (RDD_WRITER *w)
static int tcp_compare_address (RDD_WRITER *w, struct addrinfo *address, int *result)
static int tcp_write (RDD_WRITER *w, const unsigned char *buf, unsigned nbyte)

Variables

static RDD_WRITE_OPS tcp_write_ops


Typedef Documentation


Function Documentation

static int compare_sockaddr ( struct sockaddr *  address1,
struct sockaddr *  address2 
) [static]

Definition at line 290 of file tcpwriter.c.

References compare_sockaddr_in(), compare_sockaddr_in6(), and compare_sockaddr_un().

Here is the call graph for this function:

static int compare_sockaddr_in ( struct sockaddr_in *  address1,
struct sockaddr_in *  address2 
) [static]

Definition at line 248 of file tcpwriter.c.

static int compare_sockaddr_in6 ( struct sockaddr_in6 *  address1,
struct sockaddr_in6 *  address2 
) [static]

Definition at line 268 of file tcpwriter.c.

static int compare_sockaddr_un ( struct sockaddr_un *  address1,
struct sockaddr_un *  address2 
) [static]

Definition at line 232 of file tcpwriter.c.

static int compare_writer_address ( RDD_WRITER w,
struct addrinfo *  address 
) [static]

Definition at line 319 of file tcpwriter.c.

References _RDD_TCP_WRITER::address, compare_sockaddr(), and _RDD_WRITER::state.

Here is the call graph for this function:

static int connect_tcp_writer ( RDD_WRITER w  )  [static]

Definition at line 143 of file tcpwriter.c.

References _RDD_TCP_WRITER::address, _RDD_TCP_WRITER::parent, RDD_ECONNECT, RDD_OK, rdd_open_fd_writer(), and _RDD_WRITER::state.

Here is the call graph for this function:

static int create_tcp_writer ( RDD_WRITER **  self  )  [static]

Definition at line 78 of file tcpwriter.c.

References _RDD_TCP_WRITER::address, _RDD_TCP_WRITER::parent, RDD_BADARG, rdd_new_writer(), RDD_OK, and _RDD_WRITER::state.

Here is the call graph for this function:

int rdd_get_address ( const char *  host,
unsigned int  port,
struct addrinfo **  addr 
)

Retrieves the addrinfo address for the given host and port.

Parameters:
host the host name
port the port number
addr a pointer to the output address
Returns:
Returns RDD_OK on success.

Definition at line 101 of file tcpwriter.c.

References RDD_BADARG, RDD_ECONNECT, and RDD_OK.

int rdd_open_tcp_writer ( RDD_WRITER **  self,
const char *  host,
unsigned int  port 
)

Definition at line 168 of file tcpwriter.c.

References connect_tcp_writer(), create_tcp_writer(), error(), rdd_get_address(), RDD_OK, rdd_writer_close(), and set_writer_address().

Here is the call graph for this function:

static int set_writer_address ( RDD_WRITER w,
struct addrinfo *  addr 
) [static]

Definition at line 130 of file tcpwriter.c.

References _RDD_TCP_WRITER::address, RDD_BADARG, RDD_OK, and _RDD_WRITER::state.

static int tcp_close ( RDD_WRITER w  )  [static]

Definition at line 213 of file tcpwriter.c.

References _RDD_TCP_WRITER::address, _RDD_TCP_WRITER::parent, RDD_OK, and rdd_writer_close().

Here is the call graph for this function:

static int tcp_compare_address ( RDD_WRITER w,
struct addrinfo *  address,
int *  result 
) [static]

Definition at line 337 of file tcpwriter.c.

References compare_writer_address(), RDD_BADARG, and RDD_OK.

Here is the call graph for this function:

static int tcp_write ( RDD_WRITER w,
const unsigned char *  buf,
unsigned  nbyte 
) [static]

Definition at line 199 of file tcpwriter.c.

References _RDD_TCP_WRITER::parent, RDD_BADARG, RDD_EWRITE, rdd_writer_write(), and _RDD_WRITER::state.

Here is the call graph for this function:


Variable Documentation

Initial value:

Definition at line 66 of file tcpwriter.c.


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