|
|
|
@@ -10,58 +10,75 @@
|
|
|
|
|
#define HACKERS_PROTO_UPB_H__UPB_H_
|
|
|
|
|
|
|
|
|
|
#include "upb/generated_code_support.h"
|
|
|
|
|
|
|
|
|
|
#include "hackers.upb_minitable.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Must be last.
|
|
|
|
|
#include "upb/port/def.inc"
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
typedef struct Tool {
|
|
|
|
|
upb_Message UPB_PRIVATE(base);
|
|
|
|
|
} Tool;
|
|
|
|
|
|
|
|
|
|
typedef struct Connection {
|
|
|
|
|
upb_Message UPB_PRIVATE(base);
|
|
|
|
|
} Connection;
|
|
|
|
|
|
|
|
|
|
typedef struct Hacker {
|
|
|
|
|
upb_Message UPB_PRIVATE(base);
|
|
|
|
|
} Hacker;
|
|
|
|
|
|
|
|
|
|
typedef struct Worm {
|
|
|
|
|
upb_Message UPB_PRIVATE(base);
|
|
|
|
|
} Worm;
|
|
|
|
|
|
|
|
|
|
typedef struct Operation {
|
|
|
|
|
upb_Message UPB_PRIVATE(base);
|
|
|
|
|
} Operation;
|
|
|
|
|
|
|
|
|
|
typedef struct Campaign {
|
|
|
|
|
upb_Message UPB_PRIVATE(base);
|
|
|
|
|
} Campaign;
|
|
|
|
|
|
|
|
|
|
typedef struct Tool { upb_Message UPB_PRIVATE(base); } Tool;
|
|
|
|
|
typedef struct Connection { upb_Message UPB_PRIVATE(base); } Connection;
|
|
|
|
|
typedef struct Hacker { upb_Message UPB_PRIVATE(base); } Hacker;
|
|
|
|
|
typedef struct Worm { upb_Message UPB_PRIVATE(base); } Worm;
|
|
|
|
|
typedef struct Operation { upb_Message UPB_PRIVATE(base); } Operation;
|
|
|
|
|
typedef struct Campaign { upb_Message UPB_PRIVATE(base); } Campaign;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Tool */
|
|
|
|
|
|
|
|
|
|
UPB_INLINE Tool* Tool_new(upb_Arena* arena) {
|
|
|
|
|
return (Tool*)_upb_Message_New(&Tool_msg_init, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Tool* Tool_parse(const char* buf, size_t size, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE Tool* Tool_parse(const char* buf, size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
Tool* ret = Tool_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Tool_msg_init, NULL, 0, arena) !=
|
|
|
|
|
kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Tool* Tool_parse_ex(const char* buf, size_t size,
|
|
|
|
|
const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Tool* ret = Tool_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Tool_msg_init, extreg, options,
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Tool_msg_init, NULL, 0,
|
|
|
|
|
arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Tool_serialize(const Tool* msg, upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE Tool* Tool_parse_ex(
|
|
|
|
|
const char* buf, size_t size, const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Tool* ret = Tool_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Tool_msg_init, extreg,
|
|
|
|
|
options, arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Tool_serialize(const Tool* msg,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Tool_msg_init, 0, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Tool_serialize_ex(const Tool* msg, int options,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE char* Tool_serialize_ex(const Tool* msg,
|
|
|
|
|
int options, upb_Arena* arena,
|
|
|
|
|
size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Tool_msg_init, options, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
@@ -149,37 +166,39 @@ UPB_INLINE void Tool_set_exploit_count(Tool *msg, int32_t value) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Connection */
|
|
|
|
|
|
|
|
|
|
UPB_INLINE Connection* Connection_new(upb_Arena* arena) {
|
|
|
|
|
return (Connection*)_upb_Message_New(&Connection_msg_init, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Connection* Connection_parse(const char* buf, size_t size, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE Connection* Connection_parse(const char* buf, size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
Connection* ret = Connection_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Connection_msg_init, NULL, 0, arena) !=
|
|
|
|
|
kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Connection* Connection_parse_ex(const char* buf, size_t size,
|
|
|
|
|
const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Connection* ret = Connection_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Connection_msg_init, extreg, options,
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Connection_msg_init, NULL, 0,
|
|
|
|
|
arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Connection_serialize(const Connection* msg, upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE Connection* Connection_parse_ex(
|
|
|
|
|
const char* buf, size_t size, const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Connection* ret = Connection_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Connection_msg_init, extreg,
|
|
|
|
|
options, arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Connection_serialize(const Connection* msg,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Connection_msg_init, 0, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Connection_serialize_ex(const Connection* msg, int options,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE char* Connection_serialize_ex(const Connection* msg,
|
|
|
|
|
int options, upb_Arena* arena,
|
|
|
|
|
size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Connection_msg_init, options, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
@@ -267,37 +286,39 @@ UPB_INLINE void Connection_set_session_key(Connection *msg, upb_StringView value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Hacker */
|
|
|
|
|
|
|
|
|
|
UPB_INLINE Hacker* Hacker_new(upb_Arena* arena) {
|
|
|
|
|
return (Hacker*)_upb_Message_New(&Hacker_msg_init, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Hacker* Hacker_parse(const char* buf, size_t size, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE Hacker* Hacker_parse(const char* buf, size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
Hacker* ret = Hacker_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Hacker_msg_init, NULL, 0, arena) !=
|
|
|
|
|
kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Hacker* Hacker_parse_ex(const char* buf, size_t size,
|
|
|
|
|
const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Hacker* ret = Hacker_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Hacker_msg_init, extreg, options,
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Hacker_msg_init, NULL, 0,
|
|
|
|
|
arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Hacker_serialize(const Hacker* msg, upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE Hacker* Hacker_parse_ex(
|
|
|
|
|
const char* buf, size_t size, const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Hacker* ret = Hacker_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Hacker_msg_init, extreg,
|
|
|
|
|
options, arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Hacker_serialize(const Hacker* msg,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Hacker_msg_init, 0, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Hacker_serialize_ex(const Hacker* msg, int options,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE char* Hacker_serialize_ex(const Hacker* msg,
|
|
|
|
|
int options, upb_Arena* arena,
|
|
|
|
|
size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Hacker_msg_init, options, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
@@ -378,7 +399,8 @@ UPB_INLINE void Hacker_clear_exploits(Hacker* msg) {
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_StringView const* Hacker_exploits(const Hacker* msg, size_t* size) {
|
|
|
|
|
UPB_INLINE upb_StringView const* Hacker_exploits(const Hacker* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -389,7 +411,10 @@ UPB_INLINE upb_StringView const* Hacker_exploits(const Hacker* msg, size_t* size
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const upb_Array* _Hacker_exploits_upb_array(const Hacker* msg, size_t* size) {
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
UPB_INLINE const upb_Array* _Hacker_exploits_upb_array(
|
|
|
|
|
const Hacker* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (size) {
|
|
|
|
@@ -397,7 +422,9 @@ UPB_INLINE const upb_Array* _Hacker_exploits_upb_array(const Hacker* msg, size_t
|
|
|
|
|
}
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_Array* _Hacker_exploits_mutable_upb_array(Hacker* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
|
|
|
|
|
UPB_INLINE upb_Array* _Hacker_exploits_mutable_upb_array(
|
|
|
|
|
Hacker* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
|
|
|
|
|
&field, arena);
|
|
|
|
@@ -407,11 +434,12 @@ UPB_INLINE upb_Array* _Hacker_exploits_mutable_upb_array(Hacker* msg, size_t* si
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE void Hacker_clear_tools(Hacker* msg) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const Tool* const* Hacker_tools(const Hacker* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_INLINE const Tool* const* Hacker_tools(const Hacker* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Tool_msg_init);
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -422,8 +450,11 @@ UPB_INLINE const Tool* const* Hacker_tools(const Hacker* msg, size_t* size) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const upb_Array* _Hacker_tools_upb_array(const Hacker* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
UPB_INLINE const upb_Array* _Hacker_tools_upb_array(
|
|
|
|
|
const Hacker* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Tool_msg_init);
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (size) {
|
|
|
|
@@ -431,8 +462,10 @@ UPB_INLINE const upb_Array* _Hacker_tools_upb_array(const Hacker* msg, size_t* s
|
|
|
|
|
}
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_Array* _Hacker_tools_mutable_upb_array(Hacker* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
|
|
|
|
|
UPB_INLINE upb_Array* _Hacker_tools_mutable_upb_array(
|
|
|
|
|
Hacker* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Tool_msg_init);
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
|
|
|
|
|
&field, arena);
|
|
|
|
@@ -442,20 +475,20 @@ UPB_INLINE upb_Array* _Hacker_tools_mutable_upb_array(Hacker* msg, size_t* size,
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE void Hacker_clear_active_connection(Hacker* msg) {
|
|
|
|
|
const upb_MiniTableField field = {9, UPB_SIZE(28, 80), 64, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {9, UPB_SIZE(28, 80), 64, UPB_SIZE(4, 6), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const Connection* Hacker_active_connection(const Hacker* msg) {
|
|
|
|
|
const Connection* default_val = NULL;
|
|
|
|
|
const Connection* ret;
|
|
|
|
|
const upb_MiniTableField field = {9, UPB_SIZE(28, 80), 64, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {9, UPB_SIZE(28, 80), 64, UPB_SIZE(4, 6), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Connection_msg_init);
|
|
|
|
|
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
|
|
|
|
&default_val, &ret);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE bool Hacker_has_active_connection(const Hacker* msg) {
|
|
|
|
|
const upb_MiniTableField field = {9, UPB_SIZE(28, 80), 64, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {9, UPB_SIZE(28, 80), 64, UPB_SIZE(4, 6), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -483,7 +516,8 @@ UPB_INLINE void Hacker_set_crew_id(Hacker *msg, int64_t value) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(48, 56), 0, kUpb_NoSub, 3, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_SetBaseField((upb_Message*)msg, &field, &value);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_StringView* Hacker_mutable_exploits(Hacker* msg, size_t* size) {
|
|
|
|
|
UPB_INLINE upb_StringView* Hacker_mutable_exploits(Hacker* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -494,12 +528,16 @@ UPB_INLINE upb_StringView* Hacker_mutable_exploits(Hacker* msg, size_t* size) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_StringView* Hacker_resize_exploits(Hacker* msg, size_t size, upb_Arena* arena) {
|
|
|
|
|
|
|
|
|
|
UPB_INLINE upb_StringView* Hacker_resize_exploits(Hacker* msg,
|
|
|
|
|
size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
|
|
|
|
|
&field, size, arena);
|
|
|
|
|
return (upb_StringView*)upb_Message_ResizeArrayUninitialized(
|
|
|
|
|
UPB_UPCAST(msg), &field, size, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE bool Hacker_add_exploits(Hacker* msg, upb_StringView val, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE bool Hacker_add_exploits(Hacker* msg, upb_StringView val,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {7, UPB_SIZE(20, 64), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
|
|
|
|
|
UPB_UPCAST(msg), &field, arena);
|
|
|
|
@@ -511,8 +549,9 @@ UPB_INLINE bool Hacker_add_exploits(Hacker* msg, upb_StringView val, upb_Arena*
|
|
|
|
|
(arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Tool** Hacker_mutable_tools(Hacker* msg, size_t* size) {
|
|
|
|
|
upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_INLINE Tool** Hacker_mutable_tools(Hacker* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Tool_msg_init);
|
|
|
|
|
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -523,13 +562,18 @@ UPB_INLINE Tool** Hacker_mutable_tools(Hacker* msg, size_t* size) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Tool** Hacker_resize_tools(Hacker* msg, size_t size, upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
return (Tool**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
|
|
|
|
|
&field, size, arena);
|
|
|
|
|
|
|
|
|
|
UPB_INLINE Tool** Hacker_resize_tools(Hacker* msg,
|
|
|
|
|
size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Tool_msg_init);
|
|
|
|
|
return (Tool**)upb_Message_ResizeArrayUninitialized(
|
|
|
|
|
UPB_UPCAST(msg), &field, size, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE struct Tool* Hacker_add_tools(Hacker* msg, upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_INLINE struct Tool* Hacker_add_tools(
|
|
|
|
|
Hacker* msg, upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {8, UPB_SIZE(24, 72), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Tool_msg_init);
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
|
|
|
|
|
UPB_UPCAST(msg), &field, arena);
|
|
|
|
@@ -537,18 +581,20 @@ UPB_INLINE struct Tool* Hacker_add_tools(Hacker* msg, upb_Arena* arena) {
|
|
|
|
|
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
struct Tool* sub = (struct Tool*)_upb_Message_New(&Tool_msg_init, arena);
|
|
|
|
|
struct Tool* sub =
|
|
|
|
|
(struct Tool*)_upb_Message_New(&Tool_msg_init, arena);
|
|
|
|
|
if (!arr || !sub) return NULL;
|
|
|
|
|
UPB_PRIVATE(_upb_Array_Set)
|
|
|
|
|
(arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
|
|
|
|
|
return sub;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE void Hacker_set_active_connection(Hacker* msg, Connection* value) {
|
|
|
|
|
const upb_MiniTableField field = {9, UPB_SIZE(28, 80), 64, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {9, UPB_SIZE(28, 80), 64, UPB_SIZE(4, 6), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Connection_msg_init);
|
|
|
|
|
upb_Message_SetBaseField((upb_Message*)msg, &field, &value);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE struct Connection* Hacker_mutable_active_connection(Hacker* msg, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE struct Connection* Hacker_mutable_active_connection(
|
|
|
|
|
Hacker* msg, upb_Arena* arena) {
|
|
|
|
|
struct Connection* sub = (struct Connection*)Hacker_active_connection(msg);
|
|
|
|
|
if (sub == NULL) {
|
|
|
|
|
sub = (struct Connection*)_upb_Message_New(&Connection_msg_init, arena);
|
|
|
|
@@ -558,37 +604,39 @@ UPB_INLINE struct Connection* Hacker_mutable_active_connection(Hacker* msg, upb_
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Worm */
|
|
|
|
|
|
|
|
|
|
UPB_INLINE Worm* Worm_new(upb_Arena* arena) {
|
|
|
|
|
return (Worm*)_upb_Message_New(&Worm_msg_init, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Worm* Worm_parse(const char* buf, size_t size, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE Worm* Worm_parse(const char* buf, size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
Worm* ret = Worm_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Worm_msg_init, NULL, 0, arena) !=
|
|
|
|
|
kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Worm* Worm_parse_ex(const char* buf, size_t size,
|
|
|
|
|
const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Worm* ret = Worm_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Worm_msg_init, extreg, options,
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Worm_msg_init, NULL, 0,
|
|
|
|
|
arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Worm_serialize(const Worm* msg, upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE Worm* Worm_parse_ex(
|
|
|
|
|
const char* buf, size_t size, const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Worm* ret = Worm_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Worm_msg_init, extreg,
|
|
|
|
|
options, arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Worm_serialize(const Worm* msg,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Worm_msg_init, 0, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Worm_serialize_ex(const Worm* msg, int options,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE char* Worm_serialize_ex(const Worm* msg,
|
|
|
|
|
int options, upb_Arena* arena,
|
|
|
|
|
size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Worm_msg_init, options, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
@@ -657,7 +705,8 @@ UPB_INLINE void Worm_clear_targets(Worm* msg) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(16, 56), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_StringView const* Worm_targets(const Worm* msg, size_t* size) {
|
|
|
|
|
UPB_INLINE upb_StringView const* Worm_targets(const Worm* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(16, 56), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -668,7 +717,10 @@ UPB_INLINE upb_StringView const* Worm_targets(const Worm* msg, size_t* size) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const upb_Array* _Worm_targets_upb_array(const Worm* msg, size_t* size) {
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
UPB_INLINE const upb_Array* _Worm_targets_upb_array(
|
|
|
|
|
const Worm* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(16, 56), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (size) {
|
|
|
|
@@ -676,7 +728,9 @@ UPB_INLINE const upb_Array* _Worm_targets_upb_array(const Worm* msg, size_t* siz
|
|
|
|
|
}
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_Array* _Worm_targets_mutable_upb_array(Worm* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
|
|
|
|
|
UPB_INLINE upb_Array* _Worm_targets_mutable_upb_array(
|
|
|
|
|
Worm* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(16, 56), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
|
|
|
|
|
&field, arena);
|
|
|
|
@@ -706,7 +760,8 @@ UPB_INLINE void Worm_set_polymorphic(Worm *msg, bool value) {
|
|
|
|
|
const upb_MiniTableField field = {5, 8, 0, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_SetBaseField((upb_Message*)msg, &field, &value);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_StringView* Worm_mutable_targets(Worm* msg, size_t* size) {
|
|
|
|
|
UPB_INLINE upb_StringView* Worm_mutable_targets(Worm* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
upb_MiniTableField field = {6, UPB_SIZE(16, 56), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -717,12 +772,16 @@ UPB_INLINE upb_StringView* Worm_mutable_targets(Worm* msg, size_t* size) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_StringView* Worm_resize_targets(Worm* msg, size_t size, upb_Arena* arena) {
|
|
|
|
|
|
|
|
|
|
UPB_INLINE upb_StringView* Worm_resize_targets(Worm* msg,
|
|
|
|
|
size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {6, UPB_SIZE(16, 56), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
|
|
|
|
|
&field, size, arena);
|
|
|
|
|
return (upb_StringView*)upb_Message_ResizeArrayUninitialized(
|
|
|
|
|
UPB_UPCAST(msg), &field, size, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE bool Worm_add_targets(Worm* msg, upb_StringView val, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE bool Worm_add_targets(Worm* msg, upb_StringView val,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {6, UPB_SIZE(16, 56), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
|
|
|
|
|
UPB_UPCAST(msg), &field, arena);
|
|
|
|
@@ -736,37 +795,39 @@ UPB_INLINE bool Worm_add_targets(Worm* msg, upb_StringView val, upb_Arena* arena
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Operation */
|
|
|
|
|
|
|
|
|
|
UPB_INLINE Operation* Operation_new(upb_Arena* arena) {
|
|
|
|
|
return (Operation*)_upb_Message_New(&Operation_msg_init, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Operation* Operation_parse(const char* buf, size_t size, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE Operation* Operation_parse(const char* buf, size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
Operation* ret = Operation_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Operation_msg_init, NULL, 0, arena) !=
|
|
|
|
|
kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Operation* Operation_parse_ex(const char* buf, size_t size,
|
|
|
|
|
const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Operation* ret = Operation_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Operation_msg_init, extreg, options,
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Operation_msg_init, NULL, 0,
|
|
|
|
|
arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Operation_serialize(const Operation* msg, upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE Operation* Operation_parse_ex(
|
|
|
|
|
const char* buf, size_t size, const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Operation* ret = Operation_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Operation_msg_init, extreg,
|
|
|
|
|
options, arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Operation_serialize(const Operation* msg,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Operation_msg_init, 0, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Operation_serialize_ex(const Operation* msg, int options,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE char* Operation_serialize_ex(const Operation* msg,
|
|
|
|
|
int options, upb_Arena* arena,
|
|
|
|
|
size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Operation_msg_init, options, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
@@ -832,11 +893,12 @@ UPB_INLINE upb_StringView Operation_stolen_data(const Operation* msg) {
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE void Operation_clear_crew(Operation* msg) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, UPB_SIZE(12, 13), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const Hacker* const* Operation_crew(const Operation* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_INLINE const Hacker* const* Operation_crew(const Operation* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, UPB_SIZE(12, 13), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Hacker_msg_init);
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -847,8 +909,11 @@ UPB_INLINE const Hacker* const* Operation_crew(const Operation* msg, size_t* siz
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const upb_Array* _Operation_crew_upb_array(const Operation* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
UPB_INLINE const upb_Array* _Operation_crew_upb_array(
|
|
|
|
|
const Operation* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, UPB_SIZE(12, 13), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Hacker_msg_init);
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (size) {
|
|
|
|
@@ -856,8 +921,10 @@ UPB_INLINE const upb_Array* _Operation_crew_upb_array(const Operation* msg, size
|
|
|
|
|
}
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_Array* _Operation_crew_mutable_upb_array(Operation* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
|
|
|
|
|
UPB_INLINE upb_Array* _Operation_crew_mutable_upb_array(
|
|
|
|
|
Operation* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
const upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, UPB_SIZE(12, 13), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Hacker_msg_init);
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
|
|
|
|
|
&field, arena);
|
|
|
|
@@ -867,27 +934,28 @@ UPB_INLINE upb_Array* _Operation_crew_mutable_upb_array(Operation* msg, size_t*
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE void Operation_clear_worm(Operation* msg) {
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 64, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 64, UPB_SIZE(10, 12), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const Worm* Operation_worm(const Operation* msg) {
|
|
|
|
|
const Worm* default_val = NULL;
|
|
|
|
|
const Worm* ret;
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 64, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 64, UPB_SIZE(10, 12), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Worm_msg_init);
|
|
|
|
|
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
|
|
|
|
|
&default_val, &ret);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE bool Operation_has_worm(const Operation* msg) {
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 64, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 64, UPB_SIZE(10, 12), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE void Operation_clear_log_entries(Operation* msg) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(20, 88), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_StringView const* Operation_log_entries(const Operation* msg, size_t* size) {
|
|
|
|
|
UPB_INLINE upb_StringView const* Operation_log_entries(const Operation* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(20, 88), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -898,7 +966,10 @@ UPB_INLINE upb_StringView const* Operation_log_entries(const Operation* msg, siz
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const upb_Array* _Operation_log_entries_upb_array(const Operation* msg, size_t* size) {
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
UPB_INLINE const upb_Array* _Operation_log_entries_upb_array(
|
|
|
|
|
const Operation* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(20, 88), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (size) {
|
|
|
|
@@ -906,7 +977,9 @@ UPB_INLINE const upb_Array* _Operation_log_entries_upb_array(const Operation* ms
|
|
|
|
|
}
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_Array* _Operation_log_entries_mutable_upb_array(Operation* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
|
|
|
|
|
UPB_INLINE upb_Array* _Operation_log_entries_mutable_upb_array(
|
|
|
|
|
Operation* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
const upb_MiniTableField field = {8, UPB_SIZE(20, 88), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
|
|
|
|
|
&field, arena);
|
|
|
|
@@ -948,8 +1021,9 @@ UPB_INLINE void Operation_set_stolen_data(Operation *msg, upb_StringView value)
|
|
|
|
|
const upb_MiniTableField field = {5, UPB_SIZE(44, 48), 0, kUpb_NoSub, 12, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_SetBaseField((upb_Message*)msg, &field, &value);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Hacker** Operation_mutable_crew(Operation* msg, size_t* size) {
|
|
|
|
|
upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_INLINE Hacker** Operation_mutable_crew(Operation* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, UPB_SIZE(12, 13), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Hacker_msg_init);
|
|
|
|
|
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -960,13 +1034,18 @@ UPB_INLINE Hacker** Operation_mutable_crew(Operation* msg, size_t* size) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Hacker** Operation_resize_crew(Operation* msg, size_t size, upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
return (Hacker**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
|
|
|
|
|
&field, size, arena);
|
|
|
|
|
|
|
|
|
|
UPB_INLINE Hacker** Operation_resize_crew(Operation* msg,
|
|
|
|
|
size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, UPB_SIZE(12, 13), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Hacker_msg_init);
|
|
|
|
|
return (Hacker**)upb_Message_ResizeArrayUninitialized(
|
|
|
|
|
UPB_UPCAST(msg), &field, size, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE struct Hacker* Operation_add_crew(Operation* msg, upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_INLINE struct Hacker* Operation_add_crew(
|
|
|
|
|
Operation* msg, upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {6, UPB_SIZE(12, 72), 0, UPB_SIZE(12, 13), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Hacker_msg_init);
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
|
|
|
|
|
UPB_UPCAST(msg), &field, arena);
|
|
|
|
@@ -974,18 +1053,20 @@ UPB_INLINE struct Hacker* Operation_add_crew(Operation* msg, upb_Arena* arena) {
|
|
|
|
|
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
struct Hacker* sub = (struct Hacker*)_upb_Message_New(&Hacker_msg_init, arena);
|
|
|
|
|
struct Hacker* sub =
|
|
|
|
|
(struct Hacker*)_upb_Message_New(&Hacker_msg_init, arena);
|
|
|
|
|
if (!arr || !sub) return NULL;
|
|
|
|
|
UPB_PRIVATE(_upb_Array_Set)
|
|
|
|
|
(arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
|
|
|
|
|
return sub;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE void Operation_set_worm(Operation* msg, Worm* value) {
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 64, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {7, UPB_SIZE(16, 80), 64, UPB_SIZE(10, 12), 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Worm_msg_init);
|
|
|
|
|
upb_Message_SetBaseField((upb_Message*)msg, &field, &value);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE struct Worm* Operation_mutable_worm(Operation* msg, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE struct Worm* Operation_mutable_worm(
|
|
|
|
|
Operation* msg, upb_Arena* arena) {
|
|
|
|
|
struct Worm* sub = (struct Worm*)Operation_worm(msg);
|
|
|
|
|
if (sub == NULL) {
|
|
|
|
|
sub = (struct Worm*)_upb_Message_New(&Worm_msg_init, arena);
|
|
|
|
@@ -993,7 +1074,8 @@ UPB_INLINE struct Worm* Operation_mutable_worm(Operation* msg, upb_Arena* arena)
|
|
|
|
|
}
|
|
|
|
|
return sub;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_StringView* Operation_mutable_log_entries(Operation* msg, size_t* size) {
|
|
|
|
|
UPB_INLINE upb_StringView* Operation_mutable_log_entries(Operation* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
upb_MiniTableField field = {8, UPB_SIZE(20, 88), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -1004,12 +1086,16 @@ UPB_INLINE upb_StringView* Operation_mutable_log_entries(Operation* msg, size_t*
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_StringView* Operation_resize_log_entries(Operation* msg, size_t size, upb_Arena* arena) {
|
|
|
|
|
|
|
|
|
|
UPB_INLINE upb_StringView* Operation_resize_log_entries(Operation* msg,
|
|
|
|
|
size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {8, UPB_SIZE(20, 88), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
|
|
|
|
|
&field, size, arena);
|
|
|
|
|
return (upb_StringView*)upb_Message_ResizeArrayUninitialized(
|
|
|
|
|
UPB_UPCAST(msg), &field, size, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE bool Operation_add_log_entries(Operation* msg, upb_StringView val, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE bool Operation_add_log_entries(Operation* msg, upb_StringView val,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {8, UPB_SIZE(20, 88), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
|
|
|
|
|
UPB_UPCAST(msg), &field, arena);
|
|
|
|
@@ -1027,37 +1113,39 @@ UPB_INLINE void Operation_set_severity(Operation *msg, int32_t value) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Campaign */
|
|
|
|
|
|
|
|
|
|
UPB_INLINE Campaign* Campaign_new(upb_Arena* arena) {
|
|
|
|
|
return (Campaign*)_upb_Message_New(&Campaign_msg_init, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Campaign* Campaign_parse(const char* buf, size_t size, upb_Arena* arena) {
|
|
|
|
|
UPB_INLINE Campaign* Campaign_parse(const char* buf, size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
Campaign* ret = Campaign_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Campaign_msg_init, NULL, 0, arena) !=
|
|
|
|
|
kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Campaign* Campaign_parse_ex(const char* buf, size_t size,
|
|
|
|
|
const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Campaign* ret = Campaign_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Campaign_msg_init, extreg, options,
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Campaign_msg_init, NULL, 0,
|
|
|
|
|
arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Campaign_serialize(const Campaign* msg, upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE Campaign* Campaign_parse_ex(
|
|
|
|
|
const char* buf, size_t size, const upb_ExtensionRegistry* extreg,
|
|
|
|
|
int options, upb_Arena* arena) {
|
|
|
|
|
Campaign* ret = Campaign_new(arena);
|
|
|
|
|
if (!ret) return NULL;
|
|
|
|
|
if (upb_Decode(buf, size, UPB_UPCAST(ret), &Campaign_msg_init, extreg,
|
|
|
|
|
options, arena) != kUpb_DecodeStatus_Ok) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Campaign_serialize(const Campaign* msg,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Campaign_msg_init, 0, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE char* Campaign_serialize_ex(const Campaign* msg, int options,
|
|
|
|
|
upb_Arena* arena, size_t* len) {
|
|
|
|
|
UPB_INLINE char* Campaign_serialize_ex(const Campaign* msg,
|
|
|
|
|
int options, upb_Arena* arena,
|
|
|
|
|
size_t* len) {
|
|
|
|
|
char* ptr;
|
|
|
|
|
(void)upb_Encode(UPB_UPCAST(msg), &Campaign_msg_init, options, arena, &ptr, len);
|
|
|
|
|
return ptr;
|
|
|
|
@@ -1075,11 +1163,12 @@ UPB_INLINE upb_StringView Campaign_name(const Campaign* msg) {
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE void Campaign_clear_operations(Campaign* msg) {
|
|
|
|
|
const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const Operation* const* Campaign_operations(const Campaign* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_INLINE const Operation* const* Campaign_operations(const Campaign* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Operation_msg_init);
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -1090,8 +1179,11 @@ UPB_INLINE const Operation* const* Campaign_operations(const Campaign* msg, size
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE const upb_Array* _Campaign_operations_upb_array(const Campaign* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
UPB_INLINE const upb_Array* _Campaign_operations_upb_array(
|
|
|
|
|
const Campaign* msg, size_t* size) {
|
|
|
|
|
const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Operation_msg_init);
|
|
|
|
|
const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (size) {
|
|
|
|
@@ -1099,8 +1191,10 @@ UPB_INLINE const upb_Array* _Campaign_operations_upb_array(const Campaign* msg,
|
|
|
|
|
}
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE upb_Array* _Campaign_operations_mutable_upb_array(Campaign* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
|
|
|
|
|
UPB_INLINE upb_Array* _Campaign_operations_mutable_upb_array(
|
|
|
|
|
Campaign* msg, size_t* size, upb_Arena* arena) {
|
|
|
|
|
const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Operation_msg_init);
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
|
|
|
|
|
&field, arena);
|
|
|
|
@@ -1126,8 +1220,9 @@ UPB_INLINE void Campaign_set_name(Campaign *msg, upb_StringView value) {
|
|
|
|
|
const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
|
|
|
|
|
upb_Message_SetBaseField((upb_Message*)msg, &field, &value);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Operation** Campaign_mutable_operations(Campaign* msg, size_t* size) {
|
|
|
|
|
upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_INLINE Operation** Campaign_mutable_operations(Campaign* msg,
|
|
|
|
|
size_t* size) {
|
|
|
|
|
upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Operation_msg_init);
|
|
|
|
|
upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
|
|
|
|
|
if (arr) {
|
|
|
|
@@ -1138,13 +1233,18 @@ UPB_INLINE Operation** Campaign_mutable_operations(Campaign* msg, size_t* size)
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE Operation** Campaign_resize_operations(Campaign* msg, size_t size, upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
return (Operation**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
|
|
|
|
|
&field, size, arena);
|
|
|
|
|
|
|
|
|
|
UPB_INLINE Operation** Campaign_resize_operations(Campaign* msg,
|
|
|
|
|
size_t size,
|
|
|
|
|
upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Operation_msg_init);
|
|
|
|
|
return (Operation**)upb_Message_ResizeArrayUninitialized(
|
|
|
|
|
UPB_UPCAST(msg), &field, size, arena);
|
|
|
|
|
}
|
|
|
|
|
UPB_INLINE struct Operation* Campaign_add_operations(Campaign* msg, upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_INLINE struct Operation* Campaign_add_operations(
|
|
|
|
|
Campaign* msg, upb_Arena* arena) {
|
|
|
|
|
upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, UPB_SIZE(6, 7), 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
|
|
|
|
|
UPB_PRIVATE(_upb_MiniTable_StrongReference)(&Operation_msg_init);
|
|
|
|
|
upb_Array* arr = upb_Message_GetOrCreateMutableArray(
|
|
|
|
|
UPB_UPCAST(msg), &field, arena);
|
|
|
|
@@ -1152,7 +1252,8 @@ UPB_INLINE struct Operation* Campaign_add_operations(Campaign* msg, upb_Arena* a
|
|
|
|
|
arr, arr->UPB_PRIVATE(size) + 1, arena)) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
struct Operation* sub = (struct Operation*)_upb_Message_New(&Operation_msg_init, arena);
|
|
|
|
|
struct Operation* sub =
|
|
|
|
|
(struct Operation*)_upb_Message_New(&Operation_msg_init, arena);
|
|
|
|
|
if (!arr || !sub) return NULL;
|
|
|
|
|
UPB_PRIVATE(_upb_Array_Set)
|
|
|
|
|
(arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
|
|
|
|
|