diff options
author | John Baldwin <jhb@FreeBSD.org> | 2022-04-09 00:25:13 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2022-04-09 00:25:13 +0000 |
commit | 3b994db74b75551d5ab6cc3df5d3b51d3347032b (patch) | |
tree | b044bf355f02518e177ace8e07111150a282ea08 | |
parent | 5cd9d254039e06493919b43a1b6ee9939f5c800f (diff) |
Use stub inline functions for no-op versions of tcp_fastopen*().
Inline functions "use" variables passed as arguments unlike empty
macros appeasing compiler warnings about unused variables.
-rw-r--r-- | sys/netinet/tcp_fastopen.h | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/sys/netinet/tcp_fastopen.h b/sys/netinet/tcp_fastopen.h index 5db10b00df48..f00bc87644f9 100644 --- a/sys/netinet/tcp_fastopen.h +++ b/sys/netinet/tcp_fastopen.h @@ -93,14 +93,49 @@ void tcp_fastopen_disable_path(struct tcpcb *); void tcp_fastopen_update_cache(struct tcpcb *, uint16_t, uint8_t, uint8_t *); #else -#define tcp_fastopen_init() ((void)0) -#define tcp_fastopen_destroy() ((void)0) -#define tcp_fastopen_alloc_counter() NULL -#define tcp_fastopen_decrement_counter(c) ((void)0) -#define tcp_fastopen_check_cookie(i, c, l, lc) (-1) -#define tcp_fastopen_connect(t) ((void)0) -#define tcp_fastopen_disable_path(t) ((void)0) -#define tcp_fastopen_update_cache(t, m, l, c) ((void)0) +static __inline void +tcp_fastopen_init(void) +{ +} + +static __inline void +tcp_fastopen_destroy(void) +{ +} + +static __inline unsigned int * +tcp_fastopen_alloc_counter(void) +{ + return (NULL); +} + +static __inline void +tcp_fastopen_decrement_counter(unsigned int *_counter) +{ +} + +static __inline int +tcp_fastopen_check_cookie(struct in_conninfo *_inc, uint8_t *_cookie, + unsigned int _len, uint64_t *_latest_cookie) +{ + return (-1); +} + +static __inline void +tcp_fastopen_connect(struct tcpcb *_tp) +{ +} + +static __inline void +tcp_fastopen_disable_path(struct tcpcb *_tp) +{ +} + +static __inline void +tcp_fastopen_update_cache(struct tcpcb *_tp, uint16_t _mss, uint8_t _cookie_len, + uint8_t *_cookie) +{ +} #endif /* TCP_RFC7413 */ #endif /* _KERNEL */ |