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

Language C/C++ Header Lines 66
MD5 Hash b8b66be33334f48dd2d35b3d1b14b8d0 Estimated Cost $1,090 (why?)
Repository http://protobuf-c.googlecode.com/svn/trunk/ View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "../google/protobuf-c/protobuf-c.h"

typedef struct _ProtobufC_SCTP_Dispatch ProtobufC_SCTP_Dispatch;
typedef struct _ProtobufC_SCTP_Channel ProtobufC_SCTP_Channel;
typedef struct _ProtobufC_SCTP_Listener ProtobufC_SCTP_Listener;

/* For servers and clients, you can get at the array of
   remote service objects from the closure-data of your local-service's
   invocation method. */
ProtobufCService **
protobuf_c_sctp_closure_data_get_remote_services (void *closure_data);

typedef struct {
  const char *name;
  ProtobufCService *service;
} ProtobufC_SCTP_LocalService;
typedef struct {
  const char *name;
  ProtobufCServiceDescriptor *descriptor;
} ProtobufC_SCTP_RemoteService;

ProtobufC_SCTP_Config *
protobuf_c_sctp_config_new (size_t       n_local_services,
                            ProtobufC_SCTP_LocalService *local_services,
                            size_t       n_remote_services,
                            ProtobufC_SCTP_RemoteService *remote_services);

/* a channel: an sctp association (technically sctp allows multiple
   streams within a single association (unlike tcp), but we do not
   use that ability.  when created as a client, this does automatic
   reconnecting. */
ProtobufC_SCTP_Channel *
     protobuf_c_sctp_client_new_ipv4(const uint8_t          *addr,
                                     uint16_t                port,
                                     ProtobufC_SCTP_Config  *config,
                                     ProtobufC_Dispatch     *dispatch);
ProtobufC_SCTP_Channel *
     protobuf_c_sctp_client_new_ipv4_dns (const char           *host,
                                          uint16_t              port,
                                          ProtobufC_SCTP_Config  *config,
                                          ProtobufC_Dispatch *dispatch);
ProtobufC_SCTP_Channel *
     protobuf_c_sctp_client_new_ipv4_hostport(const char *host_port,
                                              ProtobufC_SCTP_Config  *config,
                                              ProtobufC_SCTP_Dispatch *dispatch);
void protobuf_c_sctp_channel_set_error_handler (ProtobufC_SCTP_Channel *channel,
                                                ProtobufC_SCTP_ErrorFunc func,
                                                void                    *data,
                                                ProtobufC_SCTP_Destroy   destroy);
ProtobufCService *
     protobuf_c_sctp_channel_peek_remote_service(ProtobufC_SCTP_Channel *channel,
                                                 unsigned                index);
void protobuf_c_sctp_channel_shutdown          (ProtobufC_SCTP_Channel *channel);
void protobuf_c_sctp_channel_destroy           (ProtobufC_SCTP_Channel *channel);



/* a listener: a passive sctp socket awaiting new connections */
ProtobufC_SCTP_Server *
     protobuf_c_sctp_server_new_ipv4           (const uint8_t          *bind_addr,
                                                uint16_t                port,
                                                ProtobufC_SCTP_Config  *config);
void protobuf_c_sctp_server_destroy            (ProtobufC_SCTP_Server  *server);
Back to Top