#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/un.h>
#include <rpc/types.h>
#include <netdb.h>
#include <errno.h>
#include <fcntl.h>
#include "libmacs.h"
#include "common.h"
Functions | |
_macs_sock * | _new_macs_sock () |
int | _macs_connect (_macs_sock *s) |
int | _macs_do_write (int S, const void *B, int L) |
Function to do actual socket writing. | |
int | _macs_do_read (_macs_sock *s, char **buf, const char *sen, int len) |
int | _macs_do_pings (macs_session *sess, int svc) |
int | _macs_parse_tcp_addr (const char *addr, char **host, long *port) |
Parses address in host:port form. | |
_macs_sock * | _macs_append_sock (_macs_ctx *ctx) |
Appends a new _macs_sock to the list in the given _macs_ctx. | |
int | _macs_add_unix_server (_macs_ctx *ctx, const char *addr) |
int | _macs_add_tcp_server (_macs_ctx *ctx, const char *addr) |
int | _macs_add_server (_macs_ctx *ctx, const char *addr, const _macs_conn_type type) |
int | _macs_connect_sock (macs_session *sess, int svc) |
Establishes a connection to the server. | |
int | _macs_free_socks (_macs_sock **s) |
_macs_sock * | _macs_get_sock (macs_session *sess, int svc) |
int | _macs_do_ping (_macs_sock *s, macs_session *sess, int svc) |
char * | _macs_new_msgid (_macs_sock *s) |
Create a unique identifier. | |
int | _macs_write (_macs_sock *s, const void *morsel, size_t siz, const char *svc, const char *cmd, const macs_session *sess, const char *meth,...) |
int | _macs_read (_macs_sock *s, char **reply[], char **morsel) |
Reads a reply. | |
Variables | |
const char | _macs_socket_c_id [] = "$Id: socket.c,v 1.28 2003/08/06 11:46:22 blake Exp $" |
|
|
|
Connects to the given _macs_sock.
|
|
Function to do actual socket writing.
|
|
Read from the macs_sock until we reach the sentinel, or until we read a certain number of bytes.
|
|
Do raw pings to given svcs.
|
|
Parses address in host:port form.
|
|
Appends a new _macs_sock to the list in the given _macs_ctx.
|
|
Add a unix-socket entry to the _macs_sock list in the given _macs_ctx
|
|
Add a tcp-socket entry to the _macs_sock list in the given _macs_ctx
|
|
Adds a server to the context.
|
|
Establishes a connection to the server.
|
|
Releases memory associated with the sockets.
|
|
Finds a connected _macs_sock from the given list, or connects one.
|
|
Pings a server to test for connectivity.
|
|
Create a unique identifier.
|
|
Write to the _macs_sock
|
|
Reads a reply.
|
|
For use by ident |