Grid Community Toolkit  6.2.1541705016
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 
160  struct globus_net_manager_s *manager,
161  const globus_net_manager_attr_t *manager_attr_array,
162  const char *task_id,
163  const char *transport,
164  const globus_net_manager_attr_t *attr_array,
165  globus_net_manager_attr_t **attr_array_out);
166 
217  struct globus_net_manager_s *manager,
218  const globus_net_manager_attr_t *manager_attr_array,
219  const char *task_id,
220  const char *transport,
221  const char *local_contact,
222  const globus_net_manager_attr_t *attr_array,
223  char **local_contact_out,
224  globus_net_manager_attr_t **attr_array_out);
225 
260  struct globus_net_manager_s *manager,
261  const globus_net_manager_attr_t *manager_attr_array,
262  const char *task_id,
263  const char *transport,
264  const char *local_contact,
265  const globus_net_manager_attr_t *attr_array);
266 
310  struct globus_net_manager_s *manager,
311  const globus_net_manager_attr_t *manager_attr_array,
312  const char *task_id,
313  const char *transport,
314  const char *local_contact,
315  const globus_net_manager_attr_t *attr_array,
316  globus_net_manager_attr_t **attr_array_out);
317 
366  struct globus_net_manager_s *manager,
367  const globus_net_manager_attr_t *manager_attr_array,
368  const char *task_id,
369  const char *transport,
370  const char *local_contact,
371  const char *remote_contact,
372  const globus_net_manager_attr_t *attr_array,
373  globus_net_manager_attr_t **attr_array_out);
374 
425  struct globus_net_manager_s *manager,
426  const globus_net_manager_attr_t *manager_attr_array,
427  const char *task_id,
428  const char *transport,
429  const char *remote_contact,
430  const globus_net_manager_attr_t *attr_array,
431  char **remote_contact_out,
432  globus_net_manager_attr_t **attr_array_out);
433 
479  struct globus_net_manager_s *manager,
480  const globus_net_manager_attr_t *manager_attr_array,
481  const char *task_id,
482  const char *transport,
483  const char *local_contact,
484  const char *remote_contact,
485  const globus_net_manager_attr_t *attr_array,
486  globus_net_manager_attr_t **attr_array_out);
487 
525  struct globus_net_manager_s *manager,
526  const globus_net_manager_attr_t *manager_attr_array,
527  const char *task_id,
528  const char *transport,
529  const char *local_contact,
530  const char *remote_contact,
531  const globus_net_manager_attr_t *attr_array);
532 
570  struct globus_net_manager_s *manager,
571  const globus_net_manager_attr_t *manager_attr_array,
572  const char *task_id,
573  const char *transport,
574  const char *local_contact,
575  const char *remote_contact,
576  const globus_net_manager_attr_t *attr_array);
577 
583 typedef
585 {
587  const char *name;
606 }
608 
609 extern globus_extension_registry_t globus_i_net_manager_registry;
610 #define GLOBUS_NET_MANAGER_REGISTRY &globus_i_net_manager_registry
611 
614  globus_net_manager_t *manager,
616 
619  globus_net_manager_t *manager);
620 
621 extern globus_module_descriptor_t globus_i_net_manager_module;
651 #define GLOBUS_NET_MANAGER_MODULE (&globus_i_net_manager_module)
652 
653 
654 typedef enum
655 {
656  GLOBUS_NET_MANAGER_ERROR_PARAMETER,
657  GLOBUS_NET_MANAGER_ERROR_MEMORY,
658  GLOBUS_NET_MANAGER_ERROR_INIT,
659  GLOBUS_NET_MANAGER_ERROR_MANAGER,
660  GLOBUS_NET_MANAGER_ERROR_WRAPPED
661 } globus_net_manager_error_type_t;
662 
663 
664 /* all macros in this file require each function to 'declare' their name with
665  * this
666  */
667 #define GlobusNetManagerName(func)
668 /*
669 #ifdef __GNUC__
670 #define GlobusNetManagerName(func) static const char * _netmgr_name __attribute__((__unused__)) = #func
671 #else
672 #define GlobusNetManagerName(func) static const char * _netmgr_name = #func
673 #endif
674 */
675 
676 
677 
678 #define GlobusNetManagerErrorParameter(param_name) \
679  globus_error_put( \
680  globus_error_construct_error( \
681  GLOBUS_NET_MANAGER_MODULE, \
682  GLOBUS_NULL, \
683  GLOBUS_NET_MANAGER_ERROR_PARAMETER, \
684  __FILE__, \
685  __func__, \
686  __LINE__, \
687  "Bad parameter, %s", \
688  (param_name)))
689 
690 #define GlobusNetManagerErrorMemory(mem_name) \
691  globus_error_put( \
692  globus_error_construct_error( \
693  GLOBUS_NET_MANAGER_MODULE, \
694  GLOBUS_NULL, \
695  GLOBUS_NET_MANAGER_ERROR_MEMORY, \
696  __FILE__, \
697  __func__, \
698  __LINE__, \
699  "Memory allocation failed on %s", \
700  (mem_name)))
701 
702 #define GlobusNetManagerErrorInit(manager, explain) \
703  globus_error_put( \
704  globus_error_construct_error( \
705  GLOBUS_NET_MANAGER_MODULE, \
706  NULL, \
707  GLOBUS_NET_MANAGER_ERROR_INIT, \
708  __FILE__, \
709  __func__, \
710  __LINE__, \
711  "An error occurred accessing a module. %s: %s", manager, explain))
712 
713 #define GlobusNetManagerErrorManager(result, manager, explain) \
714  globus_error_put( \
715  globus_error_construct_error( \
716  GLOBUS_NET_MANAGER_MODULE, \
717  globus_error_get((result)), \
718  GLOBUS_NET_MANAGER_ERROR_MANAGER, \
719  __FILE__, \
720  __func__, \
721  __LINE__, \
722  "A network manager (%s) errored in %s.", manager, explain))
723 
724 #define GlobusNetManagerErrorWrapFailed(failed_func, result) \
725  globus_error_put( \
726  globus_error_construct_error( \
727  GLOBUS_NET_MANAGER_MODULE, \
728  globus_error_get((result)), \
729  GLOBUS_NET_MANAGER_ERROR_WRAPPED, \
730  __FILE__, \
731  __func__, \
732  __LINE__, \
733  "%s failed.", \
734  (failed_func)))
735 
736 #define GlobusNetManagerErrorWrapFailedWithMessage(result, format, arg) \
737  globus_error_put( \
738  globus_error_construct_error( \
739  GLOBUS_NET_MANAGER_MODULE, \
740  globus_error_get((result)), \
741  GLOBUS_NET_MANAGER_ERROR_WRAPPED, \
742  __FILE__, \
743  __func__, \
744  __LINE__, \
745  (format), \
746  (arg)))
747 
748 #define GlobusNetManagerErrorWrapFailedWithMessage2(result, format, arg1, arg2) \
749  globus_error_put( \
750  globus_error_construct_error( \
751  GLOBUS_NET_MANAGER_MODULE, \
752  globus_error_get((result)), \
753  GLOBUS_NET_MANAGER_ERROR_WRAPPED, \
754  __FILE__, \
755  __func__, \
756  __LINE__, \
757  (format), \
758  (arg1), (arg2)))
759 
760 
761 #ifdef __cplusplus
762 }
763 #endif
764 
765 #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:603
globus_net_manager_post_close post_close
Definition: globus_net_manager.h:605
globus_net_manager_post_accept post_accept
Definition: globus_net_manager.h:597
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:259
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:424
Net Manager Definition.
Definition: globus_net_manager.h:583
globus_net_manager_post_connect post_connect
Definition: globus_net_manager.h:601
globus_result_t globus_net_manager_unregister(globus_net_manager_t *manager)
Unregister a network manager.
Definition: unregister.c:32
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:216
globus_net_manager_post_listen post_listen
Definition: globus_net_manager.h:591
globus_net_manager_end_listen end_listen
Definition: globus_net_manager.h:593
struct globus_net_manager_s globus_net_manager_t
Net Manager Definition.
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:478
globus_net_manager_pre_connect pre_connect
Definition: globus_net_manager.h:599
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:309
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:524
Net Manager Attributes.
Definition: globus_net_manager_attr.h:45
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:569
Headers common to all of Globus.
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:159
uint32_t globus_result_t
Definition: globus_types.h:99
const char * name
Definition: globus_net_manager.h:587
globus_net_manager_pre_accept pre_accept
Definition: globus_net_manager.h:595
globus_net_manager_pre_listen pre_listen
Definition: globus_net_manager.h:589
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:365
Module Descriptor.
Definition: globus_module.h:69