#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pwd.h>
#include <string.h>
#include <sys/time.h>
#include "1st_nd_post.h"
Go to the source code of this file.
Macros | |
#define | SOCKET int |
#define | INVALID_SOCKET -1 |
#define | INTERNET_SOCKET AF_INET |
#define | closesocket close |
Functions | |
SOCKET | open_connection (const char *servers[], short port) |
int | initialise_data_packet (data_header *dh, short major, short minor) |
int | send_packet (SOCKET sd, const char *data, int n) |
int | send_data (SOCKET sd, data_packet_1_0 *dp) |
int | receive_data_pattern (SOCKET sd, void *data, int maxdata, const char *pattern) |
int | receive_data_size (SOCKET sd, void *data, int n) |
int | receive_data (SOCKET sd, data_packet_1_0 *dp) |
int | receive_data_udp (SOCKET sd, char *dp, int n) |
SOCKET | setup_socket (unsigned short port, int num_listen) |
SOCKET | setup_udp_socket (unsigned short port, int multicast) |
SOCKET | setup_broadcast_socket (const char *address, short port, struct sockaddr_in *sockin, int multicast) |
char * | xml_parse (const char *input_string, const char *token) |
static void | junk_reply (sd) |
static void | send_mess (SOCKET sd, const char *format,...) |
void | send_mail (const char *from, const char *to, const char *message) |
#define closesocket close |
Definition at line 19 of file 1st_nd_lib.c.
Referenced by open_connection(), send_mail(), setup_socket(), and setup_udp_socket().
#define INTERNET_SOCKET AF_INET |
Definition at line 18 of file 1st_nd_lib.c.
Referenced by open_connection(), setup_broadcast_socket(), setup_socket(), and setup_udp_socket().
#define INVALID_SOCKET -1 |
Definition at line 17 of file 1st_nd_lib.c.
Referenced by open_connection(), send_mail(), send_packet(), setup_socket(), and setup_udp_socket().
#define SOCKET int |
Definition at line 16 of file 1st_nd_lib.c.
Referenced by open_connection(), isisbeamDriver::pollerThread(), send_mail(), setup_broadcast_socket(), setup_socket(), and setup_udp_socket().
int initialise_data_packet | ( | data_header * | dh, |
short | major, | ||
short | minor | ||
) |
Definition at line 129 of file 1st_nd_lib.c.
References data_header::len, data_header::major, and data_header::minor.
|
static |
Definition at line 506 of file 1st_nd_lib.c.
Referenced by send_mess().
SOCKET open_connection | ( | const char * | servers[], |
short | port | ||
) |
Definition at line 37 of file 1st_nd_lib.c.
References closesocket, INTERNET_SOCKET, INVALID_SOCKET, and SOCKET.
Referenced by send_mail().
int receive_data | ( | SOCKET | sd, |
data_packet_1_0 * | dp | ||
) |
Definition at line 271 of file 1st_nd_lib.c.
References data_packet_1_0::check, data_packet_1_0::data, data_packet_1_0::header, data_header::len, and receive_data_size().
int receive_data_pattern | ( | SOCKET | sd, |
void * | data, | ||
int | maxdata, | ||
const char * | pattern | ||
) |
Definition at line 198 of file 1st_nd_lib.c.
int receive_data_size | ( | SOCKET | sd, |
void * | data, | ||
int | n | ||
) |
Definition at line 236 of file 1st_nd_lib.c.
Referenced by receive_data().
int receive_data_udp | ( | SOCKET | sd, |
char * | dp, | ||
int | n | ||
) |
Definition at line 304 of file 1st_nd_lib.c.
Referenced by isisbeamDriver::pollerThread().
int send_data | ( | SOCKET | sd, |
data_packet_1_0 * | dp | ||
) |
Definition at line 166 of file 1st_nd_lib.c.
References data_packet_1_0::check, data_packet_1_0::data, data_packet_1_0::header, and data_header::len.
void send_mail | ( | const char * | from, |
const char * | to, | ||
const char * | message | ||
) |
Definition at line 539 of file 1st_nd_lib.c.
References closesocket, INVALID_SOCKET, open_connection(), send_mess(), and SOCKET.
|
static |
int send_packet | ( | SOCKET | sd, |
const char * | data, | ||
int | n | ||
) |
Definition at line 137 of file 1st_nd_lib.c.
References INVALID_SOCKET.
SOCKET setup_broadcast_socket | ( | const char * | address, |
short | port, | ||
struct sockaddr_in * | sockin, | ||
int | multicast | ||
) |
Definition at line 405 of file 1st_nd_lib.c.
References INTERNET_SOCKET, and SOCKET.
SOCKET setup_socket | ( | unsigned short | port, |
int | num_listen | ||
) |
Definition at line 325 of file 1st_nd_lib.c.
References closesocket, INTERNET_SOCKET, INVALID_SOCKET, and SOCKET.
SOCKET setup_udp_socket | ( | unsigned short | port, |
int | multicast | ||
) |
Definition at line 353 of file 1st_nd_lib.c.
References closesocket, INTERNET_SOCKET, INVALID_SOCKET, ND_MULTICAST_ADDRESS, and SOCKET.
Referenced by isisbeamDriver::pollerThread().
char* xml_parse | ( | const char * | input_string, |
const char * | token | ||
) |
Definition at line 467 of file 1st_nd_lib.c.
Referenced by isisbeamDriver::pollerThread().