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