1052d159aSCy Schubert /* 2*2d4e511cSCy Schubert * Automatically generated from /ntpbuild/data/snaps/ntp-stable/sntp/libevent/test/regress.rpc 3052d159aSCy Schubert */ 4052d159aSCy Schubert 5*2d4e511cSCy Schubert #ifndef EVENT_RPCOUT__NTPBUILD_DATA_SNAPS_NTP_STABLE_SNTP_LIBEVENT_TEST_REGRESS_RPC_ 6*2d4e511cSCy Schubert #define EVENT_RPCOUT__NTPBUILD_DATA_SNAPS_NTP_STABLE_SNTP_LIBEVENT_TEST_REGRESS_RPC_ 7052d159aSCy Schubert 8052d159aSCy Schubert #include <event2/util.h> /* for ev_uint*_t */ 9052d159aSCy Schubert #include <event2/rpc.h> 10052d159aSCy Schubert 11052d159aSCy Schubert struct msg; 12052d159aSCy Schubert struct kill; 13052d159aSCy Schubert struct run; 14052d159aSCy Schubert 15052d159aSCy Schubert /* Tag definition for msg */ 16052d159aSCy Schubert enum msg_ { 17052d159aSCy Schubert MSG_FROM_NAME=1, 18052d159aSCy Schubert MSG_TO_NAME=2, 19052d159aSCy Schubert MSG_ATTACK=3, 20052d159aSCy Schubert MSG_RUN=4, 21052d159aSCy Schubert MSG_MAX_TAGS 22052d159aSCy Schubert }; 23052d159aSCy Schubert 24052d159aSCy Schubert /* Structure declaration for msg */ 25052d159aSCy Schubert struct msg_access_ { 26052d159aSCy Schubert int (*from_name_assign)(struct msg *, const char *); 27052d159aSCy Schubert int (*from_name_get)(struct msg *, char * *); 28052d159aSCy Schubert int (*to_name_assign)(struct msg *, const char *); 29052d159aSCy Schubert int (*to_name_get)(struct msg *, char * *); 30052d159aSCy Schubert int (*attack_assign)(struct msg *, const struct kill*); 31052d159aSCy Schubert int (*attack_get)(struct msg *, struct kill* *); 32052d159aSCy Schubert int (*run_assign)(struct msg *, int, const struct run*); 33052d159aSCy Schubert int (*run_get)(struct msg *, int, struct run* *); 34052d159aSCy Schubert struct run* (*run_add)(struct msg *msg); 35052d159aSCy Schubert }; 36052d159aSCy Schubert 37052d159aSCy Schubert struct msg { 38052d159aSCy Schubert struct msg_access_ *base; 39052d159aSCy Schubert 40052d159aSCy Schubert char *from_name_data; 41052d159aSCy Schubert char *to_name_data; 42052d159aSCy Schubert struct kill* attack_data; 43052d159aSCy Schubert struct run* *run_data; 44052d159aSCy Schubert int run_length; 45052d159aSCy Schubert int run_num_allocated; 46052d159aSCy Schubert 47052d159aSCy Schubert ev_uint8_t from_name_set; 48052d159aSCy Schubert ev_uint8_t to_name_set; 49052d159aSCy Schubert ev_uint8_t attack_set; 50052d159aSCy Schubert ev_uint8_t run_set; 51052d159aSCy Schubert }; 52052d159aSCy Schubert 53052d159aSCy Schubert struct msg *msg_new(void); 54052d159aSCy Schubert struct msg *msg_new_with_arg(void *); 55052d159aSCy Schubert void msg_free(struct msg *); 56052d159aSCy Schubert void msg_clear(struct msg *); 57052d159aSCy Schubert void msg_marshal(struct evbuffer *, const struct msg *); 58052d159aSCy Schubert int msg_unmarshal(struct msg *, struct evbuffer *); 59052d159aSCy Schubert int msg_complete(struct msg *); 60052d159aSCy Schubert void evtag_marshal_msg(struct evbuffer *, ev_uint32_t, 61052d159aSCy Schubert const struct msg *); 62052d159aSCy Schubert int evtag_unmarshal_msg(struct evbuffer *, ev_uint32_t, 63052d159aSCy Schubert struct msg *); 64052d159aSCy Schubert int msg_from_name_assign(struct msg *, const char *); 65052d159aSCy Schubert int msg_from_name_get(struct msg *, char * *); 66052d159aSCy Schubert int msg_to_name_assign(struct msg *, const char *); 67052d159aSCy Schubert int msg_to_name_get(struct msg *, char * *); 68052d159aSCy Schubert int msg_attack_assign(struct msg *, const struct kill*); 69052d159aSCy Schubert int msg_attack_get(struct msg *, struct kill* *); 70052d159aSCy Schubert int msg_run_assign(struct msg *, int, const struct run*); 71052d159aSCy Schubert int msg_run_get(struct msg *, int, struct run* *); 72052d159aSCy Schubert struct run* msg_run_add(struct msg *msg); 73052d159aSCy Schubert /* --- msg done --- */ 74052d159aSCy Schubert 75052d159aSCy Schubert /* Tag definition for kill */ 76052d159aSCy Schubert enum kill_ { 77052d159aSCy Schubert KILL_WEAPON=65825, 78052d159aSCy Schubert KILL_ACTION=2, 79052d159aSCy Schubert KILL_HOW_OFTEN=3, 80052d159aSCy Schubert KILL_MAX_TAGS 81052d159aSCy Schubert }; 82052d159aSCy Schubert 83052d159aSCy Schubert /* Structure declaration for kill */ 84052d159aSCy Schubert struct kill_access_ { 85052d159aSCy Schubert int (*weapon_assign)(struct kill *, const char *); 86052d159aSCy Schubert int (*weapon_get)(struct kill *, char * *); 87052d159aSCy Schubert int (*action_assign)(struct kill *, const char *); 88052d159aSCy Schubert int (*action_get)(struct kill *, char * *); 89052d159aSCy Schubert int (*how_often_assign)(struct kill *, int, const ev_uint32_t); 90052d159aSCy Schubert int (*how_often_get)(struct kill *, int, ev_uint32_t *); 91052d159aSCy Schubert ev_uint32_t * (*how_often_add)(struct kill *msg, const ev_uint32_t value); 92052d159aSCy Schubert }; 93052d159aSCy Schubert 94052d159aSCy Schubert struct kill { 95052d159aSCy Schubert struct kill_access_ *base; 96052d159aSCy Schubert 97052d159aSCy Schubert char *weapon_data; 98052d159aSCy Schubert char *action_data; 99052d159aSCy Schubert ev_uint32_t *how_often_data; 100052d159aSCy Schubert int how_often_length; 101052d159aSCy Schubert int how_often_num_allocated; 102052d159aSCy Schubert 103052d159aSCy Schubert ev_uint8_t weapon_set; 104052d159aSCy Schubert ev_uint8_t action_set; 105052d159aSCy Schubert ev_uint8_t how_often_set; 106052d159aSCy Schubert }; 107052d159aSCy Schubert 108052d159aSCy Schubert struct kill *kill_new(void); 109052d159aSCy Schubert struct kill *kill_new_with_arg(void *); 110052d159aSCy Schubert void kill_free(struct kill *); 111052d159aSCy Schubert void kill_clear(struct kill *); 112052d159aSCy Schubert void kill_marshal(struct evbuffer *, const struct kill *); 113052d159aSCy Schubert int kill_unmarshal(struct kill *, struct evbuffer *); 114052d159aSCy Schubert int kill_complete(struct kill *); 115052d159aSCy Schubert void evtag_marshal_kill(struct evbuffer *, ev_uint32_t, 116052d159aSCy Schubert const struct kill *); 117052d159aSCy Schubert int evtag_unmarshal_kill(struct evbuffer *, ev_uint32_t, 118052d159aSCy Schubert struct kill *); 119052d159aSCy Schubert int kill_weapon_assign(struct kill *, const char *); 120052d159aSCy Schubert int kill_weapon_get(struct kill *, char * *); 121052d159aSCy Schubert int kill_action_assign(struct kill *, const char *); 122052d159aSCy Schubert int kill_action_get(struct kill *, char * *); 123052d159aSCy Schubert int kill_how_often_assign(struct kill *, int, const ev_uint32_t); 124052d159aSCy Schubert int kill_how_often_get(struct kill *, int, ev_uint32_t *); 125052d159aSCy Schubert ev_uint32_t * kill_how_often_add(struct kill *msg, const ev_uint32_t value); 126052d159aSCy Schubert /* --- kill done --- */ 127052d159aSCy Schubert 128052d159aSCy Schubert /* Tag definition for run */ 129052d159aSCy Schubert enum run_ { 130052d159aSCy Schubert RUN_HOW=1, 131052d159aSCy Schubert RUN_SOME_BYTES=2, 132052d159aSCy Schubert RUN_FIXED_BYTES=3, 133052d159aSCy Schubert RUN_NOTES=4, 134052d159aSCy Schubert RUN_LARGE_NUMBER=5, 135052d159aSCy Schubert RUN_OTHER_NUMBERS=6, 136052d159aSCy Schubert RUN_MAX_TAGS 137052d159aSCy Schubert }; 138052d159aSCy Schubert 139052d159aSCy Schubert /* Structure declaration for run */ 140052d159aSCy Schubert struct run_access_ { 141052d159aSCy Schubert int (*how_assign)(struct run *, const char *); 142052d159aSCy Schubert int (*how_get)(struct run *, char * *); 143052d159aSCy Schubert int (*some_bytes_assign)(struct run *, const ev_uint8_t *, ev_uint32_t); 144052d159aSCy Schubert int (*some_bytes_get)(struct run *, ev_uint8_t * *, ev_uint32_t *); 145052d159aSCy Schubert int (*fixed_bytes_assign)(struct run *, const ev_uint8_t *); 146052d159aSCy Schubert int (*fixed_bytes_get)(struct run *, ev_uint8_t **); 147052d159aSCy Schubert int (*notes_assign)(struct run *, int, const char *); 148052d159aSCy Schubert int (*notes_get)(struct run *, int, char * *); 149052d159aSCy Schubert char * * (*notes_add)(struct run *msg, const char * value); 150052d159aSCy Schubert int (*large_number_assign)(struct run *, const ev_uint64_t); 151052d159aSCy Schubert int (*large_number_get)(struct run *, ev_uint64_t *); 152052d159aSCy Schubert int (*other_numbers_assign)(struct run *, int, const ev_uint32_t); 153052d159aSCy Schubert int (*other_numbers_get)(struct run *, int, ev_uint32_t *); 154052d159aSCy Schubert ev_uint32_t * (*other_numbers_add)(struct run *msg, const ev_uint32_t value); 155052d159aSCy Schubert }; 156052d159aSCy Schubert 157052d159aSCy Schubert struct run { 158052d159aSCy Schubert struct run_access_ *base; 159052d159aSCy Schubert 160052d159aSCy Schubert char *how_data; 161052d159aSCy Schubert ev_uint8_t *some_bytes_data; 162052d159aSCy Schubert ev_uint32_t some_bytes_length; 163052d159aSCy Schubert ev_uint8_t fixed_bytes_data[24]; 164052d159aSCy Schubert char * *notes_data; 165052d159aSCy Schubert int notes_length; 166052d159aSCy Schubert int notes_num_allocated; 167052d159aSCy Schubert ev_uint64_t large_number_data; 168052d159aSCy Schubert ev_uint32_t *other_numbers_data; 169052d159aSCy Schubert int other_numbers_length; 170052d159aSCy Schubert int other_numbers_num_allocated; 171052d159aSCy Schubert 172052d159aSCy Schubert ev_uint8_t how_set; 173052d159aSCy Schubert ev_uint8_t some_bytes_set; 174052d159aSCy Schubert ev_uint8_t fixed_bytes_set; 175052d159aSCy Schubert ev_uint8_t notes_set; 176052d159aSCy Schubert ev_uint8_t large_number_set; 177052d159aSCy Schubert ev_uint8_t other_numbers_set; 178052d159aSCy Schubert }; 179052d159aSCy Schubert 180052d159aSCy Schubert struct run *run_new(void); 181052d159aSCy Schubert struct run *run_new_with_arg(void *); 182052d159aSCy Schubert void run_free(struct run *); 183052d159aSCy Schubert void run_clear(struct run *); 184052d159aSCy Schubert void run_marshal(struct evbuffer *, const struct run *); 185052d159aSCy Schubert int run_unmarshal(struct run *, struct evbuffer *); 186052d159aSCy Schubert int run_complete(struct run *); 187052d159aSCy Schubert void evtag_marshal_run(struct evbuffer *, ev_uint32_t, 188052d159aSCy Schubert const struct run *); 189052d159aSCy Schubert int evtag_unmarshal_run(struct evbuffer *, ev_uint32_t, 190052d159aSCy Schubert struct run *); 191052d159aSCy Schubert int run_how_assign(struct run *, const char *); 192052d159aSCy Schubert int run_how_get(struct run *, char * *); 193052d159aSCy Schubert int run_some_bytes_assign(struct run *, const ev_uint8_t *, ev_uint32_t); 194052d159aSCy Schubert int run_some_bytes_get(struct run *, ev_uint8_t * *, ev_uint32_t *); 195052d159aSCy Schubert int run_fixed_bytes_assign(struct run *, const ev_uint8_t *); 196052d159aSCy Schubert int run_fixed_bytes_get(struct run *, ev_uint8_t **); 197052d159aSCy Schubert int run_notes_assign(struct run *, int, const char *); 198052d159aSCy Schubert int run_notes_get(struct run *, int, char * *); 199052d159aSCy Schubert char * * run_notes_add(struct run *msg, const char * value); 200052d159aSCy Schubert int run_large_number_assign(struct run *, const ev_uint64_t); 201052d159aSCy Schubert int run_large_number_get(struct run *, ev_uint64_t *); 202052d159aSCy Schubert int run_other_numbers_assign(struct run *, int, const ev_uint32_t); 203052d159aSCy Schubert int run_other_numbers_get(struct run *, int, ev_uint32_t *); 204052d159aSCy Schubert ev_uint32_t * run_other_numbers_add(struct run *msg, const ev_uint32_t value); 205052d159aSCy Schubert /* --- run done --- */ 206052d159aSCy Schubert 207*2d4e511cSCy Schubert #endif /* EVENT_RPCOUT__NTPBUILD_DATA_SNAPS_NTP_STABLE_SNTP_LIBEVENT_TEST_REGRESS_RPC_ */ 208