1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
openbsd-src/regress/lib/libradius/test05.c
yasuoka 0eaf192d8f Add radius(3) library. This will be used by RADIUS server and client
programs to manipulate RADIUS packets.  Mainly written by UMEZAWA
Takeshi.

fix and suggestion deraadt
ok deraadt
2015-07-20 23:52:29 +00:00

24 lines
569 B
C

#include "incs.h"
/*
* request/response association
*/
void test05(void)
{
RADIUS_PACKET *req0, *req1, *resp;
req0 = radius_new_request_packet(RADIUS_CODE_ACCESS_REQUEST);
req1 = radius_new_request_packet(RADIUS_CODE_ACCESS_REQUEST);
CHECK(radius_get_request_packet(req0) == NULL);
CHECK(radius_get_request_packet(req1) == NULL);
resp = radius_new_response_packet(RADIUS_CODE_ACCESS_ACCEPT, req0);
CHECK(radius_get_request_packet(resp) == req0);
radius_set_request_packet(resp, req1);
CHECK(radius_get_request_packet(resp) == req1);
}
ADD_TEST(test05)