i have this struct:
typedef struct
{
auth_header header; // another struct
uint8_t action;
uint8_t priv_lvl;
uint8_t authen_type;
uint8_t service;
uint8_t user_len;
uint8_t port_len;
uint8_t rem_addr_len;
uint8_t data_len;
char *user;
char *port;
char *rem_addr;
char *data;
} auth_start;
and i want to create a buffer and insert the data in it so i can send this data to my server.
- im not sure of what type the buffer needs to be (uint8_t/char/auth_start).
- im not sure how should i do it, should i copy every field 1 by 1 with memcpy() ? or is there another way?
thanks ! :)