xdasd_net.c File Reference

OpenXDAS network socket management functionality. More...

#include <xdas_base.h>
#include <xdasd.h>
#include "xdasd_filter.h"
#include "xdasd_event.h"
#include "xdasd_list.h"
#include "xdasd_net.h"
#include "xdasd_log.h"
#include <malloc.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <fcntl.h>

Go to the source code of this file.

Data Structures

struct  XDASD_Socket_tag

Defines

#define so_bool_t   int
#define BAD_SOCKET   -1
#define closesocket   close
XDASD socket status field values.
#define SOCKET_UNUSED   0
#define SOCKET_CLOSE   1
#define SOCKET_LISTEN   2
#define STREAM_READ_FIRST   3
#define STREAM_READ   4
#define STREAM_WRITE_FIRST   5
#define STREAM_WRITE   6

Typedefs

typedef struct XDASD_Socket_tag XDASD_Socket

Functions

static XDASD_Socketxdasd_socket_alloc (void)
static void xdasd_socket_free (XDASD_Socket *sock)
static int xdasd_socket_error (void)
static int xdasd_set_nonblocking (sockfd_t fd)
static XDASD_Socketxdasd_create_listen_socket (const char *ipcpath)
static void xdasd_accept (XDASD_Socket *sock)
static int xdasd_net_dispatch (XDASD_Socket *sock)
static void xdasd_write_stream (XDASD_Socket *sock)
static void xdasd_read_stream (XDASD_Socket *sock)
int xdasd_net_init (const char *ipcpath)
 Initialize the inbound socket list.
void xdasd_net_load_fdsets (int *highfd, fd_set *readfds, fd_set *writefds)
 Configures fd_set objects with sockets from a specified socket list.
void xdasd_net_event_handler (int fdcount, fd_set *readfds, fd_set *writefds)
 Scan a set of socket descriptors for connect/read/write indications.
void xdasd_net_exit (void)
 Cleanup xdasd socket list.

Variables

static XDList s_socklist = {0, 0, 0}


Detailed Description

OpenXDAS network socket management functionality.

This module manages all aspects of the local (unix-domain or loopback socket) channel between the instrumentation library and the OpenXDAS daemon. Local channel protocol:

   client  --> (req/function/data)   --> server
   client <--  (ack/ecode/response) <--  server

Author:
John Calcote (jcalcote@novell.com)
Attention:
Please submit patches to http://openxdas.sourceforge.net

Definition in file xdasd_net.c.


Typedef Documentation


Function Documentation

static void xdasd_accept ( XDASD_Socket sock  )  [static]

static XDASD_Socket* xdasd_create_listen_socket ( const char *  ipcpath  )  [static]

static int xdasd_net_dispatch ( XDASD_Socket sock  )  [static]

Todo:
Log an out of memory error in xdasd_net_dispatch.

Todo:
Log a protocol error if req too small in xdasd_net_dispatch.

Todo:
Trace/Log request if tracing enabled in xdasd_net_dispatch.

Todo:
Trace/Log response if tracing enabled in xdasd_net_dispatch.

Definition at line 343 of file xdasd_net.c.

References xdas_buffer_tag::curpos, xdas_buffer_tag::end, int(), OXDAS_MS_PROTOCOL, XDASD_Socket_tag::recvbuf, XDASD_Socket_tag::sendbuf, xdas_buffer_tag::start, xdas_buffer_get_uint32, xdas_buffer_put_uint32, xdas_buffer_realloc(), xdas_elemcount, XDAS_S_FAILURE, xdasd_event_process(), and xdasd_filter_process().

Referenced by xdasd_read_stream().

static void xdasd_read_stream ( XDASD_Socket sock  )  [static]

static int xdasd_set_nonblocking ( sockfd_t  fd  )  [static]

Definition at line 214 of file xdasd_net.c.

References WSAGetLastError.

Referenced by xdasd_accept(), and xdasd_create_listen_socket().

static XDASD_Socket* xdasd_socket_alloc ( void   )  [static]

Definition at line 159 of file xdasd_net.c.

References BAD_SOCKET, XDASD_Socket_tag::fd, and malloc.

Referenced by xdasd_accept(), and xdasd_create_listen_socket().

static int xdasd_socket_error ( void   )  [static]

Definition at line 196 of file xdasd_net.c.

References WSAGetLastError.

Referenced by xdasd_write_stream().

static void xdasd_socket_free ( XDASD_Socket sock  )  [static]

static void xdasd_write_stream ( XDASD_Socket sock  )  [static]


Variable Documentation

XDList s_socklist = {0, 0, 0} [static]

Definition at line 150 of file xdasd_net.c.


Generated on Thu Aug 20 22:33:07 2009 for OpenXDAS by  doxygen 1.5.6