Switch to struct timeval for sock timers
This commit is contained in:
parent
a0660345bb
commit
810361647a
3 changed files with 18 additions and 16 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include <patty/kiss.h>
|
#include <patty/kiss.h>
|
||||||
#include <patty/list.h>
|
#include <patty/list.h>
|
||||||
|
|
|
@ -55,9 +55,9 @@ typedef struct _patty_ax25_sock {
|
||||||
enum patty_ax25_sock_status status;
|
enum patty_ax25_sock_status status;
|
||||||
enum patty_ax25_sock_mode mode;
|
enum patty_ax25_sock_mode mode;
|
||||||
|
|
||||||
time_t timer_ack,
|
struct timeval timer_ack,
|
||||||
timer_response,
|
timer_response,
|
||||||
timer_keepalive;
|
timer_keepalive;
|
||||||
|
|
||||||
size_t n_maxlen_tx,
|
size_t n_maxlen_tx,
|
||||||
n_maxlen_rx,
|
n_maxlen_rx,
|
||||||
|
|
27
src/sock.c
27
src/sock.c
|
@ -138,19 +138,20 @@ error_malloc_sock:
|
||||||
}
|
}
|
||||||
|
|
||||||
void patty_ax25_sock_reset(patty_ax25_sock *sock) {
|
void patty_ax25_sock_reset(patty_ax25_sock *sock) {
|
||||||
sock->status = PATTY_AX25_SOCK_CLOSED;
|
sock->status = PATTY_AX25_SOCK_CLOSED;
|
||||||
sock->mode = PATTY_AX25_SOCK_DM;
|
sock->mode = PATTY_AX25_SOCK_DM;
|
||||||
sock->n_maxlen_tx = PATTY_AX25_SOCK_DEFAULT_MAXLEN;
|
sock->n_maxlen_tx = PATTY_AX25_SOCK_DEFAULT_MAXLEN;
|
||||||
sock->n_maxlen_rx = PATTY_AX25_SOCK_DEFAULT_MAXLEN;
|
sock->n_maxlen_rx = PATTY_AX25_SOCK_DEFAULT_MAXLEN;
|
||||||
sock->n_window_tx = PATTY_AX25_SOCK_DEFAULT_WINDOW;
|
sock->n_window_tx = PATTY_AX25_SOCK_DEFAULT_WINDOW;
|
||||||
sock->n_window_rx = PATTY_AX25_SOCK_DEFAULT_WINDOW;
|
sock->n_window_rx = PATTY_AX25_SOCK_DEFAULT_WINDOW;
|
||||||
sock->n_ack = PATTY_AX25_SOCK_DEFAULT_ACK;
|
sock->n_ack = PATTY_AX25_SOCK_DEFAULT_ACK;
|
||||||
sock->n_retry = PATTY_AX25_SOCK_DEFAULT_RETRY;
|
sock->n_retry = PATTY_AX25_SOCK_DEFAULT_RETRY;
|
||||||
sock->timer_ack = 0;
|
sock->seq_send = 0;
|
||||||
sock->timer_response = 0;
|
sock->seq_recv = 0;
|
||||||
sock->timer_keepalive = 0;
|
|
||||||
sock->seq_send = 0;
|
timerclear(&sock->timer_ack);
|
||||||
sock->seq_recv = 0;
|
timerclear(&sock->timer_response);
|
||||||
|
timerclear(&sock->timer_keepalive);
|
||||||
}
|
}
|
||||||
|
|
||||||
void patty_ax25_sock_destroy(patty_ax25_sock *sock) {
|
void patty_ax25_sock_destroy(patty_ax25_sock *sock) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue