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