00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
00018
00019 #if !defined(GLOBUS_I_XIO_H)
00020 #define GLOBUS_I_XIO_H 1
00021
00022 #include "globus_xio.h"
00023 #include "globus_xio_driver.h"
00024 #include "globus_common.h"
00025 #include "globus_xio_util.h"
00026 #include "globus_xio_load.h"
00027
00028 #define GLOBUS_XIO_ATTR_ARRAY_BASE_SIZE 16
00029 #define GLOBUS_XIO_HANDLE_DEFAULT_OPERATION_COUNT 4
00030
00031
00032
00033
00034
00035
00036 #define GlobusXIOCurrentBlockedThread(blocked_thread) \
00037 if (globus_i_am_only_thread()) \
00038 { \
00039 blocked_thread.thread = globus_thread_self(); \
00040 } \
00041 else \
00042 { \
00043 blocked_thread.depth = globus_callback_space_get_depth( \
00044 GLOBUS_CALLBACK_GLOBAL_SPACE); \
00045 }
00046 #define GlobusXIOBlockedThreadMatchesCurrentThread(a) \
00047 (globus_i_am_only_thread() \
00048 ? (a.depth == \
00049 globus_callback_space_get_depth(GLOBUS_CALLBACK_GLOBAL_SPACE)) \
00050 : globus_thread_equal(a.thread, globus_thread_self()))
00051
00052 GlobusDebugDeclare(GLOBUS_XIO);
00053
00054 #define GlobusXIODebugPrintf(level, message) \
00055 GlobusDebugPrintf(GLOBUS_XIO, level, message)
00056
00057 #define GlobusXIOOpInc(_in_op) \
00058 do \
00059 { \
00060 (_in_op)->ref++; \
00061 GlobusXIODebugPrintf( \
00062 GLOBUS_XIO_DEBUG_STATE, \
00063 ("[%s:%d] Op @ 0x%x ref increased to %d:\n", _xio_name, __LINE__, \
00064 (_in_op), (_in_op)->ref)); \
00065 } while(0)
00066
00067 #define GlobusXIOOpDec(_in_op) \
00068 do \
00069 { \
00070 (_in_op)->ref--; \
00071 GlobusXIODebugPrintf( \
00072 GLOBUS_XIO_DEBUG_STATE, \
00073 ("[%s:%d] Op @ 0x%x ref decreased to %d:\n", _xio_name, __LINE__, \
00074 (_in_op), (_in_op)->ref)); \
00075 } while(0)
00076
00077 #define GlobusXIOObjToResult(_in_obj) \
00078 (_in_obj == NULL ? GLOBUS_SUCCESS : globus_error_put(_in_obj))
00079
00080 #define GlobusXIOResultToObj(_in_res) \
00081 (_in_res == GLOBUS_SUCCESS ? NULL : globus_error_get(_in_res))
00082
00083 #define GlobusXIOHandleStateChange(_h, _new) \
00084 do \
00085 { \
00086 globus_i_xio_handle_t * _l_h; \
00087 \
00088 _l_h = (_h); \
00089 GlobusXIODebugPrintf( \
00090 GLOBUS_XIO_DEBUG_STATE, \
00091 ("[%s:%d] Handle @ 0x%x state change:\n" \
00092 " From:%s\n" \
00093 " to: %s\n", \
00094 _xio_name, \
00095 __LINE__, \
00096 _l_h, \
00097 globus_i_xio_handle_state_name_table[_l_h->state], \
00098 globus_i_xio_handle_state_name_table[_new])); \
00099 _l_h->state = _new; \
00100 } while(0)
00101
00102 #define GlobusXIOOpStateChange(_op, _new) \
00103 do \
00104 { \
00105 globus_i_xio_op_t * _l_op; \
00106 \
00107 _l_op = (_op); \
00108 GlobusXIODebugPrintf( \
00109 GLOBUS_XIO_DEBUG_STATE, \
00110 ("[%s:%d] Op @ 0x%x state change:\n" \
00111 " From:%s\n" \
00112 " to: %s\n", \
00113 _xio_name, \
00114 __LINE__, \
00115 _l_op, \
00116 globus_i_xio_op_state_name_table[_l_op->state], \
00117 globus_i_xio_op_state_name_table[_new])); \
00118 _l_op->state = _new; \
00119 } while(0)
00120
00121 #define GlobusXIOContextStateChange(_c, _new) \
00122 do \
00123 { \
00124 globus_i_xio_context_entry_t * _l_context; \
00125 \
00126 _l_context = (_c); \
00127 GlobusXIODebugPrintf( \
00128 GLOBUS_XIO_DEBUG_STATE, \
00129 ("[%s:%d] Context @ 0x%x state change:\n" \
00130 " From:%s\n" \
00131 " to: %s\n", \
00132 _xio_name, \
00133 __LINE__, \
00134 _l_context, \
00135 globus_i_xio_context_state_name_table[_l_context->state], \
00136 globus_i_xio_context_state_name_table[_new])); \
00137 _l_context->state = _new; \
00138 } while(0)
00139
00140 #define GlobusXIODebugEnter() \
00141 GlobusXIODebugPrintf( \
00142 GLOBUS_XIO_DEBUG_TRACE, \
00143 ("[%s] Entering\n", _xio_name))
00144
00145 #define GlobusXIODebugExit() \
00146 GlobusXIODebugPrintf( \
00147 GLOBUS_XIO_DEBUG_TRACE, \
00148 ("[%s] Exiting\n", _xio_name))
00149
00150 #define GlobusXIODebugExitWithError() \
00151 GlobusXIODebugPrintf( \
00152 GLOBUS_XIO_DEBUG_TRACE, \
00153 ("[%s] Exiting with error\n", _xio_name))
00154
00155 #define GlobusXIODebugInternalEnter() \
00156 GlobusXIODebugPrintf( \
00157 GLOBUS_XIO_DEBUG_INTERNAL_TRACE, \
00158 ("[%s] I Entering\n", _xio_name))
00159
00160 #define GlobusXIODebugInternalExit() \
00161 GlobusXIODebugPrintf( \
00162 GLOBUS_XIO_DEBUG_INTERNAL_TRACE, \
00163 ("[%s] I Exiting\n", _xio_name))
00164
00165 #define GlobusXIODebugInternalExitWithError() \
00166 GlobusXIODebugPrintf( \
00167 GLOBUS_XIO_DEBUG_INTERNAL_TRACE, \
00168 ("[%s] I Exiting with error\n", _xio_name))
00169
00170 #define GlobusXIODebugInregisterOneShot() \
00171 GlobusXIODebugPrintf( \
00172 GLOBUS_XIO_DEBUG_INFO, \
00173 ("[%s] Registering one shot due to in_register.\n", _xio_name))
00174
00175 #define GlobusXIODebugDelayedFinish() \
00176 GlobusXIODebugPrintf( \
00177 GLOBUS_XIO_DEBUG_INFO, \
00178 ("[%s] Delaying finish due to in_register and blocking op.\n", \
00179 _xio_name))
00180
00181 #define GlobusXIOOperationCreate(_out_op, _in_c) \
00182 do \
00183 { \
00184 globus_i_xio_op_t * _X_op; \
00185 globus_i_xio_context_t * _X_c; \
00186 \
00187 _X_c = (_in_c); \
00188 _X_op = (globus_i_xio_op_t * ) \
00189 globus_memory_pop_node(&_X_c->op_memory); \
00190 if(_X_op != NULL) \
00191 { \
00192 \
00193 memset(_X_op, '\0', sizeof(globus_i_xio_op_t) + \
00194 (sizeof(globus_i_xio_op_entry_t) * (_X_c->stack_size - 1))); \
00195 _X_op->_op_context = _X_c; \
00196 _X_op->stack_size = _X_c->stack_size; \
00197 _X_op->progress = GLOBUS_TRUE; \
00198 _X_op->_op_ent_offset = -1; \
00199 } \
00200 _out_op = _X_op; \
00201 } while(0)
00202
00203
00204
00205
00206
00207 #define GlobusIXIOClearCancel(op) \
00208 do \
00209 { \
00210 globus_i_xio_op_t * _op = (op); \
00211 \
00212 \
00213 \
00214 if(_op->canceled) \
00215 { \
00216 globus_mutex_lock(&_op->_op_context->cancel_mutex); \
00217 if(_op->canceled == _op->ndx + 1) \
00218 { \
00219 _op->canceled = 0; \
00220 } \
00221 globus_mutex_unlock(&_op->_op_context->cancel_mutex); \
00222 } \
00223 } while(0)
00224
00225
00226
00227
00228
00229
00230
00231 typedef struct gss_cred_id_desc_struct * gss_cred_id_t;
00232
00233 extern char * globus_i_xio_context_state_name_table[];
00234
00235 typedef enum globus_i_xio_context_state_e
00236 {
00237 GLOBUS_XIO_CONTEXT_STATE_NONE,
00238 GLOBUS_XIO_CONTEXT_STATE_OPENING,
00239 GLOBUS_XIO_CONTEXT_STATE_OPEN,
00240 GLOBUS_XIO_CONTEXT_STATE_OPEN_FAILED,
00241 GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED,
00242 GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED,
00243 GLOBUS_XIO_CONTEXT_STATE_EOF_RECEIVED_AND_CLOSING,
00244 GLOBUS_XIO_CONTEXT_STATE_EOF_DELIVERED_AND_CLOSING,
00245 GLOBUS_XIO_CONTEXT_STATE_CLOSING,
00246 GLOBUS_XIO_CONTEXT_STATE_OPENING_AND_CLOSING,
00247 GLOBUS_XIO_CONTEXT_STATE_CLOSED
00248 } globus_i_xio_context_state_t;
00249
00250 extern char * globus_i_xio_handle_state_name_table[];
00251
00252 typedef enum globus_i_xio_handle_state_e
00253 {
00254 GLOBUS_XIO_HANDLE_STATE_NONE,
00255 GLOBUS_XIO_HANDLE_STATE_CLIENT,
00256 GLOBUS_XIO_HANDLE_STATE_ACCEPTED,
00257 GLOBUS_XIO_HANDLE_STATE_OPENING,
00258 GLOBUS_XIO_HANDLE_STATE_OPENING_FAILED,
00259 GLOBUS_XIO_HANDLE_STATE_OPENING_AND_CLOSING,
00260 GLOBUS_XIO_HANDLE_STATE_OPEN,
00261 GLOBUS_XIO_HANDLE_STATE_OPEN_FAILED,
00262 GLOBUS_XIO_HANDLE_STATE_CLOSING,
00263 GLOBUS_XIO_HANDLE_STATE_CLOSED
00264 } globus_i_xio_handle_state_t;
00265
00266 extern char * globus_i_xio_op_state_name_table[];
00267
00268 typedef enum globus_i_xio_op_state_e
00269 {
00270 GLOBUS_XIO_OP_STATE_NONE,
00271 GLOBUS_XIO_OP_STATE_OPERATING,
00272 GLOBUS_XIO_OP_STATE_TIMEOUT_PENDING,
00273 GLOBUS_XIO_OP_STATE_FINISH_WAITING,
00274 GLOBUS_XIO_OP_STATE_FINISHED
00275 } globus_i_xio_op_state_t;
00276
00277 typedef enum globus_xio_server_state_e
00278 {
00279 GLOBUS_XIO_SERVER_STATE_NONE,
00280 GLOBUS_XIO_SERVER_STATE_OPEN,
00281 GLOBUS_XIO_SERVER_STATE_ACCEPTING,
00282 GLOBUS_XIO_SERVER_STATE_COMPLETING,
00283 GLOBUS_XIO_SERVER_STATE_CLOSE_PENDING,
00284 GLOBUS_XIO_SERVER_STATE_CLOSING,
00285 GLOBUS_XIO_SERVER_STATE_CLOSED
00286 } globus_xio_server_state_t;
00287
00288
00289
00290
00291
00292
00293
00294 struct globus_i_xio_context_s;
00295 struct globus_i_xio_op_s;
00296
00297 typedef struct globus_i_xio_monitor_s
00298 {
00299 int count;
00300 } globus_i_xio_monitor_t;
00301
00302 void
00303 globus_i_xio_monitor_init(
00304 globus_i_xio_monitor_t * monitor);
00305
00306 void
00307 globus_i_xio_monitor_destroy(
00308 globus_i_xio_monitor_t * monitor);
00309
00310 typedef struct globus_i_xio_attr_ent_s
00311 {
00312 globus_xio_driver_t driver;
00313 void * driver_data;
00314 } globus_i_xio_attr_ent_t;
00315
00316 typedef struct globus_i_xio_attr_s
00317 {
00318 globus_bool_t unloaded;
00319
00320 globus_xio_timeout_callback_t open_timeout_cb;
00321 globus_reltime_t open_timeout_period;
00322 globus_xio_timeout_callback_t read_timeout_cb;
00323 globus_reltime_t read_timeout_period;
00324 globus_xio_timeout_callback_t write_timeout_cb;
00325 globus_reltime_t write_timeout_period;
00326 globus_xio_timeout_callback_t close_timeout_cb;
00327 globus_reltime_t close_timeout_period;
00328
00329 globus_xio_timeout_server_callback_t accept_timeout_cb;
00330 globus_reltime_t accept_timeout_period;
00331
00332 globus_bool_t cancel_open;
00333 globus_bool_t cancel_close;
00334 globus_bool_t cancel_read;
00335 globus_bool_t cancel_write;
00336
00337 globus_bool_t no_cancel;
00338 void * timeout_arg;
00339
00340 gss_cred_id_t user_open_cred;
00341 char * user_open_sbj;
00342 char * user_open_username;
00343 char * user_open_pw;
00344
00345 globus_callback_space_t space;
00346
00347 int max;
00348 int ndx;
00349 globus_i_xio_attr_ent_t * entry;
00350 } globus_i_xio_attr_t;
00351
00352 typedef struct globus_i_xio_stack_s
00353 {
00354 int size;
00355 globus_list_t * driver_stack;
00356 globus_xio_driver_t pushing_driver;
00357 } globus_i_xio_stack_t;
00358
00359
00360 typedef struct globus_i_xio_server_entry_s
00361 {
00362 globus_xio_driver_t driver;
00363 void * server_handle;
00364 } globus_i_xio_server_entry_t;
00365
00366
00367
00368 typedef struct globus_i_xio_server_s
00369 {
00370 globus_i_xio_monitor_t * sd_monitor;
00371
00372 globus_xio_server_state_t state;
00373
00374 globus_xio_timeout_server_callback_t accept_timeout;
00375 globus_reltime_t accept_timeout_period;
00376 struct globus_i_xio_op_s * op;
00377
00378 globus_xio_server_callback_t cb;
00379 void * user_arg;
00380
00381 int outstanding_operations;
00382
00383 int ref;
00384 globus_mutex_t mutex;
00385 globus_callback_space_t space;
00386
00387 globus_bool_t blocking;
00388 char * contact_string;
00389
00390 int stack_size;
00391 globus_i_xio_server_entry_t entry[1];
00392 } globus_i_xio_server_t;
00393
00394 typedef struct globus_i_xio_handle_s
00395 {
00396 globus_i_xio_monitor_t * sd_monitor;
00397
00398 globus_list_t * cb_list;
00399 int ref;
00400 struct globus_i_xio_context_s * context;
00401
00402 globus_i_xio_handle_state_t state;
00403
00404
00405
00406 globus_list_t * write_op_list;
00407 globus_list_t * read_op_list;
00408 struct globus_i_xio_op_s * open_op;
00409 struct globus_i_xio_op_s * close_op;
00410
00411 void * timeout_arg;
00412
00413 globus_callback_space_t space;
00414 globus_xio_timeout_callback_t open_timeout_cb;
00415 globus_reltime_t open_timeout_period;
00416 globus_xio_timeout_callback_t read_timeout_cb;
00417 globus_reltime_t read_timeout_period;
00418 globus_xio_timeout_callback_t write_timeout_cb;
00419 globus_reltime_t write_timeout_period;
00420 globus_xio_timeout_callback_t close_timeout_cb;
00421 globus_reltime_t close_timeout_period;
00422 } globus_i_xio_handle_t;
00423
00424
00425
00426
00427
00428
00429 typedef struct globus_i_xio_context_entry_s
00430 {
00431 globus_xio_driver_t driver;
00432 void * driver_handle;
00433
00434
00435 globus_i_xio_context_state_t state;
00436 int outstanding_operations;
00437 int read_operations;
00438 int eof_operations;
00439 int pending_reads;
00440
00441
00442 globus_bool_t close_started;
00443
00444 struct globus_i_xio_op_s * open_op;
00445 struct globus_i_xio_op_s * close_op;
00446 globus_list_t * eof_op_list;
00447 globus_fifo_t pending_read_queue;
00448 struct globus_i_xio_context_s * whos_my_daddy;
00449 } globus_i_xio_context_entry_t;
00450
00451
00452
00453
00454 typedef struct globus_i_xio_context_s
00455 {
00456
00457 int ref;
00458 int stack_size;
00459
00460 globus_memory_t op_memory;
00461 globus_mutex_t mutex;
00462 globus_mutex_t cancel_mutex;
00463 globus_i_xio_context_entry_t entry[1];
00464 } globus_i_xio_context_t;
00465
00466
00467 #define _op_ent_data_cb type_u.handle_s.data_cb
00468 #define _op_ent_wait_for type_u.handle_s.wait_for_bytes
00469 #define _op_ent_offset type_u.handle_s.offset
00470 #define _op_ent_nbytes type_u.handle_s.nbytes
00471 #define _op_ent_iovec type_u.handle_s.iovec
00472 #define _op_ent_iovec_count type_u.handle_s.iovec_count
00473 #define _op_ent_fake_iovec type_u.handle_s.fake_iovec
00474
00475
00476
00477
00478
00479 typedef struct globus_i_xio_op_entry_s
00480 {
00481
00482 globus_xio_operation_type_t type;
00483 globus_xio_driver_callback_t cb;
00484 void * user_arg;
00485
00486 union
00487 {
00488
00489 struct
00490 {
00491 globus_xio_driver_data_callback_t data_cb;
00492 globus_size_t wait_for_bytes;
00493 globus_size_t nbytes;
00494 globus_xio_iovec_t * iovec;
00495 int iovec_count;
00496 globus_xio_iovec_t * fake_iovec;
00497 } handle_s;
00498 } type_u;
00499 globus_bool_t in_register;
00500 globus_bool_t is_limited;
00501
00502 void * dd;
00503 void * link;
00504 void * open_attr;
00505 void * close_attr;
00506 int prev_ndx;
00507 int next_ndx;
00508
00509 globus_xio_operation_type_t * deliver_type;
00510 } globus_i_xio_op_entry_t;
00511
00512
00513 #define _op_data_cb data_cb
00514 #define _op_iovec_cb iovec_cb
00515 #define _op_cb callback_u.cb
00516 #define _op_accept_cb callback_u.accept_cb
00517
00518 #define _op_handle type_u.handle_s.handle
00519 #define _op_iovec type_u.handle_s.iovec
00520 #define _op_iovec_count type_u.handle_s.iovec_count
00521 #define _op_mem_iovec type_u.handle_s.mem_iovec
00522 #define _op_context type_u.handle_s.context
00523 #define _op_nbytes type_u.handle_s.nbytes
00524 #define _op_wait_for type_u.handle_s.wait_for
00525 #define _op_handle_timeout_cb type_u.handle_s.timeout_cb
00526
00527 #define _op_server type_u.server_s.server
00528 #define _op_server_timeout_cb type_u.server_s.timeout_cb
00529
00536 typedef union
00537 {
00538 globus_thread_t thread;
00539 int depth;
00540 }
00541 globus_i_xio_blocked_thread_t;
00542
00543
00544
00545 typedef struct globus_i_xio_op_s
00546 {
00547
00548 globus_xio_operation_type_t type;
00549 globus_i_xio_op_state_t state;
00550
00551 globus_bool_t is_user_dd;
00552
00553
00554
00555
00556 union
00557 {
00558 globus_xio_callback_t cb;
00559 globus_xio_accept_callback_t accept_cb;
00560 }callback_u;
00561
00562 globus_xio_data_callback_t data_cb;
00563 globus_xio_iovec_callback_t iovec_cb;
00564 void * user_arg;
00565
00566
00567
00568
00569 union
00570 {
00571
00572 struct
00573 {
00574 globus_i_xio_handle_t * handle;
00575
00576 globus_xio_iovec_t * iovec;
00577 int iovec_count;
00578 globus_xio_iovec_t mem_iovec;
00579
00580 globus_size_t nbytes;
00581
00582
00583 globus_i_xio_context_t * context;
00584
00585 globus_size_t wait_for;
00586 globus_off_t offset;
00587 globus_xio_timeout_callback_t timeout_cb;
00588 } handle_s;
00589
00590 struct
00591 {
00592 globus_i_xio_server_t * server;
00593 globus_xio_timeout_server_callback_t timeout_cb;
00594 } server_s;
00595 } type_u;
00596
00597
00598 globus_bool_t progress;
00599
00600
00601 int ref;
00602
00603
00604 globus_xio_driver_cancel_callback_t cancel_cb;
00605 void * cancel_arg;
00606 int canceled;
00607 globus_bool_t block_timeout;
00608
00609 globus_bool_t restarted;
00610 globus_bool_t blocking;
00611 globus_i_xio_blocked_thread_t blocked_thread;
00612 globus_bool_t finished_delayed;
00613
00614
00615
00616 gss_cred_id_t user_open_cred;
00617 char * user_open_sbj;
00618 char * user_open_username;
00619 char * user_open_pw;
00620
00621
00622 globus_object_t * cached_obj;
00623
00624
00625 int stack_size;
00626
00627 int ndx;
00628
00629 globus_i_xio_op_entry_t entry[1];
00630 } globus_i_xio_op_t;
00631
00632 typedef struct globus_i_xio_driver_s
00633 {
00634 char * name;
00635 void * user_data;
00636 void * wrap_data;
00637
00638 globus_xio_driver_hook_t * hook;
00639 globus_extension_handle_t extension_handle;
00640 globus_bool_t extension_activated;
00641
00642 globus_xio_string_cntl_table_t * string_table;
00643
00644
00645
00646
00647 globus_xio_driver_transform_open_t transform_open_func;
00648 globus_xio_driver_transport_open_t transport_open_func;
00649 globus_xio_driver_close_t close_func;
00650 globus_xio_driver_read_t read_func;
00651 globus_xio_driver_write_t write_func;
00652 globus_xio_driver_handle_cntl_t handle_cntl_func;
00653
00654 globus_xio_driver_push_driver_t push_driver_func;
00655
00656
00657
00658
00659 globus_xio_driver_server_init_t server_init_func;
00660 globus_xio_driver_server_accept_t server_accept_func;
00661 globus_xio_driver_server_destroy_t server_destroy_func;
00662 globus_xio_driver_server_cntl_t server_cntl_func;
00663 globus_xio_driver_link_cntl_t link_cntl_func;
00664 globus_xio_driver_link_destroy_t link_destroy_func;
00665
00666
00667
00668
00669
00670
00671 globus_xio_driver_attr_init_t attr_init_func;
00672 globus_xio_driver_attr_copy_t attr_copy_func;
00673 globus_xio_driver_attr_cntl_t attr_cntl_func;
00674 globus_xio_driver_attr_destroy_t attr_destroy_func;
00675 } globus_i_xio_driver_t;
00676
00677
00678
00679
00680
00681 typedef struct globus_i_xio_blocking_s
00682 {
00683 globus_mutex_t mutex;
00684 globus_cond_t cond;
00685 globus_bool_t done;
00686 globus_size_t nbytes;
00687 globus_i_xio_op_t * op;
00688 globus_xio_handle_t accepted_handle;
00689 globus_xio_data_descriptor_t data_desc;
00690 globus_object_t * error_obj;
00691 } globus_i_xio_blocking_t;
00692
00693 typedef struct globus_i_xio_restart_s
00694 {
00695 globus_i_xio_op_t * op;
00696 globus_bool_t restarted;
00697 } globus_i_xio_restart_t;
00698
00699 globus_i_xio_blocking_t *
00700 globus_i_xio_blocking_alloc();
00701
00702 void
00703 globus_i_xio_blocking_destroy(
00704 globus_i_xio_blocking_t * info);
00705
00706
00707
00708
00709 globus_result_t
00710 globus_i_xio_server_close(
00711 globus_xio_server_t xio_server,
00712 globus_xio_server_callback_t cb,
00713 void * user_arg);
00714
00715 void
00716 globus_l_xio_driver_purge_read_eof(
00717 globus_i_xio_context_entry_t * my_context);
00718
00719 void
00720 globus_l_xio_driver_op_write_kickout(
00721 void * user_arg);
00722
00723 void
00724 globus_l_xio_driver_op_read_kickout(
00725 void * user_arg);
00726
00727 globus_result_t
00728 globus_i_xio_driver_start_close(
00729 globus_i_xio_op_t * op,
00730 globus_bool_t can_fail);
00731
00732 void
00733 globus_l_xio_driver_op_close_kickout(
00734 void * user_arg);
00735
00736 void
00737 globus_l_xio_driver_op_accept_kickout(
00738 void * user_arg);
00739
00740 void
00741 globus_l_xio_driver_open_op_kickout(
00742 void * user_arg);
00743
00744 void
00745 globus_i_xio_driver_resume_op(
00746 globus_i_xio_op_t * op);
00747
00748
00749
00750
00751 typedef globus_bool_t
00752 (*globus_i_xio_timer_cb_t)(
00753 void * datum);
00754
00755 typedef struct globus_i_xio_op_timer_s
00756 {
00757 globus_reltime_t minimal_delay;
00758 globus_mutex_t mutex;
00759 globus_cond_t cond;
00760 globus_list_t * op_list;
00761 globus_bool_t running;
00762 globus_callback_handle_t periodic_handle;
00763 } globus_i_xio_timer_t;
00764
00765 void
00766 globus_i_xio_timer_init(
00767 globus_i_xio_timer_t * timer);
00768
00769 void
00770 globus_i_xio_timer_destroy(
00771 globus_i_xio_timer_t * timer);
00772
00773 void
00774 globus_i_xio_timer_register_timeout(
00775 globus_i_xio_timer_t * timer,
00776 void * datum,
00777 globus_bool_t * progress_ptr,
00778 globus_i_xio_timer_cb_t timeout_cb,
00779 globus_reltime_t * timeout);
00780
00781 globus_bool_t
00782 globus_i_xio_timer_unregister_timeout(
00783 globus_i_xio_timer_t * timer,
00784 void * datum);
00785
00786 globus_i_xio_context_t *
00787 globus_i_xio_context_create(
00788 int stack_size);
00789
00790 void
00791 globus_i_xio_context_destroy(
00792 globus_i_xio_context_t * xio_context);
00793
00794 void
00795 globus_i_xio_will_block_cb(
00796 int space,
00797 globus_thread_callback_index_t ndx,
00798 void * user_args);
00799
00800 void
00801 globus_i_xio_pass_failed(
00802 globus_i_xio_op_t * op,
00803 globus_i_xio_context_entry_t * my_context,
00804 globus_bool_t * close,
00805 globus_bool_t * destroy_handle);
00806
00807 void
00808 globus_i_xio_handle_destroy(
00809 globus_i_xio_handle_t * handle);
00810
00811 void
00812 globus_i_xio_handle_dec(
00813 globus_i_xio_handle_t * handle,
00814 globus_bool_t * destroy_handle);
00815
00816 void
00817 globus_i_xio_op_destroy(
00818 globus_i_xio_op_t * op,
00819 globus_bool_t * destroy_handle);
00820
00821 globus_result_t
00822 globus_i_xio_repass_write(
00823 globus_i_xio_op_t * op);
00824
00825 globus_result_t
00826 globus_i_xio_repass_read(
00827 globus_i_xio_op_t * op);
00828
00829 void
00830 globus_i_xio_register_oneshot(
00831 globus_i_xio_handle_t * handle,
00832 globus_callback_func_t cb,
00833 void * user_arg,
00834 globus_callback_space_t space);
00835
00836
00837 typedef struct globus_i_xio_space_info_s
00838 {
00839 globus_bool_t unregister;
00840 globus_i_xio_handle_t * handle;
00841 globus_callback_handle_t ch;
00842 globus_callback_func_t func;
00843 void * user_arg;
00844 } globus_i_xio_space_info_t;
00845
00846 void
00847 globus_i_xio_close_handles(
00848 globus_xio_driver_t driver);
00849
00850 globus_result_t
00851 globus_i_xio_operation_cancel(
00852 globus_i_xio_op_t * op,
00853 int source_ndx);
00854
00855 void
00856 globus_i_xio_driver_deliver_op(
00857 globus_i_xio_op_t * op,
00858 int ndx,
00859 globus_xio_operation_type_t deliver_type);
00860
00861 void
00862 globus_xio_driver_open_delivered(
00863 globus_xio_operation_t in_op,
00864 int in_ndx,
00865 globus_xio_operation_type_t * deliver_type);
00866
00867 void
00868 globus_xio_driver_write_delivered(
00869 globus_xio_operation_t in_op,
00870 int in_ndx,
00871 globus_xio_operation_type_t * deliver_type);
00872
00873 void
00874 globus_xio_driver_read_delivered(
00875 globus_xio_operation_t op,
00876 int in_ndx,
00877 globus_xio_operation_type_t * deliver_type);
00878
00879 globus_result_t
00880 globus_i_xio_driver_dd_cntl(
00881 globus_i_xio_op_t * op,
00882 globus_xio_driver_t driver,
00883 globus_xio_operation_type_t type,
00884 int cmd,
00885 va_list ap);
00886
00887 globus_result_t
00888 globus_i_xio_driver_handle_cntl(
00889 globus_i_xio_context_t * context,
00890 int start_ndx,
00891 globus_xio_driver_t driver,
00892 int cmd,
00893 va_list ap);
00894
00895 globus_result_t
00896 globus_i_xio_driver_attr_cntl(
00897 globus_i_xio_attr_t * attr,
00898 globus_xio_driver_t driver,
00899 int cmd,
00900 va_list ap);
00901
00902 globus_result_t
00903 globus_i_xio_string_cntl_parser(
00904 const char * env_str,
00905 globus_xio_string_cntl_table_t * table,
00906 void * attr,
00907 globus_xio_driver_attr_cntl_t attr_func);
00908
00909
00910 extern globus_i_xio_timer_t globus_i_xio_timeout_timer;
00911 extern globus_list_t * globus_i_xio_outstanding_handles_list;
00912 extern globus_list_t * globus_i_xio_outstanding_servers_list;
00913 extern globus_list_t * globus_i_xio_outstanding_attrs_list;
00914 extern globus_list_t * globus_i_xio_outstanding_dds_list;
00915 extern globus_mutex_t globus_i_xio_mutex;
00916 extern globus_cond_t globus_i_xio_cond;
00917
00918 #endif
00919
00920 #endif