libnetconf2
4.0.2
NETCONF server and client library in C.
|
UNIX proxy communication. More...
Functions | |
int | nc_proxy_read_msg (int fd, NC_PROT_VERSION version, int timeout_ms, char **buf, uint32_t *buf_len) |
Read a full chunked-framing message from a FD. More... | |
int | nc_proxy_unix_close (int fd) |
Close the UNIX proxy connection to a server. More... | |
int | nc_proxy_unix_connect (const char *address, const char *username) |
Connect to a server UNIX socket to act as a NETCONF proxy. More... | |
int | nc_proxy_write_msg (int fd, NC_PROT_VERSION version, const char *buf, uint32_t buf_len) |
Write data encapsulated as a chunked-framing message to a FD. More... | |
UNIX proxy communication.
int nc_proxy_unix_connect | ( | const char * | address, |
const char * | username | ||
) |
Connect to a server UNIX socket to act as a NETCONF proxy.
[in] | address | UNIX socket path to connect to. |
[in] | username | NETCONF username to use for UNIX authentication. |
int nc_proxy_read_msg | ( | int | fd, |
NC_PROT_VERSION | version, | ||
int | timeout_ms, | ||
char ** | buf, | ||
uint32_t * | buf_len | ||
) |
Read a full chunked-framing message from a FD.
Set version
according to the current NETCONF specification. That will almost always result in using NETCONF 1.0 encapsulation for the hello message (first exchanged message) and NETCONF 1.1 for all the following messages (as long as the server supports this NETCONF version).
[in] | fd | File descriptor to read from. |
[in] | version | NETCONF version to use for message encapsulation. |
[in] | timeout_ms | Timeout for reading in milliseconds. Use negative value for blocking read, 0 for non-blocking read. |
[in,out] | buf | Buffer to write into, is enlarged as needed. |
[in,out] | buf_len | Length of buf . |
int nc_proxy_write_msg | ( | int | fd, |
NC_PROT_VERSION | version, | ||
const char * | buf, | ||
uint32_t | buf_len | ||
) |
Write data encapsulated as a chunked-framing message to a FD.
Keeps writing until all the data are written or a fatal error is encountered.
Set version
based on the information for nc_proxy_read_msg().
[in] | fd | File descriptor to write to. |
[in] | version | NETCONF version to use for message encapsulation. |
[in] | buf | Buffer with the message to write. |
[in] | buf_len | Length of the message in buf . |
int nc_proxy_unix_close | ( | int | fd | ) |
Close the UNIX proxy connection to a server.
[in] | fd | Connected UNIX socket file descriptor. |