X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/3e32eb8e48a56bca543faa522909d3d83538c55d..9701b7ab4dc4cd709ad4dcaa750fc0021f15e231:/include/stg/rad_packets.h diff --git a/include/stg/rad_packets.h b/include/stg/rad_packets.h new file mode 100644 index 00000000..96cddc4b --- /dev/null +++ b/include/stg/rad_packets.h @@ -0,0 +1,41 @@ +#ifndef RAD_PACKETSH +#define RAD_PACKETSH + +#define RAD_MAGIC_LEN (5) +#define RAD_PROTO_VER_LEN (2) +#define RAD_MAX_PACKET_LEN (1024) +#define RAD_LOGIN_LEN (32) +#define RAD_SERVICE_LEN (16) +#define RAD_PASSWORD_LEN (32) +#define RAD_SESSID_LEN (32) + +// Request +#define RAD_AUTZ_PACKET (0) +#define RAD_AUTH_PACKET (1) +#define RAD_POST_AUTH_PACKET (2) +#define RAD_ACCT_START_PACKET (3) +#define RAD_ACCT_STOP_PACKET (4) +#define RAD_ACCT_UPDATE_PACKET (5) +#define RAD_ACCT_OTHER_PACKET (6) +// Responce +#define RAD_ACCEPT_PACKET (7) +#define RAD_REJECT_PACKET (8) + +#define RAD_ID "00100" + +#include "os_int.h" + +struct RAD_PACKET +{ +uint8_t magic[RAD_MAGIC_LEN]; +uint8_t protoVer[RAD_PROTO_VER_LEN]; +uint8_t packetType; +uint8_t login[RAD_LOGIN_LEN]; +uint32_t ip; +uint8_t service[RAD_SERVICE_LEN]; +uint8_t password[RAD_PASSWORD_LEN]; +uint8_t sessid[RAD_SESSID_LEN]; +uint8_t padding[4]; +}; + +#endif