xref: /netbsd-src/external/bsd/ntp/dist/sntp/libevent/test/regress.gen.h (revision eabc0478de71e4e011a5b4e0392741e01d491794)
1*eabc0478Schristos /*	$NetBSD: regress.gen.h,v 1.7 2024/08/18 20:47:23 christos Exp $	*/
2*eabc0478Schristos 
3b8ecfcfeSchristos 
4cdfa2a7eSchristos /*
5cdfa2a7eSchristos  * Automatically generated from /ntpbuild/data/snaps/ntp-stable/sntp/libevent/test/regress.rpc
6cdfa2a7eSchristos  */
7cdfa2a7eSchristos 
8cdfa2a7eSchristos #ifndef EVENT_RPCOUT__NTPBUILD_DATA_SNAPS_NTP_STABLE_SNTP_LIBEVENT_TEST_REGRESS_RPC_
9cdfa2a7eSchristos #define EVENT_RPCOUT__NTPBUILD_DATA_SNAPS_NTP_STABLE_SNTP_LIBEVENT_TEST_REGRESS_RPC_
10cdfa2a7eSchristos 
11*eabc0478Schristos 
12cdfa2a7eSchristos #include <event2/util.h> /* for ev_uint*_t */
13cdfa2a7eSchristos #include <event2/rpc.h>
14cdfa2a7eSchristos struct msg;
15cdfa2a7eSchristos struct kill;
16cdfa2a7eSchristos struct run;
17cdfa2a7eSchristos 
18cdfa2a7eSchristos /* Tag definition for msg */
19cdfa2a7eSchristos enum msg_ {
20cdfa2a7eSchristos   MSG_FROM_NAME=1,
21cdfa2a7eSchristos   MSG_TO_NAME=2,
22cdfa2a7eSchristos   MSG_ATTACK=3,
23cdfa2a7eSchristos   MSG_RUN=4,
24cdfa2a7eSchristos   MSG_MAX_TAGS
25cdfa2a7eSchristos };
26cdfa2a7eSchristos 
27cdfa2a7eSchristos /* Structure declaration for msg */
28cdfa2a7eSchristos struct msg_access_ {
29cdfa2a7eSchristos   int (*from_name_assign)(struct msg *, const char *);
30cdfa2a7eSchristos   int (*from_name_get)(struct msg *, char * *);
31cdfa2a7eSchristos   int (*to_name_assign)(struct msg *, const char *);
32cdfa2a7eSchristos   int (*to_name_get)(struct msg *, char * *);
33cdfa2a7eSchristos   int (*attack_assign)(struct msg *, const struct kill*);
34cdfa2a7eSchristos   int (*attack_get)(struct msg *, struct kill* *);
35cdfa2a7eSchristos   int (*run_assign)(struct msg *, int, const struct run*);
36cdfa2a7eSchristos   int (*run_get)(struct msg *, int, struct run* *);
37cdfa2a7eSchristos   struct run*  (*run_add)(struct msg *msg);
38cdfa2a7eSchristos };
39cdfa2a7eSchristos 
40cdfa2a7eSchristos struct msg {
41cdfa2a7eSchristos   struct msg_access_ *base;
42cdfa2a7eSchristos 
43cdfa2a7eSchristos   char *from_name_data;
44cdfa2a7eSchristos   char *to_name_data;
45cdfa2a7eSchristos   struct kill* attack_data;
46cdfa2a7eSchristos   struct run* *run_data;
47cdfa2a7eSchristos   int run_length;
48cdfa2a7eSchristos   int run_num_allocated;
49cdfa2a7eSchristos 
50cdfa2a7eSchristos   ev_uint8_t from_name_set;
51cdfa2a7eSchristos   ev_uint8_t to_name_set;
52cdfa2a7eSchristos   ev_uint8_t attack_set;
53cdfa2a7eSchristos   ev_uint8_t run_set;
54cdfa2a7eSchristos };
55cdfa2a7eSchristos 
56cdfa2a7eSchristos struct msg *msg_new(void);
57cdfa2a7eSchristos struct msg *msg_new_with_arg(void *);
58cdfa2a7eSchristos void msg_free(struct msg *);
59cdfa2a7eSchristos void msg_clear(struct msg *);
60cdfa2a7eSchristos void msg_marshal(struct evbuffer *, const struct msg *);
61cdfa2a7eSchristos int msg_unmarshal(struct msg *, struct evbuffer *);
62cdfa2a7eSchristos int msg_complete(struct msg *);
63cdfa2a7eSchristos void evtag_marshal_msg(struct evbuffer *, ev_uint32_t,
64cdfa2a7eSchristos     const struct msg *);
65cdfa2a7eSchristos int evtag_unmarshal_msg(struct evbuffer *, ev_uint32_t,
66cdfa2a7eSchristos     struct msg *);
67cdfa2a7eSchristos int msg_from_name_assign(struct msg *, const char *);
68cdfa2a7eSchristos int msg_from_name_get(struct msg *, char * *);
69cdfa2a7eSchristos int msg_to_name_assign(struct msg *, const char *);
70cdfa2a7eSchristos int msg_to_name_get(struct msg *, char * *);
71cdfa2a7eSchristos int msg_attack_assign(struct msg *, const struct kill*);
72cdfa2a7eSchristos int msg_attack_get(struct msg *, struct kill* *);
73cdfa2a7eSchristos int msg_run_assign(struct msg *, int, const struct run*);
74cdfa2a7eSchristos int msg_run_get(struct msg *, int, struct run* *);
75cdfa2a7eSchristos struct run*  msg_run_add(struct msg *msg);
76cdfa2a7eSchristos /* --- msg done --- */
77cdfa2a7eSchristos 
78cdfa2a7eSchristos /* Tag definition for kill */
79cdfa2a7eSchristos enum kill_ {
80cdfa2a7eSchristos   KILL_WEAPON=65825,
81cdfa2a7eSchristos   KILL_ACTION=2,
82cdfa2a7eSchristos   KILL_HOW_OFTEN=3,
83cdfa2a7eSchristos   KILL_MAX_TAGS
84cdfa2a7eSchristos };
85cdfa2a7eSchristos 
86cdfa2a7eSchristos /* Structure declaration for kill */
87cdfa2a7eSchristos struct kill_access_ {
88cdfa2a7eSchristos   int (*weapon_assign)(struct kill *, const char *);
89cdfa2a7eSchristos   int (*weapon_get)(struct kill *, char * *);
90cdfa2a7eSchristos   int (*action_assign)(struct kill *, const char *);
91cdfa2a7eSchristos   int (*action_get)(struct kill *, char * *);
92cdfa2a7eSchristos   int (*how_often_assign)(struct kill *, int, const ev_uint32_t);
93cdfa2a7eSchristos   int (*how_often_get)(struct kill *, int, ev_uint32_t *);
94cdfa2a7eSchristos   ev_uint32_t * (*how_often_add)(struct kill *msg, const ev_uint32_t value);
95cdfa2a7eSchristos };
96cdfa2a7eSchristos 
97cdfa2a7eSchristos struct kill {
98cdfa2a7eSchristos   struct kill_access_ *base;
99cdfa2a7eSchristos 
100cdfa2a7eSchristos   char *weapon_data;
101cdfa2a7eSchristos   char *action_data;
102cdfa2a7eSchristos   ev_uint32_t *how_often_data;
103cdfa2a7eSchristos   int how_often_length;
104cdfa2a7eSchristos   int how_often_num_allocated;
105cdfa2a7eSchristos 
106cdfa2a7eSchristos   ev_uint8_t weapon_set;
107cdfa2a7eSchristos   ev_uint8_t action_set;
108cdfa2a7eSchristos   ev_uint8_t how_often_set;
109cdfa2a7eSchristos };
110cdfa2a7eSchristos 
111cdfa2a7eSchristos struct kill *kill_new(void);
112cdfa2a7eSchristos struct kill *kill_new_with_arg(void *);
113cdfa2a7eSchristos void kill_free(struct kill *);
114cdfa2a7eSchristos void kill_clear(struct kill *);
115cdfa2a7eSchristos void kill_marshal(struct evbuffer *, const struct kill *);
116cdfa2a7eSchristos int kill_unmarshal(struct kill *, struct evbuffer *);
117cdfa2a7eSchristos int kill_complete(struct kill *);
118cdfa2a7eSchristos void evtag_marshal_kill(struct evbuffer *, ev_uint32_t,
119cdfa2a7eSchristos     const struct kill *);
120cdfa2a7eSchristos int evtag_unmarshal_kill(struct evbuffer *, ev_uint32_t,
121cdfa2a7eSchristos     struct kill *);
122cdfa2a7eSchristos int kill_weapon_assign(struct kill *, const char *);
123cdfa2a7eSchristos int kill_weapon_get(struct kill *, char * *);
124cdfa2a7eSchristos int kill_action_assign(struct kill *, const char *);
125cdfa2a7eSchristos int kill_action_get(struct kill *, char * *);
126cdfa2a7eSchristos int kill_how_often_assign(struct kill *, int, const ev_uint32_t);
127cdfa2a7eSchristos int kill_how_often_get(struct kill *, int, ev_uint32_t *);
128cdfa2a7eSchristos ev_uint32_t * kill_how_often_add(struct kill *msg, const ev_uint32_t value);
129cdfa2a7eSchristos /* --- kill done --- */
130cdfa2a7eSchristos 
131cdfa2a7eSchristos /* Tag definition for run */
132cdfa2a7eSchristos enum run_ {
133cdfa2a7eSchristos   RUN_HOW=1,
134cdfa2a7eSchristos   RUN_SOME_BYTES=2,
135cdfa2a7eSchristos   RUN_FIXED_BYTES=3,
136cdfa2a7eSchristos   RUN_NOTES=4,
137cdfa2a7eSchristos   RUN_LARGE_NUMBER=5,
138cdfa2a7eSchristos   RUN_OTHER_NUMBERS=6,
139cdfa2a7eSchristos   RUN_MAX_TAGS
140cdfa2a7eSchristos };
141cdfa2a7eSchristos 
142cdfa2a7eSchristos /* Structure declaration for run */
143cdfa2a7eSchristos struct run_access_ {
144cdfa2a7eSchristos   int (*how_assign)(struct run *, const char *);
145cdfa2a7eSchristos   int (*how_get)(struct run *, char * *);
146cdfa2a7eSchristos   int (*some_bytes_assign)(struct run *, const ev_uint8_t *, ev_uint32_t);
147cdfa2a7eSchristos   int (*some_bytes_get)(struct run *, ev_uint8_t * *, ev_uint32_t *);
148cdfa2a7eSchristos   int (*fixed_bytes_assign)(struct run *, const ev_uint8_t *);
149cdfa2a7eSchristos   int (*fixed_bytes_get)(struct run *, ev_uint8_t **);
150cdfa2a7eSchristos   int (*notes_assign)(struct run *, int, const char *);
151cdfa2a7eSchristos   int (*notes_get)(struct run *, int, char * *);
152cdfa2a7eSchristos   char * * (*notes_add)(struct run *msg, const char * value);
153cdfa2a7eSchristos   int (*large_number_assign)(struct run *, const ev_uint64_t);
154cdfa2a7eSchristos   int (*large_number_get)(struct run *, ev_uint64_t *);
155cdfa2a7eSchristos   int (*other_numbers_assign)(struct run *, int, const ev_uint32_t);
156cdfa2a7eSchristos   int (*other_numbers_get)(struct run *, int, ev_uint32_t *);
157cdfa2a7eSchristos   ev_uint32_t * (*other_numbers_add)(struct run *msg, const ev_uint32_t value);
158cdfa2a7eSchristos };
159cdfa2a7eSchristos 
160cdfa2a7eSchristos struct run {
161cdfa2a7eSchristos   struct run_access_ *base;
162cdfa2a7eSchristos 
163cdfa2a7eSchristos   char *how_data;
164cdfa2a7eSchristos   ev_uint8_t *some_bytes_data;
165cdfa2a7eSchristos   ev_uint32_t some_bytes_length;
166cdfa2a7eSchristos   ev_uint8_t fixed_bytes_data[24];
167cdfa2a7eSchristos   char * *notes_data;
168cdfa2a7eSchristos   int notes_length;
169cdfa2a7eSchristos   int notes_num_allocated;
170cdfa2a7eSchristos   ev_uint64_t large_number_data;
171cdfa2a7eSchristos   ev_uint32_t *other_numbers_data;
172cdfa2a7eSchristos   int other_numbers_length;
173cdfa2a7eSchristos   int other_numbers_num_allocated;
174cdfa2a7eSchristos 
175cdfa2a7eSchristos   ev_uint8_t how_set;
176cdfa2a7eSchristos   ev_uint8_t some_bytes_set;
177cdfa2a7eSchristos   ev_uint8_t fixed_bytes_set;
178cdfa2a7eSchristos   ev_uint8_t notes_set;
179cdfa2a7eSchristos   ev_uint8_t large_number_set;
180cdfa2a7eSchristos   ev_uint8_t other_numbers_set;
181cdfa2a7eSchristos };
182cdfa2a7eSchristos 
183cdfa2a7eSchristos struct run *run_new(void);
184cdfa2a7eSchristos struct run *run_new_with_arg(void *);
185cdfa2a7eSchristos void run_free(struct run *);
186cdfa2a7eSchristos void run_clear(struct run *);
187cdfa2a7eSchristos void run_marshal(struct evbuffer *, const struct run *);
188cdfa2a7eSchristos int run_unmarshal(struct run *, struct evbuffer *);
189cdfa2a7eSchristos int run_complete(struct run *);
190cdfa2a7eSchristos void evtag_marshal_run(struct evbuffer *, ev_uint32_t,
191cdfa2a7eSchristos     const struct run *);
192cdfa2a7eSchristos int evtag_unmarshal_run(struct evbuffer *, ev_uint32_t,
193cdfa2a7eSchristos     struct run *);
194cdfa2a7eSchristos int run_how_assign(struct run *, const char *);
195cdfa2a7eSchristos int run_how_get(struct run *, char * *);
196cdfa2a7eSchristos int run_some_bytes_assign(struct run *, const ev_uint8_t *, ev_uint32_t);
197cdfa2a7eSchristos int run_some_bytes_get(struct run *, ev_uint8_t * *, ev_uint32_t *);
198cdfa2a7eSchristos int run_fixed_bytes_assign(struct run *, const ev_uint8_t *);
199cdfa2a7eSchristos int run_fixed_bytes_get(struct run *, ev_uint8_t **);
200cdfa2a7eSchristos int run_notes_assign(struct run *, int, const char *);
201cdfa2a7eSchristos int run_notes_get(struct run *, int, char * *);
202cdfa2a7eSchristos char * * run_notes_add(struct run *msg, const char * value);
203cdfa2a7eSchristos int run_large_number_assign(struct run *, const ev_uint64_t);
204cdfa2a7eSchristos int run_large_number_get(struct run *, ev_uint64_t *);
205cdfa2a7eSchristos int run_other_numbers_assign(struct run *, int, const ev_uint32_t);
206cdfa2a7eSchristos int run_other_numbers_get(struct run *, int, ev_uint32_t *);
207cdfa2a7eSchristos ev_uint32_t * run_other_numbers_add(struct run *msg, const ev_uint32_t value);
208cdfa2a7eSchristos /* --- run done --- */
209cdfa2a7eSchristos 
210cdfa2a7eSchristos #endif  /* EVENT_RPCOUT__NTPBUILD_DATA_SNAPS_NTP_STABLE_SNTP_LIBEVENT_TEST_REGRESS_RPC_ */