Implement patty_ax25_sock_flow_left()
Implement patty_ax25_sock_flow_left() as a means to determine how many I frames a peer may receive; this can be used to determine when to set the P/F bit of outgoing I frames to implicitly require an RR or RNR acknowledgement
This commit is contained in:
parent
df9efb8b3a
commit
dfa2ff547a
2 changed files with 11 additions and 5 deletions
|
@ -200,6 +200,8 @@ void patty_ax25_sock_vs_incr(patty_ax25_sock *sock);
|
|||
|
||||
void patty_ax25_sock_vr_incr(patty_ax25_sock *sock);
|
||||
|
||||
int patty_ax25_sock_flow_left(patty_ax25_sock *sock);
|
||||
|
||||
int patty_ax25_sock_flow_full(patty_ax25_sock *sock);
|
||||
|
||||
/*
|
||||
|
|
14
src/sock.c
14
src/sock.c
|
@ -535,6 +535,14 @@ void *patty_ax25_sock_assembler_read(patty_ax25_sock *sock,
|
|||
return buf + 1;
|
||||
}
|
||||
|
||||
int patty_ax25_sock_flow_left(patty_ax25_sock *sock) {
|
||||
if (sock->n_window_tx == 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return sock->vs - tx_seq(sock, sock->va + sock->n_window_tx);
|
||||
}
|
||||
|
||||
int patty_ax25_sock_flow_full(patty_ax25_sock *sock) {
|
||||
/*
|
||||
* 6.4.1 Sending I Frames
|
||||
|
@ -644,11 +652,7 @@ error_invalid_type:
|
|||
}
|
||||
|
||||
static inline uint16_t control_i(patty_ax25_sock *sock, int ns) {
|
||||
int flag = 0;
|
||||
|
||||
if (sock->vs == tx_seq(sock, sock->va + sock->n_window_tx - 1)) {
|
||||
flag = 1;
|
||||
}
|
||||
int flag = patty_ax25_sock_flow_left(sock) == 1? 1: 0;
|
||||
|
||||
switch (sock->mode) {
|
||||
case PATTY_AX25_SOCK_SABM:
|
||||
|
|
Loading…
Add table
Reference in a new issue