#include <nsutil.h>
#include <sys/types.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
Go to the source code of this file.
Data Structures | |
struct | InputBuffer |
struct | OutputBuffer |
Defines | |
#define | CHUNKSIZE 256 |
#define | DEFAULTPORT 8336 |
#define | DEFAULTHOST "localhost" |
#define | MAXCLIENTS 16 |
#define | sock_t int |
#define | rsockaddr_t struct sockaddr_in |
Typedefs | |
typedef hostent * | hostent_t |
Functions | |
sock_t | rsocket (void) |
int | readline (sock_t fd, char *vptr, size_t maxlen, struct InputBuffer *ib) |
const char * | stringifyErrorCode (int code) |
int | rbindAll (sock_t sock_fd) |
int | writeBytes (sock_t con, const char *buf, int size, struct OutputBuffer *ob) |
int | writeString (sock_t con, const char *buf, struct OutputBuffer *ob) |
int | rconnectName (sock_t sock_fd, const char *hostname, unsigned short portno) |
int | rinitNetworking (void) |
sock_t | raccept (sock_t sock_fd) |
void | setblocking (sock_t sock_fd) |
void | setnonblocking (sock_t sock_fd) |
void | rshutdown (sock_t fd) |
int | getResponseCode (sock_t sock_fd, struct InputBuffer *) |
Returns 1 if EOF. | |
int | getOK (sock_t sock_fd, struct InputBuffer *) |
int | rrecv (sock_t fd, char *read_buf, size_t count) |
void | initInputBuffer (struct InputBuffer *ib) |
void | initOutputBuffer (struct OutputBuffer *ob) |
int | isEOF (sock_t con, const struct InputBuffer *ib) |
int | inputBufferEmpty (const struct InputBuffer *ib) |
int | my_read (sock_t fd, char *ptr, size_t maxlen, struct InputBuffer *) |
size_t | readlinebuf (void **vptrptr, struct InputBuffer *) |
size_t | writen (sock_t fd, const void *vptr, size_t len, struct OutputBuffer *ob) |
size_t | readn (sock_t fd, void *vptr, size_t len, struct InputBuffer *ib) |
int | rselect (sock_t max_fd, fd_set *read, fd_set *write, fd_set *err) |
int | rselect_timed (sock_t max_fd, fd_set *toread, fd_set *towrite, fd_set *toerr, struct timeval *tv) |
int | findFdIndex (sock_t fd) |
Searches for a given socket fd in the handler table, fdTable, returning index or -1 if not found. |
|
|
|
Definition at line 33 of file nsnet.h. Referenced by main(), and printHelp(). |
|
Definition at line 32 of file nsnet.h. Referenced by main(), printHelp(), and rbindAll(). |
|
Definition at line 34 of file nsnet.h. Referenced by attemptBind(), and rbindAll(). |
|
Definition at line 53 of file nsnet.h. Referenced by attemptBind(), attemptConnect(), raccept(), rbindAll(), and rconnectName(). |
|
Definition at line 52 of file nsnet.h. Referenced by attemptBind(), attemptConnect(), main(), raccept(), rsocket(), and waitForNetEvent(). |
|
Definition at line 51 of file nsnet.h. Referenced by rconnectName(). |
|
Searches for a given socket fd in the handler table, fdTable, returning index or -1 if not found. Searches fdTable for the given fd in the array. Returns index if found.
Definition at line 575 of file nsnet.c. References FDHandlerEntry::fd, fdTable, and handlerCount. Referenced by handleReads(), removeFdHandler(), and setFdHandler(). |
|
Definition at line 464 of file nsnet.c. References getResponseCode(), ib, rprintf(), and sock_fd. Referenced by main(). |
|
Returns 1 if EOF.
Definition at line 482 of file nsnet.c. References ib, isEOF(), MAXLEN, readline(), and sock_fd. |
|
Definition at line 362 of file nsnet.c. References ib. Referenced by makeNewClient(). |
|
Definition at line 357 of file nsnet.c. References ob. Referenced by makeNewClient(). |
|
Definition at line 459 of file nsnet.c. References ib, and InputBuffer::read_cnt. Referenced by main(). |
|
Definition at line 76 of file nsnet.c. References ib, and InputBuffer::isEOF. Referenced by getResponseCode(), idleHandler(), and main(). |
|
Definition at line 367 of file nsnet.c. References addCount(), ib, InputBuffer::isEOF, monitorLog(), NUM_MYREAD, PLACE_MYREAD, InputBuffer::read_buf, InputBuffer::read_cnt, InputBuffer::read_ptr, rprintf(), rrecv(), and showCounts(). Referenced by main(), and readline(). |
|
Definition at line 285 of file nsnet.c. References rprintf(), rsockaddr_t, sock_fd, sock_t, and stringifyErrorCode(). Referenced by main(). |
|
Definition at line 213 of file nsnet.c. References DEFAULTPORT, MAXCLIENTS, rexit(), rprintf(), rsockaddr_t, and sock_fd. Referenced by main(). |
|
Definition at line 244 of file nsnet.c. References hostent_t, monitorLog(), PLACE_CONNECT, rexit(), rprintf(), rsleep(), rsockaddr_t, and sock_fd. Referenced by main(). |
|
Definition at line 529 of file nsnet.c. References addCount(), ib, my_read(), NUM_READLINE, setblocking(), and showCounts(). Referenced by getResponseCode(), idleHandler(), and main(). |
|
Definition at line 452 of file nsnet.c. References ib, InputBuffer::read_cnt, and InputBuffer::read_ptr. |
|
Definition at line 409 of file nsnet.c. References addCount(), NUM_READN, and showCounts(). |
|
Definition at line 198 of file nsnet.c. References sigPIPEHandler(). Referenced by main(). |
|
Definition at line 315 of file nsnet.c. References monitorLog(), and PLACE_RRECV. Referenced by handleReads(), and my_read(). |
|
Definition at line 512 of file nsnet.c. References max_fd, monitorLog(), and PLACE_RSELECT. Referenced by idleHandler(), and main(). |
|
Definition at line 504 of file nsnet.c. References max_fd. Referenced by main(). |
|
Definition at line 124 of file nsnet.c. Referenced by main(). |
|
Definition at line 186 of file nsnet.c. References setnonblocking(), sock_fd, and sock_t. Referenced by main(). |
|
Definition at line 133 of file nsnet.c. References monitorLog(), PLACE_SETBLOCKING, rexit(), and sock_fd. Referenced by main(), readline(), and writeBytes(). |
|
Definition at line 160 of file nsnet.c. References rexit(), rprintf(), and sock_fd. Referenced by rsocket(), and writeBytes(). |
|
Definition at line 81 of file nsnet.c. References buf, and OSTYPESTR. Referenced by monitorLog(), and raccept(). |
|
Definition at line 334 of file nsnet.c. References buf, MAXLEN, monitorLog(), PLACE_WRITEBYTES, rprintf(), setblocking(), and setnonblocking(). Referenced by main(), and writeString(). |
|
Definition at line 430 of file nsnet.c. References addCount(), NUM_WRITEN, NUM_WRITEN2, and showCounts(). Referenced by handleSamples(), and sendClientMsg(). |
|
Definition at line 310 of file nsnet.c. References buf, ob, and writeBytes(). Referenced by handleSamples(), and main(). |