globus_connect_gridftp_server  16.4
/build/globus-connect-gridftp-server-16.4/gfs_i_gfork_plugin.h
1 #if !defined(GFS_GFORK_PLUGIN_H)
2 #define GFS_GFORK_PLUGIN_H 1
3 
4 /*
5  * Copyright The University of Chicago
6  *
7  * All Rights Reserved.
8  */
9 
10 #include "globus_xio.h"
11 #include "globus_xio_tcp_driver.h"
12 #include "globus_xio_gsi.h"
13 #include "globus_gfork.h"
14 
15 #define GFSGforkError(error_msg, _type) \
16  globus_error_put( \
17  globus_error_construct_error( \
18  NULL, \
19  NULL, \
20  _type, \
21  __FILE__, \
22  _gfs_gfork_func_name, \
23  __LINE__, \
24  "%s", \
25  (error_msg)))
26 
27 #ifdef __GNUC__
28 #define GFSGForkFuncName(func) static const char * _gfs_gfork_func_name __attribute__((__unused__)) = #func
29 #else
30 #define GFSGForkFuncName(func) static const char * _gfs_gfork_func_name = #func
31 #endif
32 
33 
34 #define GF_VERSION 'a'
35 
36 /* use this to mark buffer in fifo as bad. we know it was not
37  sent over the wire because we would not have alloed it in the first
38  place */
39 #define GF_VERSION_TIMEOUT 'F'
40 #define GF_REGISTRATION_TIMEOUT 600
41 
42 /* header for all */
43 #define GF_VERSION_LEN 1
44 #define GF_HEADER_RESERVE_LEN 5
45 #define GF_MSG_TYPE_LEN 1
46 
47 #define GF_VERSION_NDX 0
48 #define GF_HEADER_RESERVE_NDX (GF_VERSION_NDX+GF_VERSION_LEN)
49 #define GF_MSG_TYPE_NDX (GF_HEADER_RESERVE_NDX+GF_HEADER_RESERVE_LEN)
50 
51 
52 /* dyn be messaging */
53 #define GF_DYN_AT_ONCE_LEN (sizeof(uint32_t))
54 #define GF_DYN_TOTAL_LEN (sizeof(uint32_t))
55 #define GF_DYN_ENTRY_COUNT_LEN (sizeof(uint32_t))
56 #define GF_DYN_COOKIE_LEN 32
57 #define GF_DYN_REPO_LEN 108
58 #define GF_DYN_CS_LEN 108
59 
60 
61 #define GF_DYN_AT_ONCE_NDX (GF_MSG_TYPE_NDX+GF_MSG_TYPE_LEN)
62 #define GF_DYN_TOTAL_NDX (GF_DYN_AT_ONCE_NDX+GF_DYN_AT_ONCE_LEN)
63 #define GF_DYN_ENTRY_COUNT_NDX (GF_DYN_TOTAL_NDX+GF_DYN_TOTAL_LEN)
64 #define GF_DYN_COOKIE_NDX (GF_DYN_ENTRY_COUNT_NDX+GF_DYN_ENTRY_COUNT_LEN)
65 #define GF_DYN_REPO_NDX (GF_DYN_COOKIE_NDX+GF_DYN_COOKIE_NDX)
66 #define GF_DYN_CS_NDX (GF_DYN_REPO_NDX+GF_DYN_REPO_LEN)
67 
68 #define GF_DYN_PACKET_LEN (GF_DYN_CS_LEN+GF_DYN_CS_NDX)
69 
70 /* mem messaging */
71 #define GF_MEM_LIMIT_NDX (GF_MSG_TYPE_NDX+GF_MSG_TYPE_LEN)
72 #define GF_MEM_LIMIT_LEN (sizeof(uint32_t))
73 
74 #define GF_MEM_MSG_LEN (GF_MEM_LIMIT_NDX+GF_MEM_LIMIT_LEN)
75 
76 /* kill msgin*/
77 #define GF_KILL_STRING_NDX (GF_MSG_TYPE_NDX+GF_MSG_TYPE_LEN)
78 #define GF_KILL_STRING_LEN 128
79 
80 #define GF_KILL_MSG_LEN (GF_KILL_STRING_NDX+GF_KILL_STRING_LEN)
81 
82 /* ready message */
83 #define GF_READY_MSG_LEN (GF_MSG_TYPE_NDX+GF_MSG_TYPE_LEN)
84 
85 /* release message */
86 #define GF_RELEASE_COUNT_NDX (GF_MSG_TYPE_NDX+GF_MSG_TYPE_LEN)
87 #define GF_RELEASE_COUNT_LEN (sizeof(uint32_t))
88 
89 #define GF_RELEASE_MSG_LEN (GF_RELEASE_COUNT_NDX+GF_RELEASE_COUNT_LEN)
90 
91 typedef enum gfs_gfork_msg_type_e
92 {
93  GFS_GFORK_MSG_TYPE_DYNBE = 1,
94  GFS_GFORK_MSG_TYPE_KILL,
95  GFS_GFORK_MSG_TYPE_MEM,
96  GFS_GFORK_MSG_TYPE_READY,
97  GFS_GFORK_MSG_TYPE_ACK,
98  GFS_GFORK_MSG_TYPE_NACK,
99  GFS_GFORK_MSG_TYPE_CC,
100  GFS_GFORK_MSG_TYPE_RELEASE,
101  GFS_GFORK_MSG_TYPE_REMOVE_DYNBE
102 } gfs_gfork_msg_type_t;
103 
104 
105 typedef enum gfs_gfork_error_e
106 {
107  GFS_GFORK_ERROR_PARAMETER = 1
108 } gfs_gfork_error_t;
109 
110 #endif