uint32_t operation, uint32_t destnode,
uint32_t srcnode, uint32_t reqid);
-int ctdb_req_header_pull(uint8_t *pkt, size_t pkt_len,
+size_t ctdb_req_header_len(struct ctdb_req_header *h);
+void ctdb_req_header_push(struct ctdb_req_header *h, uint8_t *buf);
+int ctdb_req_header_pull(uint8_t *buf, size_t buflen,
struct ctdb_req_header *h);
int ctdb_req_header_verify(struct ctdb_req_header *h, uint32_t operation);
h->reqid = reqid;
}
-int ctdb_req_header_pull(uint8_t *pkt, size_t pkt_len,
+size_t ctdb_req_header_len(struct ctdb_req_header *h)
+{
+ return sizeof(struct ctdb_req_header);
+}
+
+void ctdb_req_header_push(struct ctdb_req_header *h, uint8_t *buf)
+{
+ memcpy(buf, h, sizeof(struct ctdb_req_header));
+}
+
+int ctdb_req_header_pull(uint8_t *buf, size_t buflen,
struct ctdb_req_header *h)
{
- if (pkt_len < sizeof(struct ctdb_req_header)) {
+ if (buflen < sizeof(struct ctdb_req_header)) {
return EMSGSIZE;
}
- memcpy(h, pkt, sizeof(struct ctdb_req_header));
+ memcpy(h, buf, sizeof(struct ctdb_req_header));
return 0;
}