X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/2d21ac55c334faf3a56e5634905ed6987fc787d4..d41d1dae2cd00cc08c7982087d1c445180cad9f5:/bsd/netinet/ip_var.h diff --git a/bsd/netinet/ip_var.h b/bsd/netinet/ip_var.h index 81eb6f135..9d4044d4c 100644 --- a/bsd/netinet/ip_var.h +++ b/bsd/netinet/ip_var.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * Copyright (c) 2000-2010 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -98,7 +98,7 @@ struct ipq { u_short ipq_id; /* sequence id for reassembly */ struct mbuf *ipq_frags; /* to ip headers of fragments */ struct in_addr ipq_src,ipq_dst; - u_long ipq_nfrags; + u_int32_t ipq_nfrags; TAILQ_ENTRY(ipq) ipq_list; #if CONFIG_MACF_NET struct label *ipq_label; /* MAC label */ @@ -138,7 +138,7 @@ struct ip_moptions { u_char imo_multicast_loop; /* 1 => hear sends if a member */ u_short imo_num_memberships; /* no. memberships this socket */ struct in_multi *imo_membership[IP_MAX_MEMBERSHIPS]; - u_long imo_multicast_vif; /* vif num outgoing multicasts */ + u_int32_t imo_multicast_vif; /* vif num outgoing multicasts */ struct in_addr imo_multicast_addr; /* ifindex/addr on MULTICAST_IF */ }; @@ -195,12 +195,20 @@ struct ip_linklocal_stat { #define IP_NOIPSEC 0x4 /* No IPSec processing */ #define IP_ROUTETOIF SO_DONTROUTE /* bypass routing tables (0x0010) */ #define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets (0x0020) */ +#define IP_OUTARGS 0x100 /* has ancillary output info */ struct ip; struct inpcb; struct route; struct sockopt; +/* + * Extra information passed to ip_output when IP_OUTARGS is set. + */ +struct ip_out_args { + unsigned int ipoa_ifscope; /* interface scope */ +}; + extern struct ipstat ipstat; #if !defined(RANDOM_IP_ID) || RANDOM_IP_ID == 0 extern u_short ip_id; /* ip packet ctr, for ids */ @@ -211,9 +219,10 @@ extern struct protosw *ip_protox[]; extern struct socket *ip_rsvpd; /* reservation protocol daemon */ extern struct socket *ip_mrouter; /* multicast routing daemon */ extern int (*legal_vif_num)(int); -extern u_long (*ip_mcast_src)(int); +extern u_int32_t (*ip_mcast_src)(int); extern int rsvp_on; extern struct pr_usrreqs rip_usrreqs; +extern int ip_doscopedroute; int ip_ctloutput(struct socket *, struct sockopt *sopt); void ip_drain(void); @@ -221,12 +230,11 @@ void ip_freemoptions(struct ip_moptions *); void ip_init(void) __attribute__((section("__TEXT, initcode"))); extern int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *, struct ip_moptions *); -int ip_output(struct mbuf *, - struct mbuf *, struct route *, int, struct ip_moptions *, struct ifnet *); -int ip_output_list(struct mbuf *, int, - struct mbuf *, struct route *, int, struct ip_moptions *, struct ifnet *); -struct in_ifaddr * - ip_rtaddr(struct in_addr, struct route *); +extern int ip_output(struct mbuf *, struct mbuf *, struct route *, int, + struct ip_moptions *, struct ip_out_args *); +extern int ip_output_list(struct mbuf *, int, struct mbuf *, struct route *, + int, struct ip_moptions *, struct ip_out_args *); +struct in_ifaddr *ip_rtaddr(struct in_addr); void ip_savecontrol(struct inpcb *, struct mbuf **, struct ip *, struct mbuf *); void ip_slowtimo(void); @@ -241,8 +249,8 @@ int rip_ctloutput(struct socket *, struct sockopt *); void rip_ctlinput(int, struct sockaddr *, void *); void rip_init(void) __attribute__((section("__TEXT, initcode"))); void rip_input(struct mbuf *, int); -int rip_output(struct mbuf *, struct socket *, u_long); -int rip_unlock(struct socket *, int, int); +int rip_output(struct mbuf *, struct socket *, u_int32_t, struct mbuf *); +int rip_unlock(struct socket *, int, void *); void ipip_input(struct mbuf *, int); void rsvp_input(struct mbuf *, int); int ip_rsvp_init(struct socket *); @@ -262,5 +270,7 @@ extern void udp_out_cksum_stats(u_int32_t); int rip_send(struct socket *, int , struct mbuf *, struct sockaddr *, struct mbuf *, struct proc *); +extern int ip_fragment(struct mbuf *, struct ifnet *, unsigned long, int); + #endif /* KERNEL_PRIVATE */ #endif /* !_NETINET_IP_VAR_H_ */