FreeBSD kernel IPv4 code
|
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"
#include <sys/param.h>
#include <sys/eventhandler.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/module.h>
#include <sys/types.h>
#include <sys/sockopt.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_types.h>
#include <net/if_vlan_var.h>
#include <net/if_llatbl.h>
#include <net/route.h>
#include <netinet/if_ether.h>
#include <netinet/in.h>
#include <netinet/in_pcb.h>
#include <netinet/in_var.h>
#include <netinet6/in6_var.h>
#include <netinet6/in6_pcb.h>
#include <netinet6/nd6.h>
#include <netinet/tcp.h>
#include <netinet/tcp_fsm.h>
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#include <netinet/tcp_syncache.h>
#include <netinet/tcp_offload.h>
#include <netinet/toecore.h>
Go to the source code of this file.
Macros | |
#define | TCPSTATES |
Functions | |
__FBSDID ("$FreeBSD$") | |
static | TAILQ_HEAD (toedev) |
static int | toedev_listen_start (struct toedev *tod __unused, struct tcpcb *tp __unused) |
static int | toedev_listen_stop (struct toedev *tod __unused, struct tcpcb *tp __unused) |
static void | toedev_input (struct toedev *tod __unused, struct tcpcb *tp __unused, struct mbuf *m) |
static void | toedev_rcvd (struct toedev *tod __unused, struct tcpcb *tp __unused) |
static int | toedev_output (struct toedev *tod __unused, struct tcpcb *tp __unused) |
static void | toedev_pcb_detach (struct toedev *tod __unused, struct tcpcb *tp __unused) |
static void | toedev_l2_update (struct toedev *tod __unused, struct ifnet *ifp __unused, struct sockaddr *sa __unused, uint8_t *lladdr __unused, uint16_t vtag __unused) |
static void | toedev_route_redirect (struct toedev *tod __unused, struct ifnet *ifp __unused, struct nhop_object *nh0 __unused, struct nhop_object *nh1 __unused) |
static void | toedev_syncache_added (struct toedev *tod __unused, void *ctx __unused) |
static void | toedev_syncache_removed (struct toedev *tod __unused, void *ctx __unused) |
static int | toedev_syncache_respond (struct toedev *tod __unused, void *ctx __unused, struct mbuf *m) |
static void | toedev_offload_socket (struct toedev *tod __unused, void *ctx __unused, struct socket *so __unused) |
static void | toedev_ctloutput (struct toedev *tod __unused, struct tcpcb *tp __unused, int sopt_dir __unused, int sopt_name __unused) |
static void | toedev_tcp_info (struct toedev *tod __unused, struct tcpcb *tp __unused, struct tcp_info *ti __unused) |
static int | toedev_alloc_tls_session (struct toedev *tod __unused, struct tcpcb *tp __unused, struct ktls_session *tls __unused, int direction __unused) |
static void | toedev_pmtu_update (struct toedev *tod __unused, struct tcpcb *tp __unused, tcp_seq seq __unused, int mtu __unused) |
static void | toe_listen_start (struct inpcb *inp, void *arg) |
static void | toe_listen_start_event (void *arg __unused, struct tcpcb *tp) |
static void | toe_listen_stop_event (void *arg __unused, struct tcpcb *tp) |
void | init_toedev (struct toedev *tod) |
int | register_toedev (struct toedev *tod) |
int | unregister_toedev (struct toedev *tod) |
void | toe_syncache_add (struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, struct inpcb *inp, void *tod, void *todctx, uint8_t iptos) |
int | toe_syncache_expand (struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, struct socket **lsop) |
int | toe_4tuple_check (struct in_conninfo *inc, struct tcphdr *th, struct ifnet *ifp) |
static void | toe_lle_event (void *arg __unused, struct llentry *lle, int evt) |
int | toe_l2_resolve (struct toedev *tod, struct ifnet *ifp, struct sockaddr *sa, uint8_t *lladdr, uint16_t *vtag) |
void | toe_connect_failed (struct toedev *tod, struct inpcb *inp, int err) |
static int | toecore_load (void) |
static int | toecore_unload (void) |
static int | toecore_mod_handler (module_t mod, int cmd, void *arg) |
MODULE_VERSION (toecore, 1) | |
DECLARE_MODULE (toecore, mod_data, SI_SUB_EXEC, SI_ORDER_ANY) | |
Variables | |
static struct mtx | toedev_lock |
static moduledata_t | mod_data |
__FBSDID | ( | "$FreeBSD$" | ) |
DECLARE_MODULE | ( | toecore | , |
mod_data | , | ||
SI_SUB_EXEC | , | ||
SI_ORDER_ANY | |||
) |
void init_toedev | ( | struct toedev * | tod | ) |
Definition at line 273 of file toecore.c.
References toedev::tod_alloc_tls_session, toedev::tod_connect, toedev::tod_ctloutput, toedev::tod_input, toedev::tod_l2_update, toedev::tod_listen_start, toedev::tod_listen_stop, toedev::tod_offload_socket, toedev::tod_output, toedev::tod_pcb_detach, toedev::tod_pmtu_update, toedev::tod_rcvd, toedev::tod_route_redirect, toedev::tod_send_fin, toedev::tod_send_rst, toedev::tod_softc, toedev::tod_syncache_added, toedev::tod_syncache_removed, toedev::tod_syncache_respond, toedev::tod_tcp_info, toedev_alloc_tls_session(), toedev_ctloutput(), toedev_input(), toedev_l2_update(), toedev_listen_start(), toedev_listen_stop(), toedev_offload_socket(), toedev_output(), toedev_pcb_detach(), toedev_pmtu_update(), toedev_rcvd(), toedev_route_redirect(), toedev_syncache_added(), toedev_syncache_removed(), toedev_syncache_respond(), and toedev_tcp_info().
MODULE_VERSION | ( | toecore | , |
1 | |||
) |
int register_toedev | ( | struct toedev * | tod | ) |
Definition at line 309 of file toecore.c.
References inp_apply_all(), registered_toedevs, toe_listen_start(), and toedev_lock.
int toe_4tuple_check | ( | struct in_conninfo * | inc, |
struct tcphdr * | th, | ||
struct ifnet * | ifp | ||
) |
Definition at line 386 of file toecore.c.
References in_pcblookup(), in_conninfo::inc_flags, INC_ISIPV6, inpcb::inp_flags, INP_RLOCK_ASSERT, INP_RUNLOCK, INP_TIMEWAIT, INPLOOKUP_RLOCKPCB, tcp_twcheck(), and V_tcbinfo.
Definition at line 511 of file toecore.c.
References INP_DROPPED, inpcb::inp_flags, INP_WLOCK, INP_WLOCK_ASSERT, intotcpcb, tcpcb::t_flags, tcp_drop(), tcp_timer_activate(), TF_TOE, tcpcb::tod, toedev::tod_pcb_detach, TP_KEEPINIT, and TT_KEEP.
int toe_l2_resolve | ( | struct toedev * | tod, |
struct ifnet * | ifp, | ||
struct sockaddr * | sa, | ||
uint8_t * | lladdr, | ||
uint16_t * | vtag | ||
) |
Definition at line 472 of file toecore.c.
References arpresolve().
|
static |
Definition at line 214 of file toecore.c.
References INP_DROPPED, inpcb::inp_flags, inpcb::inp_pcbinfo, INP_TIMEWAIT, INP_WLOCK_ASSERT, intotcpcb, tcpcb::t_state, TCPS_LISTEN, tcpcb::tod, toedev::tod_listen_start, toedev_lock, and V_tcbinfo.
Referenced by register_toedev(), and toe_listen_start_event().
|
static |
Definition at line 240 of file toecore.c.
References INP_WLOCK_ASSERT, tcpcb::t_inpcb, tcpcb::t_state, TCPS_LISTEN, and toe_listen_start().
Referenced by toecore_load().
|
static |
Definition at line 252 of file toecore.c.
References INP_WLOCK_ASSERT, tcpcb::t_inpcb, tcpcb::t_state, TCPS_LISTEN, toedev::tod_listen_stop, and toedev_lock.
Referenced by toecore_load().
|
static |
Definition at line 414 of file toecore.c.
References toedev::tod_l2_update.
Referenced by toecore_load().
void toe_syncache_add | ( | struct in_conninfo * | inc, |
struct tcpopt * | to, | ||
struct tcphdr * | th, | ||
struct inpcb * | inp, | ||
void * | tod, | ||
void * | todctx, | ||
uint8_t | iptos | ||
) |
Definition at line 357 of file toecore.c.
References INP_RLOCK_ASSERT, inpcb::inp_socket, and syncache_add().
int toe_syncache_expand | ( | struct in_conninfo * | inc, |
struct tcpopt * | to, | ||
struct tcphdr * | th, | ||
struct socket ** | lsop | ||
) |
Definition at line 368 of file toecore.c.
References syncache_expand().
|
static |
Definition at line 547 of file toecore.c.
References tcp_offload_listen_start(), tcp_offload_listen_stop(), toe_listen_start_event(), toe_listen_stop_event(), toe_lle_event(), and toedev_lock.
Referenced by toecore_mod_handler().
|
static |
Definition at line 584 of file toecore.c.
References toecore_load(), and toecore_unload().
|
static |
Definition at line 564 of file toecore.c.
References tcp_offload_listen_start(), tcp_offload_listen_stop(), and toedev_lock.
Referenced by toecore_mod_handler().
|
static |
Definition at line 195 of file toecore.c.
Referenced by init_toedev().
|
static |
Definition at line 179 of file toecore.c.
Referenced by init_toedev().
|
static |
Definition at line 101 of file toecore.c.
Referenced by init_toedev().
|
static |
Definition at line 131 of file toecore.c.
Referenced by init_toedev().
Definition at line 87 of file toecore.c.
Referenced by init_toedev().
Definition at line 94 of file toecore.c.
Referenced by init_toedev().
|
static |
Definition at line 171 of file toecore.c.
Referenced by init_toedev().
Definition at line 117 of file toecore.c.
Referenced by init_toedev().
Definition at line 124 of file toecore.c.
Referenced by init_toedev().
|
static |
Definition at line 203 of file toecore.c.
Referenced by init_toedev().
Definition at line 110 of file toecore.c.
Referenced by init_toedev().
|
static |
Definition at line 140 of file toecore.c.
Referenced by init_toedev().
|
static |
Definition at line 148 of file toecore.c.
Referenced by init_toedev().
|
static |
Definition at line 155 of file toecore.c.
Referenced by init_toedev().
|
static |
Definition at line 162 of file toecore.c.
Referenced by init_toedev().
|
static |
Definition at line 187 of file toecore.c.
Referenced by init_toedev().
int unregister_toedev | ( | struct toedev * | tod | ) |
Definition at line 336 of file toecore.c.
References registered_toedevs, and toedev_lock.
|
static |
|
static |
Definition at line 72 of file toecore.c.
Referenced by register_toedev(), toe_listen_start(), toe_listen_stop_event(), toecore_load(), toecore_unload(), and unregister_toedev().