Grid Community Toolkit  6.2.1629922860 (tag: v6.2.20210826)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_net_manager.h
Go to the documentation of this file.
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 #ifndef GLOBUS_NET_MANAGER_H
18 #define GLOBUS_NET_MANAGER_H 1
19 
20 #include "globus_common.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
32 #ifndef GLOBUS_GLOBAL_DOCUMENT_SET
33 
85 #endif
86 
88 
164  struct globus_net_manager_s *manager,
165  const globus_net_manager_attr_t *manager_attr_array,
166  const char *task_id,
167  const char *transport,
168  const globus_net_manager_attr_t *attr_array,
169  globus_net_manager_attr_t **attr_array_out);
170 
221  struct globus_net_manager_s *manager,
222  const globus_net_manager_attr_t *manager_attr_array,
223  const char *task_id,
224  const char *transport,
225  const char *local_contact,
226  const globus_net_manager_attr_t *attr_array,
227  char **local_contact_out,
228  globus_net_manager_attr_t **attr_array_out);
229 
264  struct globus_net_manager_s *manager,
265  const globus_net_manager_attr_t *manager_attr_array,
266  const char *task_id,
267  const char *transport,
268  const char *local_contact,
269  const globus_net_manager_attr_t *attr_array);
270 
314  struct globus_net_manager_s *manager,
315  const globus_net_manager_attr_t *manager_attr_array,
316  const char *task_id,
317  const char *transport,
318  const char *local_contact,
319  const globus_net_manager_attr_t *attr_array,
320  globus_net_manager_attr_t **attr_array_out);
321 
370  struct globus_net_manager_s *manager,
371  const globus_net_manager_attr_t *manager_attr_array,
372  const char *task_id,
373  const char *transport,
374  const char *local_contact,
375  const char *remote_contact,
376  const globus_net_manager_attr_t *attr_array,
377  globus_net_manager_attr_t **attr_array_out);
378 
429  struct globus_net_manager_s *manager,
430  const globus_net_manager_attr_t *manager_attr_array,
431  const char *task_id,
432  const char *transport,
433  const char *remote_contact,
434  const globus_net_manager_attr_t *attr_array,
435  char **remote_contact_out,
436  globus_net_manager_attr_t **attr_array_out);
437 
483  struct globus_net_manager_s *manager,
484  const globus_net_manager_attr_t *manager_attr_array,
485  const char *task_id,
486  const char *transport,
487  const char *local_contact,
488  const char *remote_contact,
489  const globus_net_manager_attr_t *attr_array,
490  globus_net_manager_attr_t **attr_array_out);
491 
529  struct globus_net_manager_s *manager,
530  const globus_net_manager_attr_t *manager_attr_array,
531  const char *task_id,
532  const char *transport,
533  const char *local_contact,
534  const char *remote_contact,
535  const globus_net_manager_attr_t *attr_array);
536 
574  struct globus_net_manager_s *manager,
575  const globus_net_manager_attr_t *manager_attr_array,
576  const char *task_id,
577  const char *transport,
578  const char *local_contact,
579  const char *remote_contact,
580  const globus_net_manager_attr_t *attr_array);
581 
587 typedef
589 {
591  const char *name;
610 }
612 
613 extern globus_extension_registry_t globus_i_net_manager_registry;
614 #define GLOBUS_NET_MANAGER_REGISTRY &globus_i_net_manager_registry
615 
618  globus_net_manager_t *manager,
620 
623  globus_net_manager_t *manager);
624 
625 extern globus_module_descriptor_t globus_i_net_manager_module;
655 #define GLOBUS_NET_MANAGER_MODULE (&globus_i_net_manager_module)
656 
657 
658 typedef enum
659 {
660  GLOBUS_NET_MANAGER_ERROR_PARAMETER,
661  GLOBUS_NET_MANAGER_ERROR_MEMORY,
662  GLOBUS_NET_MANAGER_ERROR_INIT,
663  GLOBUS_NET_MANAGER_ERROR_MANAGER,
664  GLOBUS_NET_MANAGER_ERROR_WRAPPED
665 } globus_net_manager_error_type_t;
666 
667 
668 /* all macros in this file require each function to 'declare' their name with
669  * this
670  */
671 #define GlobusNetManagerName(func)
672 /*
673 #ifdef __GNUC__
674 #define GlobusNetManagerName(func) static const char * _netmgr_name __attribute__((__unused__)) = #func
675 #else
676 #define GlobusNetManagerName(func) static const char * _netmgr_name = #func
677 #endif
678 */
679 
680 
681 
682 #define GlobusNetManagerErrorParameter(param_name) \
683  globus_error_put( \
684  globus_error_construct_error( \
685  GLOBUS_NET_MANAGER_MODULE, \
686  GLOBUS_NULL, \
687  GLOBUS_NET_MANAGER_ERROR_PARAMETER, \
688  __FILE__, \
689  __func__, \
690  __LINE__, \
691  "Bad parameter, %s", \
692  (param_name)))
693 
694 #define GlobusNetManagerErrorMemory(mem_name) \
695  globus_error_put( \
696  globus_error_construct_error( \
697  GLOBUS_NET_MANAGER_MODULE, \
698  GLOBUS_NULL, \
699  GLOBUS_NET_MANAGER_ERROR_MEMORY, \
700  __FILE__, \
701  __func__, \
702  __LINE__, \
703  "Memory allocation failed on %s", \
704  (mem_name)))
705 
706 #define GlobusNetManagerErrorInit(manager, explain) \
707  globus_error_put( \
708  globus_error_construct_error( \
709  GLOBUS_NET_MANAGER_MODULE, \
710  NULL, \
711  GLOBUS_NET_MANAGER_ERROR_INIT, \
712  __FILE__, \
713  __func__, \
714  __LINE__, \
715  "An error occurred accessing a module. %s: %s", manager, explain))
716 
717 #define GlobusNetManagerErrorManager(result, manager, explain) \
718  globus_error_put( \
719  globus_error_construct_error( \
720  GLOBUS_NET_MANAGER_MODULE, \
721  globus_error_get((result)), \
722  GLOBUS_NET_MANAGER_ERROR_MANAGER, \
723  __FILE__, \
724  __func__, \
725  __LINE__, \
726  "A network manager (%s) errored in %s.", manager, explain))
727 
728 #define GlobusNetManagerErrorWrapFailed(failed_func, result) \
729  globus_error_put( \
730  globus_error_construct_error( \
731  GLOBUS_NET_MANAGER_MODULE, \
732  globus_error_get((result)), \
733  GLOBUS_NET_MANAGER_ERROR_WRAPPED, \
734  __FILE__, \
735  __func__, \
736  __LINE__, \
737  "%s failed.", \
738  (failed_func)))
739 
740 #define GlobusNetManagerErrorWrapFailedWithMessage(result, format, arg) \
741  globus_error_put( \
742  globus_error_construct_error( \
743  GLOBUS_NET_MANAGER_MODULE, \
744  globus_error_get((result)), \
745  GLOBUS_NET_MANAGER_ERROR_WRAPPED, \
746  __FILE__, \
747  __func__, \
748  __LINE__, \
749  (format), \
750  (arg)))
751 
752 #define GlobusNetManagerErrorWrapFailedWithMessage2(result, format, arg1, arg2) \
753  globus_error_put( \
754  globus_error_construct_error( \
755  GLOBUS_NET_MANAGER_MODULE, \
756  globus_error_get((result)), \
757  GLOBUS_NET_MANAGER_ERROR_WRAPPED, \
758  __FILE__, \
759  __func__, \
760  __LINE__, \
761  (format), \
762  (arg1), (arg2)))
763 
764 
765 #ifdef __cplusplus
766 }
767 #endif
768 
769 #endif /* GLOBUS_NET_MANAGER_H */
globus_result_t globus_net_manager_register(globus_net_manager_t *manager, globus_module_descriptor_t *module)
Register a network manager.
Definition: register.c:34
globus_net_manager_pre_close pre_close
Definition: globus_net_manager.h:607
globus_net_manager_post_close post_close
Definition: globus_net_manager.h:609
globus_net_manager_post_accept post_accept
Definition: globus_net_manager.h:601
globus_result_t(* globus_net_manager_post_connect)(struct globus_net_manager_s *manager, const globus_net_manager_attr_t *manager_attr_array, const char *task_id, const char *transport, const char *local_contact, const char *remote_contact, const globus_net_manager_attr_t *attr_array, globus_net_manager_attr_t **attr_array_out)
Net Manager Post-Connect Function Signature.
Definition: globus_net_manager.h:482
globus_result_t(* globus_net_manager_post_listen)(struct globus_net_manager_s *manager, const globus_net_manager_attr_t *manager_attr_array, const char *task_id, const char *transport, const char *local_contact, const globus_net_manager_attr_t *attr_array, char **local_contact_out, globus_net_manager_attr_t **attr_array_out)
Net Manager Post-Listen Function Signature.
Definition: globus_net_manager.h:220
globus_result_t(* globus_net_manager_pre_close)(struct globus_net_manager_s *manager, const globus_net_manager_attr_t *manager_attr_array, const char *task_id, const char *transport, const char *local_contact, const char *remote_contact, const globus_net_manager_attr_t *attr_array)
Net Manager Pre-Close Function Signature.
Definition: globus_net_manager.h:528
globus_result_t(* globus_net_manager_pre_accept)(struct globus_net_manager_s *manager, const globus_net_manager_attr_t *manager_attr_array, const char *task_id, const char *transport, const char *local_contact, const globus_net_manager_attr_t *attr_array, globus_net_manager_attr_t **attr_array_out)
Net Manager Pre-Accept Function Signature.
Definition: globus_net_manager.h:313
Net Manager Definition.
Definition: globus_net_manager.h:587
globus_net_manager_post_connect post_connect
Definition: globus_net_manager.h:605
globus_result_t(* globus_net_manager_pre_listen)(struct globus_net_manager_s *manager, const globus_net_manager_attr_t *manager_attr_array, const char *task_id, const char *transport, const globus_net_manager_attr_t *attr_array, globus_net_manager_attr_t **attr_array_out)
Net Manager Pre-Listen Function Signature.
Definition: globus_net_manager.h:163
globus_result_t globus_net_manager_unregister(globus_net_manager_t *manager)
Unregister a network manager.
Definition: unregister.c:32
globus_net_manager_post_listen post_listen
Definition: globus_net_manager.h:595
globus_result_t(* globus_net_manager_end_listen)(struct globus_net_manager_s *manager, const globus_net_manager_attr_t *manager_attr_array, const char *task_id, const char *transport, const char *local_contact, const globus_net_manager_attr_t *attr_array)
Net Manager End-Listen Function Signature.
Definition: globus_net_manager.h:263
globus_net_manager_end_listen end_listen
Definition: globus_net_manager.h:597
struct globus_net_manager_s globus_net_manager_t
Net Manager Definition.
globus_net_manager_pre_connect pre_connect
Definition: globus_net_manager.h:603
Net Manager Attributes.
Definition: globus_net_manager_attr.h:46
Headers common to all of Globus.
uint32_t globus_result_t
Definition: globus_types.h:99
const char * name
Definition: globus_net_manager.h:591
globus_result_t(* globus_net_manager_post_close)(struct globus_net_manager_s *manager, const globus_net_manager_attr_t *manager_attr_array, const char *task_id, const char *transport, const char *local_contact, const char *remote_contact, const globus_net_manager_attr_t *attr_array)
Net Manager Post-Close Function Signature.
Definition: globus_net_manager.h:573
globus_net_manager_pre_accept pre_accept
Definition: globus_net_manager.h:599
globus_net_manager_pre_listen pre_listen
Definition: globus_net_manager.h:593
Globus Network Manager Attributes.
globus_result_t(* globus_net_manager_post_accept)(struct globus_net_manager_s *manager, const globus_net_manager_attr_t *manager_attr_array, const char *task_id, const char *transport, const char *local_contact, const char *remote_contact, const globus_net_manager_attr_t *attr_array, globus_net_manager_attr_t **attr_array_out)
Net Manager Post-Accept Function Signature.
Definition: globus_net_manager.h:369
globus_result_t(* globus_net_manager_pre_connect)(struct globus_net_manager_s *manager, const globus_net_manager_attr_t *manager_attr_array, const char *task_id, const char *transport, const char *remote_contact, const globus_net_manager_attr_t *attr_array, char **remote_contact_out, globus_net_manager_attr_t **attr_array_out)
Net Manager Pre-Connect Function Signature.
Definition: globus_net_manager.h:428
Module Descriptor.
Definition: globus_module.h:71