PageRenderTime 48ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/src/sctp-rpc/protobuf-c-sctp.h

http://protobuf-c.googlecode.com/
C Header | 65 lines | 47 code | 10 blank | 8 comment | 0 complexity | b8b66be33334f48dd2d35b3d1b14b8d0 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. #include "../google/protobuf-c/protobuf-c.h"
  2. typedef struct _ProtobufC_SCTP_Dispatch ProtobufC_SCTP_Dispatch;
  3. typedef struct _ProtobufC_SCTP_Channel ProtobufC_SCTP_Channel;
  4. typedef struct _ProtobufC_SCTP_Listener ProtobufC_SCTP_Listener;
  5. /* For servers and clients, you can get at the array of
  6. remote service objects from the closure-data of your local-service's
  7. invocation method. */
  8. ProtobufCService **
  9. protobuf_c_sctp_closure_data_get_remote_services (void *closure_data);
  10. typedef struct {
  11. const char *name;
  12. ProtobufCService *service;
  13. } ProtobufC_SCTP_LocalService;
  14. typedef struct {
  15. const char *name;
  16. ProtobufCServiceDescriptor *descriptor;
  17. } ProtobufC_SCTP_RemoteService;
  18. ProtobufC_SCTP_Config *
  19. protobuf_c_sctp_config_new (size_t n_local_services,
  20. ProtobufC_SCTP_LocalService *local_services,
  21. size_t n_remote_services,
  22. ProtobufC_SCTP_RemoteService *remote_services);
  23. /* a channel: an sctp association (technically sctp allows multiple
  24. streams within a single association (unlike tcp), but we do not
  25. use that ability. when created as a client, this does automatic
  26. reconnecting. */
  27. ProtobufC_SCTP_Channel *
  28. protobuf_c_sctp_client_new_ipv4(const uint8_t *addr,
  29. uint16_t port,
  30. ProtobufC_SCTP_Config *config,
  31. ProtobufC_Dispatch *dispatch);
  32. ProtobufC_SCTP_Channel *
  33. protobuf_c_sctp_client_new_ipv4_dns (const char *host,
  34. uint16_t port,
  35. ProtobufC_SCTP_Config *config,
  36. ProtobufC_Dispatch *dispatch);
  37. ProtobufC_SCTP_Channel *
  38. protobuf_c_sctp_client_new_ipv4_hostport(const char *host_port,
  39. ProtobufC_SCTP_Config *config,
  40. ProtobufC_SCTP_Dispatch *dispatch);
  41. void protobuf_c_sctp_channel_set_error_handler (ProtobufC_SCTP_Channel *channel,
  42. ProtobufC_SCTP_ErrorFunc func,
  43. void *data,
  44. ProtobufC_SCTP_Destroy destroy);
  45. ProtobufCService *
  46. protobuf_c_sctp_channel_peek_remote_service(ProtobufC_SCTP_Channel *channel,
  47. unsigned index);
  48. void protobuf_c_sctp_channel_shutdown (ProtobufC_SCTP_Channel *channel);
  49. void protobuf_c_sctp_channel_destroy (ProtobufC_SCTP_Channel *channel);
  50. /* a listener: a passive sctp socket awaiting new connections */
  51. ProtobufC_SCTP_Server *
  52. protobuf_c_sctp_server_new_ipv4 (const uint8_t *bind_addr,
  53. uint16_t port,
  54. ProtobufC_SCTP_Config *config);
  55. void protobuf_c_sctp_server_destroy (ProtobufC_SCTP_Server *server);