Allow changing socket ack timer with setsockopt()
Allow changing socket ack timer with patty_client_setsockopt()
This commit is contained in:
parent
eb071de230
commit
04176659ec
4 changed files with 13 additions and 2 deletions
|
@ -130,6 +130,8 @@ void patty_ax25_sock_reset(patty_ax25_sock *sock);
|
|||
|
||||
void patty_ax25_sock_mtu_set(patty_ax25_sock *sock, size_t mtu);
|
||||
|
||||
void patty_ax25_sock_ack_set(patty_ax25_sock *sock, time_t ack);
|
||||
|
||||
void patty_ax25_sock_window_set(patty_ax25_sock *sock, size_t window);
|
||||
|
||||
void patty_ax25_sock_params_upgrade(patty_ax25_sock *sock);
|
||||
|
|
|
@ -59,6 +59,8 @@ typedef struct _patty_client_setsockopt_request {
|
|||
typedef struct _patty_client_setsockopt_params {
|
||||
size_t mtu,
|
||||
window;
|
||||
|
||||
time_t ack;
|
||||
} patty_client_setsockopt_params;
|
||||
|
||||
typedef struct _patty_client_setsockopt_if {
|
||||
|
|
|
@ -599,10 +599,13 @@ static int server_setsockopt(patty_ax25_server *server,
|
|||
|
||||
if (data.mtu) patty_ax25_sock_mtu_set(sock, data.mtu);
|
||||
if (data.window) patty_ax25_sock_window_set(sock, data.window);
|
||||
if (data.ack) patty_ax25_sock_ack_set(sock, data.ack);
|
||||
|
||||
if (data.mtu || data.window) {
|
||||
if (patty_ax25_sock_realloc_bufs(sock) < 0) {
|
||||
goto error_realloc_bufs;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -231,6 +231,10 @@ void patty_ax25_sock_mtu_set(patty_ax25_sock *sock, size_t mtu) {
|
|||
sock->n_maxlen_tx = mtu;
|
||||
}
|
||||
|
||||
void patty_ax25_sock_ack_set(patty_ax25_sock *sock, time_t ack) {
|
||||
sock->n_ack = (time_t)ack;
|
||||
}
|
||||
|
||||
void patty_ax25_sock_window_set(patty_ax25_sock *sock, size_t window) {
|
||||
sock->n_window_tx = window;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue