networkclient
|
Files | |
file | example_1.c |
Sample code to initialize a RADIUS packet. | |
file | example_2.c |
Sample code to initialize a RADIUS packet. | |
file | example_3.c |
Sample code to initialize a RADIUS packet and a response to it. | |
file | example_4.c |
Allocate and manage multiple packets. | |
file | example_5.c |
Sample code to initialize a RADIUS packet send it to a server. | |
The library includes a number of example programs. These programs show how the APIs can be used.w
Code - example_1.c
This example initializes a packet, and then adds User-Name and User-Password to it. The resulting packet is then printed to the standard output.
Code - example_2.c
This example initializes a packet, and then adds User-Name and CHAP-Password to it. The resulting packet is then printed to the standard output.
Code - example_3.c
This example initializes a packet, and then adds User-Name and User-Password to it. The resulting packet is then printed to the standard output.
As a next step, it then creates the response, and prints that, too.
Code - example_4.c
This example creates multiple packets, and allocates RADIUS ID fields for them. The purpose of this example is to show how the nr_transmit() API works. See also transmit.c
Code - example_5.c
This example initializes a packet, and then adds User-Name and User-Password to it. The resulting packet is then printed to the standard output.
The packet is sent to a server, and waits for a response. It then prints the response.
Code - example_6.c
This example initializes a packet, and then adds User-Name and User-Password to it. An ID is allocated for the packet. The resulting packet is then printed to the standard output.
The packet is sent to a server, and waits for a response. It then prints the response.
The difference between this example and example_5.c is that the previous example just sent one packet in a blocking call. This example shows how multiple packets can be sent using the ID tracking API.