diff options
author | Amitay Isaacs <amitay@gmail.com> | 2017-07-07 17:21:54 +1000 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2017-09-01 08:52:07 +0200 |
commit | 1787a4b63292aee0e9df4e4031188ac239d804d8 (patch) | |
tree | e8a30034ab27dff14ca078c8918cff031ce48bbc /ctdb/protocol/protocol_api.h | |
parent | 15c91774d943fba1985f33d10e24030264ce64c8 (diff) | |
download | samba-1787a4b63292aee0e9df4e4031188ac239d804d8.tar.gz |
ctdb-protocol: Add a generic packet header
This will avoid duplication when new daemons (and new client-server
protocols) are created out of the main ctdb daemon.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/protocol/protocol_api.h')
-rw-r--r-- | ctdb/protocol/protocol_api.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ctdb/protocol/protocol_api.h b/ctdb/protocol/protocol_api.h index 522b009b151..22fc4483205 100644 --- a/ctdb/protocol/protocol_api.h +++ b/ctdb/protocol/protocol_api.h @@ -677,6 +677,19 @@ int ctdb_event_reply_pull(uint8_t *buf, size_t buflen, int ctdb_allocate_pkt(TALLOC_CTX *mem_ctx, size_t datalen, uint8_t **buf, size_t *buflen); +/* From protocol/protocol_sock.c */ + +size_t sock_packet_header_len(struct sock_packet_header *in); +void sock_packet_header_push(struct sock_packet_header *in, uint8_t *buf, + size_t *npush); +int sock_packet_header_pull(uint8_t *buf, size_t buflen, + struct sock_packet_header *out, size_t *npull); + +void sock_packet_header_set_reqid(struct sock_packet_header *h, + uint32_t reqid); +void sock_packet_header_set_length(struct sock_packet_header *h, + uint32_t length); + /* From protocol/protocol_util.c */ const char *ctdb_runstate_to_string(enum ctdb_runstate runstate); |