ET System  16.4
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
et_network.h
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*
2  * Copyright (c) 1998 Southeastern Universities Research Association, *
3  * Thomas Jefferson National Accelerator Facility *
4  * *
5  * This software was developed under a United States Government license *
6  * described in the NOTICE file included as part of this distribution. *
7  * *
8  * Author: Carl Timmer *
9  * timmer@jlab.org Jefferson Lab, MS-12H *
10  * Phone: (757) 269-5130 12000 Jefferson Ave. *
11  * Fax: (757) 269-5800 Newport News, VA 23606 *
12  * *
13  *----------------------------------------------------------------------------*
14  *
15  * Description:
16  * Header for routines dealing with network communications
17  *
18  *----------------------------------------------------------------------------*/
19 
20 #ifndef __et_network_h
21 #define __et_network_h
22 
23 #include <arpa/inet.h> /* htonl stuff */
24 #include <sys/ioctl.h> /* find broacast addr */
25 
26 #include "et_private.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 //#define socklen_t int
33 
34 #ifdef linux
35  #ifndef _SC_IOV_MAX
36  #define _SC_IOV_MAX _SC_T_IOV_MAX
37  #endif
38 #endif
39 
40 #define SA struct sockaddr
41 #define ET_IOV_MAX 16 /* minimum for POSIX systems */
42 
43 
44 /* Byte swapping for 64 bits. */
45 #define hton64(x) ntoh64(x)
46 #if __BYTE_ORDER == __BIG_ENDIAN
47 #define ntoh64(x) x
48 #else
49 #define ntoh64(x) et_ntoh64(x)
50 #endif
51 
52 /*
53  * Ints representing ascii for "ET is Grreat",
54  * used to filter out portscanning software.
55  */
56 #define ET_MAGIC_INT1 0x45543269
57 #define ET_MAGIC_INT2 0x73324772
58 #define ET_MAGIC_INT3 0x72656174
59 
60 
61 /* our prototypes */
62 extern uint64_t et_ntoh64(uint64_t n);
63 
64 extern int et_CODAswap(int *src, int *dest, int nints, int same_endian);
65 
66 extern int et_findserver2(const char *etname, char *ethost, int *port,
67  uint32_t *inetaddr, et_response **allETinfo,
68  et_open_config *config, int trys,
69  struct timeval *waittime, int debug);
70 
71 extern void et_freeAnswers(et_response *answer);
72 
73 extern codaIpList *et_orderIpAddrs(et_response *response, codaIpAddr *netinfo,
74  char* preferredSubnet);
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif
Structure holding all configuration parameters used to open an ET system.
Definition: et_private.h:441
Structure for holding an ET system&#39;s single response to ET client&#39;s broad/multicast.
Definition: et_private.h:569
codaIpList * et_orderIpAddrs(et_response *response, codaIpAddr *netinfo, char *preferredSubnet)
int et_CODAswap(int *src, int *dest, int nints, int same_endian)
uint64_t et_ntoh64(uint64_t n)
int et_findserver2(const char *etname, char *ethost, int *port, uint32_t *inetaddr, et_response **allETinfo, et_open_config *config, int trys, struct timeval *waittime, int debug)
void et_freeAnswers(et_response *answer)