FreeBSD kernel IPv4 code
|
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_ipsec.h"
#include "opt_kern_tls.h"
#include "opt_mbuf_stress_test.h"
#include "opt_ratelimit.h"
#include "opt_route.h"
#include "opt_rss.h"
#include "opt_sctp.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/ktls.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/protosw.h>
#include <sys/sdt.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
#include <sys/ucred.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_vlan_var.h>
#include <net/if_llatbl.h>
#include <net/ethernet.h>
#include <net/netisr.h>
#include <net/pfil.h>
#include <net/route.h>
#include <net/route/nhop.h>
#include <net/rss_config.h>
#include <net/vnet.h>
#include <netinet/in.h>
#include <netinet/in_fib.h>
#include <netinet/in_kdtrace.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/in_pcb.h>
#include <netinet/in_rss.h>
#include <netinet/in_var.h>
#include <netinet/ip_var.h>
#include <netinet/ip_options.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include <netipsec/ipsec_support.h>
#include <machine/in_cksum.h>
#include <security/mac/mac_framework.h>
Go to the source code of this file.
Macros | |
#define | OPTSET(bit) |
#define | OPTSET2(bit, val) |
#define | OPTBIT(bit) (inp->inp_flags & bit ? 1 : 0) |
#define | OPTBIT2(bit) (inp->inp_flags2 & bit ? 1 : 0) |
Functions | |
__FBSDID ("$FreeBSD$") | |
static void | ip_mloopback (struct ifnet *, const struct mbuf *, int) |
static int | ip_output_pfil (struct mbuf **mp, struct ifnet *ifp, int flags, struct inpcb *inp, struct sockaddr_in *dst, int *fibnum, int *error) |
static int | ip_output_send (struct inpcb *inp, struct ifnet *ifp, struct mbuf *m, const struct sockaddr *gw, struct route *ro, bool stamp_tag) |
static void | rt_update_ro_flags (struct route *ro, const struct nhop_object *nh) |
int | ip_output (struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, struct ip_moptions *imo, struct inpcb *inp) |
int | ip_fragment (struct ip *ip, struct mbuf **m_frag, int mtu, u_long if_hwassist_flags) |
void | in_delayed_cksum (struct mbuf *m) |
int | ip_ctloutput (struct socket *so, struct sockopt *sopt) |
Variables | |
int | in_mcast_loop |
struct protosw | inetsw [] |
#define OPTBIT | ( | bit | ) | (inp->inp_flags & bit ? 1 : 0) |
#define OPTBIT2 | ( | bit | ) | (inp->inp_flags2 & bit ? 1 : 0) |
#define OPTSET | ( | bit | ) |
#define OPTSET2 | ( | bit, | |
val | |||
) |
__FBSDID | ( | "$FreeBSD$" | ) |
void in_delayed_cksum | ( | struct mbuf * | m | ) |
Definition at line 1032 of file ip_output.c.
References in_cksum_skip(), ip::ip_hl, ip::ip_len, and udphdr::uh_ulen.
Referenced by divert_packet(), ip_fragment(), ip_mloopback(), ip_output(), and pim_register_prepare().
int ip_ctloutput | ( | struct socket * | so, |
struct sockopt * | sopt | ||
) |
Definition at line 1070 of file ip_output.c.
References in_conninfo::inc_fibnum, INP_2PCP_MASK, INP_2PCP_SET, INP_2PCP_SHIFT, INP_BINDANY, INP_BINDMULTI, INP_DONTFRAG, inpcb::inp_flags, inpcb::inp_flags2, inpcb::inp_flowid, inpcb::inp_flowtype, inp_getmoptions(), INP_HIGHPORT, inpcb::inp_inc, inpcb::inp_ip_minttl, inpcb::inp_ip_tos, inpcb::inp_ip_ttl, INP_LOWPORT, INP_ONESBCAST, inpcb::inp_options, INP_ORIGDSTADDR, INP_RATE_LIMIT_CHANGED, INP_RECVDSTADDR, INP_RECVFLOWID, INP_RECVIF, INP_RECVOPTS, INP_RECVRETOPTS, INP_RECVRSSBUCKETID, INP_RECVTOS, INP_RECVTTL, INP_REUSEADDR, INP_REUSEPORT, INP_REUSEPORT_LB, INP_RLOCK, INP_RSS_BUCKET_SET, inpcb::inp_rss_listen_bucket, INP_RUNLOCK, inp_setmoptions(), INP_WLOCK, INP_WUNLOCK, ip_pcbopts(), IPPROTO_IP, MAXTTL, OPTBIT, OPTBIT2, OPTSET, OPTSET2, and sotoinpcb.
Referenced by sctp_ctloutput(), tcp_ctloutput_get(), tcp_ctloutput_set(), and udp_ctloutput().
int ip_fragment | ( | struct ip * | ip, |
struct mbuf ** | m_frag, | ||
int | mtu, | ||
u_long | if_hwassist_flags | ||
) |
Definition at line 859 of file ip_output.c.
References in_delayed_cksum(), IP_DF, ip::ip_hl, ip_len, ip::ip_len, IP_MF, ip_off, ip::ip_off, ip_optcopy(), ip::ip_sum, ip::ip_v, IPSTAT_ADD, IPSTAT_INC, IPVERSION, and nfrags.
Referenced by ip_output(), ip_tryforward(), and pim_register_prepare().
|
static |
Definition at line 1571 of file ip_output.c.
References in_delayed_cksum(), and ip::ip_sum.
Referenced by ip_output().
int ip_output | ( | struct mbuf * | m, |
struct mbuf * | opt, | ||
struct route * | ro, | ||
int | flags, | ||
struct ip_moptions * | imo, | ||
struct inpcb * | inp | ||
) |
Definition at line 320 of file ip_output.c.
References fib4_lookup(), in_ifaddr::ia_ifa, IA_SIN, ifatoia, IFP_TO_IA, in_delayed_cksum(), in_ifaddr_broadcast(), in_mcast_loop, INADDR_ANY, INADDR_BROADCAST, in_conninfo::inc_fibnum, INP_2PCP_MASK, INP_2PCP_SET, INP_2PCP_SHIFT, inpcb::inp_flags2, inpcb::inp_flowid, inpcb::inp_flowtype, inpcb::inp_inc, INP_LOCK_ASSERT, inpcb::inp_numa_domain, inpcb::inp_rt_cookie, IP_ALLOWBROADCAST, IP_DF, ip::ip_dst, ip_fillid(), IP_FORWARDING, ip_fragment(), ip::ip_hl, ip_insertoptions(), ip_len, ip::ip_len, ip_mcast_src, ip_mforward, ip_mloopback(), IP_NO_SND_TAG_RL, IP_NODEFAULTFLOWID, ip_off, ip::ip_off, ip_output_pfil(), ip_output_send(), IP_PROBE, IP_RAWOUTPUT, IP_ROUTETOIF, IP_SENDONES, ip::ip_sum, ip::ip_ttl, ip::ip_v, IPSTAT_INC, IPVERSION, rt_update_ro_flags(), in_addr::s_addr, sockaddr_in::sin_addr, sockaddr_in::sin_family, sockaddr_in::sin_len, sintosa, V_inet_pfil_head, V_ip_mrouter, and V_rsvp_on.
Referenced by bbr_output_wtime(), carp_send_ad_locked(), div_output_outbound(), igmp_intr(), in_gif_output(), in_gre_output(), ip_forward(), rack_fast_output(), rack_fast_rsm_output(), rack_output(), send_packet(), syncache_respond(), tcp_default_output(), tcp_respond(), and tcp_twrespond().
|
inlinestatic |
Definition at line 112 of file ip_output.c.
References in_localip(), ip::ip_dst, IP_FORWARDING, in_addr::s_addr, sockaddr_in::sin_addr, sockaddr_in::sin_family, sockaddr_in::sin_len, and V_inet_pfil_head.
Referenced by ip_output().
|
static |
Definition at line 212 of file ip_output.c.
References inpcb::inp_flags2, INP_RATE_LIMIT_CHANGED, and inpcb::inp_snd_tag.
Referenced by ip_output().
|
inlinestatic |
Definition at line 296 of file ip_output.c.
Referenced by ip_output().
|
extern |
Definition at line 188 of file in_mcast.c.
Referenced by inp_findmoptions(), and ip_output().
|
extern |