ISIS Logo
ISISBEAM
ISIS Beam Information
Macros | Functions
1st_nd_lib.c File Reference
#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)
 

Macro Definition Documentation

#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
#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

Function Documentation

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 void junk_reply ( sd  )
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 
)
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 
)
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 void send_mess ( SOCKET  sd,
const char *  format,
  ... 
)
static

Definition at line 527 of file 1st_nd_lib.c.

References junk_reply().

Referenced by send_mail().

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 
)
char* xml_parse ( const char *  input_string,
const char *  token 
)

Definition at line 467 of file 1st_nd_lib.c.

Referenced by isisbeamDriver::pollerThread().

Copyright © 2013 Science and Technology Facilities Council | Generated by   doxygen 1.8.5