Binary IO abstractions for fr_packet_t.
More...
#include <freeradius-devel/util/packet.h>
#include <freeradius-devel/bio/base.h>
Go to the source code of this file.
Binary IO abstractions for fr_packet_t.
- Id
- 6426d5d9f6f456d0d160edab6a2be4fac1b341ba
- Copyright
- 2024 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file packet.h.
◆ fr_bio_packet_s
◆ fr_bio_packet_read_t
Read a packet and pairs from the network.
- Parameters
-
bio | the packet-based bio |
request_ctx_p | the request context associated with the response |
packet_p | the response packet. Contains raw protocol data (IDs, counts, etc.) |
out_ctx | talloc context for the list |
out | the decoded pairs from the packet |
- Returns
- <0 on error
- 0 for success (*packet_p may still be NULL tho)
Definition at line 45 of file packet.h.
◆ fr_bio_packet_release_t
Release an outgoing packet.
- Parameters
-
bio | the packet-based bio |
packet | the output packet descriptor. Contains raw protocol data (IDs, counts, etc.) |
- Returns
- <0 on error
- 0 for success
Definition at line 67 of file packet.h.
◆ fr_bio_packet_t
◆ fr_bio_packet_write_t
Write a packet and pairs from the network.
- Parameters
-
bio | the packet-based bio |
request_ctx | the request context |
packet | the request packet. Contains raw protocol data (IDs, counts, etc.) |
list | the pairs to encode in the packet |
- Returns
- <0 on error (EOF, fail, etc,)
- 0 for success
Definition at line 57 of file packet.h.
◆ fr_bio_packet_read()
Read a packet from a packet BIO.
Note that the bio MAY return fr_bio_error(IO_WOULD_BLOCK), which is not a fatal error. The caller has to check for that case, and handle blocking errors. Typically by pushing the packet to a queue, and trying it again later.
- Parameters
-
| bio | the packet-based bio |
[out] | request_ctx_p | the larger context for the original request packet |
[out] | packet_p | Where the allocated fr_packet_t will be stored |
[out] | out_ctx | for the output pairs |
[out] | out | decoded output pairs |
- Returns
-
Definition at line 94 of file packet.h.
◆ fr_bio_packet_write()
Write a packet to a packet BIO.
Note that the bio MAY return fr_bio_error(IO_WOULD_BLOCK), which is not a fatal error. The caller has to check for that case, and handle blocking errors. Typically by pushing the packet to a queue, and trying it again later.
- Parameters
-
bio | the packet-based bio |
request_ctx | the larger context for the packet |
packet | the output packet descriptor. Contains raw protocol data (IDs, counts, etc.) |
list | of pairs to write |
- Returns
-
Definition at line 113 of file packet.h.