#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int ofld_connect(struct socket *so, struct sockaddr *nam) { struct ifnet *ifp; struct toedev *tdev; struct rtentry *rt; int err; rt = rtalloc1(nam, 1, 0); if (rt) RT_UNLOCK(rt); else return (EHOSTUNREACH); ifp = rt->rt_ifp; tdev = TOEDEV(ifp); if (tdev == NULL) return (EINVAL); if (tdev->can_offload(tdev, so) == 0) return (EINVAL); if ((err = tdev->connect(tdev, so, ifp))) return (err); return (0); } int ofld_send(struct tcpcb *tp) { return tp->t_tu->tu_send(tp); } int ofld_rcvd(struct tcpcb *tp) { return tp->t_tu->tu_rcvd(tp); } int ofld_disconnect(struct tcpcb *tp) { return tp->t_tu->tu_disconnect(tp); } int ofld_abort(struct tcpcb *tp) { return tp->t_tu->tu_abort(tp); } void ofld_detach(struct tcpcb *tp) { tp->t_tu->tu_detach(tp); } void ofld_listen_open(struct tcpcb *tp) { EVENTHANDLER_INVOKE(ofld_listen, OFLD_LISTEN_OPEN, tp); } void ofld_listen_close(struct tcpcb *tp) { EVENTHANDLER_INVOKE(ofld_listen, OFLD_LISTEN_CLOSE, tp); }