Hi I have the following union which is part of a larger struct and I want to store a uint64_t (64 bits size) data in this union. However i want to store it by accessing the id_data field since the others are not large enough for a complete uint64_t. But i dont know how to assign my uint64_t data into this id_data field.
I know how to read the uint64_t data from this field.But somehow dont know how to assign values to it.
Any help will be appreciated.
Thanks.
union {
struct id_ts { /* ICMP Timestamp */
uint32_t otime; /* Originate */
uint32_t rtime; /* Receive */
uint32_t ttime; /* Transmit */
} id_ts;
struct id_ip {
struct xyz_abc idi_ip;
/* options and then 64 bits of data */
} id_ip;
struct ra_addr id_radv;
uint32_t id_mask;
char id_data[1];
} icmp_nnn;