Mpaxos__InstidT * mpaxos__instid_t__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Mpaxos__InstidT *) protobuf_c_message_unpack (&mpaxos__instid_t__descriptor, allocator, len, data); }
Mpaxos__MsgSlot * mpaxos__msg_slot__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Mpaxos__MsgSlot *) protobuf_c_message_unpack (&mpaxos__msg_slot__descriptor, allocator, len, data); }
Protocol__PrpDlRar * protocol__prp_dl_rar__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Protocol__PrpDlRar *) protobuf_c_message_unpack (&protocol__prp_dl_rar__descriptor, allocator, len, data); }
Mpaxos__CodedValueT * mpaxos__coded_value_t__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Mpaxos__CodedValueT *) protobuf_c_message_unpack (&mpaxos__coded_value_t__descriptor, allocator, len, data); }
BanListRep * ban_list_rep__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (BanListRep *) protobuf_c_message_unpack (&ban_list_rep__descriptor, allocator, len, data); }
StatusRep * status_rep__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (StatusRep *) protobuf_c_message_unpack (&status_rep__descriptor, allocator, len, data); }
Extensions__Api__CastChannel__CastMessage * extensions__api__cast_channel__cast_message__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Extensions__Api__CastChannel__CastMessage *) protobuf_c_message_unpack (&extensions__api__cast_channel__cast_message__descriptor, allocator, len, data); }
DeleteResponse * delete_response__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (DeleteResponse *) protobuf_c_message_unpack (&delete_response__descriptor, allocator, len, data); }
Textsecure__PreKeyWhisperMessage * textsecure__pre_key_whisper_message__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Textsecure__PreKeyWhisperMessage *) protobuf_c_message_unpack (&textsecure__pre_key_whisper_message__descriptor, allocator, len, data); }
QueryByCompensationRangeRequest * query_by_compensation_range_request__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (QueryByCompensationRangeRequest *) protobuf_c_message_unpack (&query_by_compensation_range_request__descriptor, allocator, len, data); }
ZPack * zpack__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (ZPack *) protobuf_c_message_unpack (&zpack__descriptor, allocator, len, data); }
Textsecure__KeyExchangeMessage * textsecure__key_exchange_message__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Textsecure__KeyExchangeMessage *) protobuf_c_message_unpack (&textsecure__key_exchange_message__descriptor, allocator, len, data); }
Com__Emajliramokade__Image__Proto__Zahtjev * com__emajliramokade__image__proto__zahtjev__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Com__Emajliramokade__Image__Proto__Zahtjev *) protobuf_c_message_unpack (&com__emajliramokade__image__proto__zahtjev__descriptor, allocator, len, data); }
Com__Emajliramokade__Image__Proto__DimenzijeSlike * com__emajliramokade__image__proto__dimenzije_slike__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Com__Emajliramokade__Image__Proto__DimenzijeSlike *) protobuf_c_message_unpack (&com__emajliramokade__image__proto__dimenzije_slike__descriptor, allocator, len, data); }
ScopeMsgClientReq * scope_msg_client_req__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (ScopeMsgClientReq *) protobuf_c_message_unpack (&scope_msg_client_req__descriptor, allocator, len, data); }
CFGBRANCHQUESTS * cfg__branch__quests__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (CFGBRANCHQUESTS *) protobuf_c_message_unpack (&cfg__branch__quests__descriptor, allocator, len, data); }
Com__Example__Myfirstapp__Song * com__example__myfirstapp__song__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Com__Example__Myfirstapp__Song *) protobuf_c_message_unpack (&com__example__myfirstapp__song__descriptor, allocator, len, data); }
UnbanReq * unban_req__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (UnbanReq *) protobuf_c_message_unpack (&unban_req__descriptor, allocator, len, data); }
Hello__HelloResponse * hello__hello_response__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Hello__HelloResponse *) protobuf_c_message_unpack (&hello__hello_response__descriptor, allocator, len, data); }
BoolMsg * bool_msg__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (BoolMsg *) protobuf_c_message_unpack (&bool_msg__descriptor, allocator, len, data); }
Protocol__PrpPdcchOfdmSymCount * protocol__prp_pdcch_ofdm_sym_count__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Protocol__PrpPdcchOfdmSymCount *) protobuf_c_message_unpack (&protocol__prp_pdcch_ofdm_sym_count__descriptor, allocator, len, data); }
Textsecure__SenderKeyDistributionMessage * textsecure__sender_key_distribution_message__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Textsecure__SenderKeyDistributionMessage *) protobuf_c_message_unpack (&textsecure__sender_key_distribution_message__descriptor, allocator, len, data); }
Mpaxos__Proposal * mpaxos__proposal__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Mpaxos__Proposal *) protobuf_c_message_unpack (&mpaxos__proposal__descriptor, allocator, len, data); }
CFGINSTANCEMAP * cfg__instance__map__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (CFGINSTANCEMAP *) protobuf_c_message_unpack (&cfg__instance__map__descriptor, allocator, len, data); }
Calculation * calculation__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Calculation *) protobuf_c_message_unpack (&calculation__descriptor, allocator, len, data); }
CFGSKILLS * cfg__skills__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (CFGSKILLS *) protobuf_c_message_unpack (&cfg__skills__descriptor, allocator, len, data); }
UserInfoRep * user_info_rep__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (UserInfoRep *) protobuf_c_message_unpack (&user_info_rep__descriptor, allocator, len, data); }
const ProtobufCMessage* KeySpecHelper::get_dompath() { ProtobufCMessage* dom_path = nullptr; const ProtobufCFieldDescriptor *dom_fd = nullptr; const ProtobufCFieldDescriptor *bin_fd = nullptr; protobuf_c_boolean is_dptr = false; void *field_ptr = nullptr; size_t offset = 0; size_t count = protobuf_c_message_get_field_desc_count_and_offset(&keyspec_->base, RW_SCHEMA_TAG_KEYSPEC_DOMPATH, &dom_fd, &field_ptr, &offset, &is_dptr); RW_ASSERT(dom_fd); RW_ASSERT(dom_fd->label != PROTOBUF_C_LABEL_REPEATED); RW_ASSERT(dom_fd->type == PROTOBUF_C_TYPE_MESSAGE); if (!count) { size_t bcount = protobuf_c_message_get_field_desc_count_and_offset(&keyspec_->base, RW_SCHEMA_TAG_KEYSPEC_BINPATH, &bin_fd, &field_ptr, &offset, &is_dptr); if (!bcount) { return dom_path; } RW_ASSERT(bin_fd); RW_ASSERT(bin_fd->type == PROTOBUF_C_TYPE_BYTES); RW_ASSERT(bin_fd->label != PROTOBUF_C_LABEL_REPEATED); uint8_t *data = nullptr; size_t len = 0; if (bin_fd->rw_flags & RW_PROTOBUF_FOPT_INLINE) { data = ((ProtobufCFlatBinaryData *)field_ptr)->data; len = ((ProtobufCFlatBinaryData *)field_ptr)->len; } else { data = ((ProtobufCBinaryData *)field_ptr)->data; len = ((ProtobufCBinaryData *)field_ptr)->len; } dom_path = protobuf_c_message_unpack(nullptr, dom_fd->msg_desc, len, data); if (dom_path) { dompath_.reset(dom_path); } } else { dom_path = (ProtobufCMessage *)field_ptr; } return dom_path; }
audited_err_t audited_start_cmd(const Audited__StartReq *startreq, Audited__StartRes *startres) { audited_err_t rv=0; ProtobufCMessage *req=NULL; audited_cmd_t *cmd_desc=NULL; char *audit_string=NULL; uint32_t pending_cmd_id; bool saved_pending_cmd=false; if(!did_init) { rv = AUDITED_EBADSTATE; goto out; } if (startreq->cmd >= audited_cmds_num) { rv = AUDITED_EBADAUDITEDCMD; goto out; } cmd_desc = &audited_cmds[startreq->cmd]; assert(cmd_desc); req = protobuf_c_message_unpack(cmd_desc->req_descriptor, NULL, startreq->cmd_input.len, startreq->cmd_input.data); CHECK(req, AUDITED_EDECODE, "protobuf_c_message_unpack"); assert(cmd_desc->audit_string); startres->svc_err = cmd_desc->audit_string(req, &audit_string); CHECK_RV((unsigned int)startres->svc_err, rv, "audit_string()"); pending_cmd_id = audited_save_pending_cmd(cmd_desc, req, audit_string); CHECK(pending_cmd_id >= 0, AUDITED_ESAVE, "audited_save_pending_cmd"); saved_pending_cmd=true; startres->res = malloc(sizeof(Audited__StartRes__Res)); CHECK_MEM(startres->res, AUDITED_ENOMEM); *(startres->res) = (Audited__StartRes__Res) { .base = PROTOBUF_C_MESSAGE_INIT (&audited__start_res__res__descriptor), .pending_cmd_id = pending_cmd_id, .audit_nonce.data = pending_cmds[pending_cmd_id].audit_nonce, .audit_nonce.len = pending_cmds[pending_cmd_id].audit_nonce_len, .audit_string = audit_string, }; out: if (rv || startres->svc_err) { if (saved_pending_cmd) { audited_release_pending_cmd_id(pending_cmd_id); } else { free(audit_string); if(req) { protobuf_c_message_free_unpacked(req, NULL); } } free(startres->res); startres->res=NULL; } return rv; } audited_err_t audited_execute_cmd(const Audited__ExecuteReq *exec_req, Audited__ExecuteRes *exec_res) { audited_err_t rv; audited_pending_cmd_t *cmd=NULL; ProtobufCMessage *res=NULL; bool got_res=false; if(!did_init) { rv = AUDITED_EBADSTATE; goto out; } cmd = audited_pending_cmd_of_id(exec_req->pending_cmd_id); CHECK(cmd >= 0, AUDITED_EBADCMDHANDLE, "audited_pending_cmd_of_id(%d)", (unsigned int)exec_req->pending_cmd_id); rv = audited_check_cmd_auth(cmd, exec_req->audit_token.data, exec_req->audit_token.len); CHECK_RV(rv, rv, "audited_check_cmd_auth"); assert(cmd->fns); assert(cmd->fns->execute); assert(cmd->fns->res_descriptor); res = malloc(cmd->fns->res_descriptor->sizeof_message); CHECK_MEM(res, AUDITED_ENOMEM); protobuf_c_message_init(cmd->fns->res_descriptor, res); exec_res->svc_err = cmd->fns->execute(cmd->req, res); CHECK_RV((unsigned int)exec_res->svc_err, rv, "execute()"); got_res=true; exec_res->cmd_output.len = protobuf_c_message_get_packed_size(res); exec_res->cmd_output.data = malloc(exec_res->cmd_output.len); CHECK_MEM(exec_res->cmd_output.data, AUDITED_ENOMEM); protobuf_c_message_pack(res, exec_res->cmd_output.data); exec_res->has_cmd_output=true; out: if (got_res && cmd->fns->release_res) { cmd->fns->release_res(res); } if (res) { free(res); res=NULL; } audited_release_pending_cmd_id(exec_req->pending_cmd_id); return rv; }