Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_gridftp_server_embed.h
1 /*
2  * Copyright 1999-2014 University of Chicago
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #if !defined(GLOBUS_GRIDFTP_SERVER_EMBED_H)
18 #define GLOBUS_GRIDFTP_SERVER_EMBED_H 1
19 
20 #include "globus_gridftp_server.h"
21 
22 typedef struct globus_l_gfs_embed_handle_s * globus_gfs_embed_handle_t;
23 
24 
25 /* events.
26  * XXX should possibly add some generic way to get useful info for
27  * for an event.
28  */
29 typedef enum
30 {
31  GLOBUS_GFS_EMBED_EVENT_CONNECTION_CLOSED = 1,
32  GLOBUS_GFS_EMBED_EVENT_CONNECTION_OPENED,
33  GLOBUS_GFS_EMBED_EVENT_STOPPED
34 } globus_gfs_embed_event_t;
35 
36 typedef globus_bool_t
37 (*globus_gfs_embed_event_cb_t)(
38  globus_gfs_embed_handle_t handle,
39  globus_result_t result,
40  globus_gfs_embed_event_t event,
41  void * user_arg);
42 
43 
44 /*
45  * init the handle. args[] is a NULL terminated argv-type array filled with
46  * command line parameters, may be NULL. Start at args[1].
47  * eg: args = {"not used", "-p", "5000", NULL}
48  */
50 globus_gridftp_server_embed_init(
51  globus_gfs_embed_handle_t * handle,
52  char * args[]);
53 
54 
55 /*
56  * destroy the handle. if server has been started, should only be called
57  * after the STOPPED event has been triggered.
58  */
59 void
60 globus_gridftp_server_embed_destroy(
61  globus_gfs_embed_handle_t handle);
62 
63 
64 /*
65  * set a config parameter. use _int or _ptr as appropriate for
66  * the parameter.
67  */
68 void
69 globus_gridftp_server_embed_config_set_int(
70  globus_gfs_embed_handle_t handle,
71  char * option_name,
72  int int_value);
73 
74 void
75 globus_gridftp_server_embed_config_set_ptr(
76  globus_gfs_embed_handle_t handle,
77  char * option_name,
78  void * ptr_value);
79 
80 
81 /*
82  * config query functions.
83  */
84 
85 #define globus_gridftp_server_embed_config_get_list \
86  (globus_list_t *) globus_gridftp_server_embed_config_get_ptr
87 #define globus_gridftp_server_embed_config_get_string \
88  (char *) globus_gridftp_server_embed_config_get_ptr
89 #define globus_gridftp_server_embed_config_get_bool \
90  (globus_bool_t) globus_gridftp_server_embed_config_get_int
91 
92 void *
93 globus_gridftp_server_embed_config_get_ptr(
94  globus_gfs_embed_handle_t handle,
95  const char * option_name);
96 
97 int
98 globus_gridftp_server_embed_config_get_int(
99  globus_gfs_embed_handle_t handle,
100  const char * option_name);
101 
102 
103 /*
104  * start up an embedded gridftp server
105  *
106  */
108 globus_gridftp_server_embed_start(
109  globus_gfs_embed_handle_t handle,
110  globus_gfs_embed_event_cb_t event_cb,
111  void * user_arg);
112 
113 /*
114  * stop the running embedded server. calling this function will start
115  * the processes of shutting down the embedded server. When it is
116  * completely shut down the event callback will be called with
117  * the GLOBUS_GRIDFTP_SERVER_EMEB_EVENT_STOPPED event.
118  */
119 void
120 globus_gridftp_server_embed_stop(
121  globus_gfs_embed_handle_t handle);
122 
123 
124 #endif
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
uint32_t globus_result_t
Definition: globus_types.h:99