Date: Thu, 19 Jun 2008 05:13:10 GMT From: Julian Elischer <julian@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 143745 for review Message-ID: <200806190513.m5J5DAj4026228@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=143745 Change 143745 by julian@julian_trafmon1 on 2008/06/19 05:13:09 Bring in more whitespace fixes I apparently missed Affected files ... .. //depot/projects/vimage-devel/src/sys/net/bpf.c#4 edit .. //depot/projects/vimage-devel/src/sys/net/if_ethersubr.c#4 edit .. //depot/projects/vimage-devel/src/sys/net/route.c#4 edit .. //depot/projects/vimage-devel/src/sys/net/vnet.h#4 edit .. //depot/projects/vimage-devel/src/sys/net80211/ieee80211.c#4 edit .. //depot/projects/vimage-devel/src/sys/netgraph/ng_bridge.c#4 edit .. //depot/projects/vimage-devel/src/sys/netgraph/ng_ether.c#4 edit .. //depot/projects/vimage-devel/src/sys/netgraph/ng_hub.c#4 edit .. //depot/projects/vimage-devel/src/sys/netgraph/ng_wormhole.c#4 edit .. //depot/projects/vimage-devel/src/sys/netinet/in_pcb.c#4 edit .. //depot/projects/vimage-devel/src/sys/netinet/tcp_syncache.h#3 edit Differences ... ==== //depot/projects/vimage-devel/src/sys/net/bpf.c#4 (text+ko) ==== @@ -1417,7 +1417,7 @@ if (target_vimage == NULL) return ENXIO; target_vnet = target_vimage->v_net; - } + } CURVNET_SET_QUIET(target_vnet); #endif ==== //depot/projects/vimage-devel/src/sys/net/if_ethersubr.c#4 (text+ko) ==== @@ -892,16 +892,16 @@ static void ether_reassign(struct ifnet *ifp, struct vnet *vnet, char *dname) { - u_char eaddr[6]; + u_char eaddr[6]; bcopy(IF_LLADDR(ifp), eaddr, 6); ether_ifdetach(ifp); ifp->if_bpf = NULL; - if_reassign_common(ifp, vnet, "eth"); + if_reassign_common(ifp, vnet, "eth"); if (dname) snprintf(ifp->if_xname, IFNAMSIZ, "%s", dname); - CURVNET_SET_QUIET(vnet); + CURVNET_SET_QUIET(vnet); ether_ifattach(ifp, eaddr); CURVNET_RESTORE(); } @@ -977,7 +977,7 @@ SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW, 0, "Ethernet"); #if defined(INET) || defined(INET6) SYSCTL_V_INT(V_NET, vnet_net, _net_link_ether, OID_AUTO, ipfw, CTLFLAG_RW, - ether_ipfw, 0, "Pass ether pkts through firewall"); + ether_ipfw, 0, "Pass ether pkts through firewall"); #endif #if 0 ==== //depot/projects/vimage-devel/src/sys/net/route.c#4 (text+ko) ==== @@ -153,15 +153,15 @@ { int table; int fam; - struct domain *dom; - INIT_VNET_NET(curvnet); + struct domain *dom; + INIT_VNET_NET(curvnet); for (dom = domains; dom; dom = dom->dom_next) { if (dom->dom_rtattach) { for (table = 0; table < rt_numfibs; table++) { if ( (fam = dom->dom_family) == AF_INET || table == 0) { - /* for now only AF_INET has > 1 table */ + /* for now only AF_INET has > 1 table */ /* XXX MRT * rtattach will be also called * from vfs_export.c but the @@ -178,7 +178,7 @@ } } } - return 0; + return (0); } #ifdef VIMAGE @@ -187,15 +187,15 @@ { int table; int fam; - struct domain *dom; - INIT_VNET_NET(curvnet); + struct domain *dom; + INIT_VNET_NET(curvnet); for (dom = domains; dom; dom = dom->dom_next) { if (dom->dom_rtdetach) { for (table = 0; table < rt_numfibs; table++) { if ( (fam = dom->dom_family) == AF_INET || table == 0) { - /* for now only AF_INET has > 1 table */ + /* for now only AF_INET has > 1 table */ dom->dom_rtdetach( (void **)&V_rt_tables[table][fam], dom->dom_rtoffset); @@ -205,7 +205,7 @@ } } } - return 0; + return (0); } VNET_MOD_DECLARE_STATELESS(RTABLE, rtable, rtable_init, rtable_idetach, NET); @@ -233,7 +233,7 @@ #ifndef _SYS_SYSPROTO_H_ struct setfib_args { - int fibnum; + int fibnum; }; #endif int ==== //depot/projects/vimage-devel/src/sys/net/vnet.h#4 (text+ko) ==== @@ -70,7 +70,7 @@ LIST_HEAD(, rawcb) _rawcb_list; - int _ether_ipfw; + int _ether_ipfw; }; #endif ==== //depot/projects/vimage-devel/src/sys/net80211/ieee80211.c#4 (text+ko) ==== @@ -672,18 +672,18 @@ ieee80211_reassign( struct ieee80211vap *vap, struct vnet *vnet, char *dname) { struct ifnet *ifp = vap->iv_ifp; - u_char eaddr[6]; + u_char eaddr[6]; bcopy(IF_LLADDR(ifp), eaddr, 6); bpfdetach(ifp); ether_ifdetach(ifp); ifp->if_bpf = NULL; vap->iv_rawbpf = NULL; - if_reassign_common(ifp, vnet, ifp->if_dname); + if_reassign_common(ifp, vnet, ifp->if_dname); if (dname) snprintf(ifp->if_xname, IFNAMSIZ, "%s", dname); - CURVNET_SET_QUIET(vnet); + CURVNET_SET_QUIET(vnet); ether_ifattach(ifp, eaddr); bpfattach2(ifp, DLT_IEEE802_11, sizeof(struct ieee80211_frame_addr4), &vap->iv_rawbpf); ==== //depot/projects/vimage-devel/src/sys/netgraph/ng_bridge.c#4 (text+ko) ==== @@ -375,7 +375,7 @@ NG_HOOK_SET_PRIVATE(hook, (void *)linkNum); priv->numLinks++; return (0); - } + } /* Unknown hook name */ return (EINVAL); ==== //depot/projects/vimage-devel/src/sys/netgraph/ng_ether.c#4 (text+ko) ==== @@ -782,7 +782,7 @@ static int ng_ether_iattach(const void *unused) { - INIT_VNET_NET(curvnet); + INIT_VNET_NET(curvnet); struct ifnet *ifp; #ifdef VIMAGE ==== //depot/projects/vimage-devel/src/sys/netgraph/ng_hub.c#4 (text+ko) ==== @@ -62,9 +62,9 @@ static int ng_hub_newhook(node_p node, hook_p hook, const char *name) { - if (strcmp(name, "anchor") == 0) - node->nd_private = (void *) 1; - return 0; + if (strcmp(name, "anchor") == 0) + node->nd_private = (void *) 1; + return (0); } static int ==== //depot/projects/vimage-devel/src/sys/netgraph/ng_wormhole.c#4 (text+ko) ==== @@ -124,19 +124,19 @@ }; static const struct ng_cmdlist ng_wormhole_cmds[] = { - { + { .cookie = NGM_WORMHOLE_COOKIE, .cmd = NGM_WORMHOLE_PEER, .name = "peer", .mesgType = &ng_wormhole_peer_type, .respType = &ng_wormhole_peer_type, - }, - { + }, + { .cookie = NGM_WORMHOLE_COOKIE, .cmd = NGM_WORMHOLE_STATUS, .name = "status", .respType = &ng_wormhole_status_type, - }, + }, { 0 } }; @@ -182,9 +182,9 @@ return (ENOMEM); NG_NODE_SET_PRIVATE(node, priv); - priv->unit = alloc_unr(V_ng_wormhole_unit); + priv->unit = alloc_unr(V_ng_wormhole_unit); snprintf(buf, NG_NODESIZ, "%s%d", typestruct.name, priv->unit); - if (ng_name_node(node, buf) != 0) + if (ng_name_node(node, buf) != 0) log(LOG_WARNING, "%s: can't acquire netgraph name\n", buf); priv->vnet = curvnet; priv->node = node; @@ -248,7 +248,7 @@ sizeof(priv->remote_priv)); } - break; + break; case NGM_WORMHOLE_STATUS: NG_MKRESPONSE(resp, msg, sizeof(priv->status), M_NOWAIT); @@ -257,15 +257,15 @@ else bcopy(&priv->status, resp->data, sizeof(priv->status)); - break; - default: - error = EINVAL; - break; + break; + default: + error = EINVAL; + break; } break; - default: - error = EINVAL; - break; + default: + error = EINVAL; + break; } NG_RESPOND_MSG(error, node, item, resp); NG_FREE_MSG(msg); @@ -274,8 +274,8 @@ static int ng_wormhole_peer_parse(const struct ng_parse_type *type, - const char *s, int *off, const u_char *const start, - u_char *const buf, int *buflen) + const char *s, int *off, const u_char *const start, + u_char *const buf, int *buflen) { char node_name_buf[NG_NODESIZ]; char *t; @@ -296,9 +296,9 @@ return (EINVAL); if ((len = t - (s + *off)) > sizeof(node_name_buf) - 1) return (EINVAL); - strncpy(node_name_buf, s + *off, len); - node_name_buf[len] = '\0'; - *off += len + 1; /* vnet name should be in &s[*off] now */ + strncpy(node_name_buf, s + *off, len); + node_name_buf[len] = '\0'; + *off += len + 1; /* vnet name should be in &s[*off] now */ /* XXX should lock all wormhole list here */ LIST_FOREACH(*remote_priv, &all_wormholes_head, all_wormholes_le) @@ -316,7 +316,7 @@ static int ng_wormhole_peer_unparse(const struct ng_parse_type *type, - const u_char *data, int *off, char *cbuf, int cbuflen) + const u_char *data, int *off, char *cbuf, int cbuflen) { const priv_p *remote_priv = (const priv_p *)(data + *off); @@ -332,7 +332,7 @@ static int ng_wormhole_status_unparse(const struct ng_parse_type *type, - const u_char *data, int *off, char *cbuf, int cbuflen) + const u_char *data, int *off, char *cbuf, int cbuflen) { const int *status = (const int *)(data + *off); @@ -373,7 +373,7 @@ static int ng_wormhole_rcvdata(hook_p hook, item_p item) { - priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); int error = 0; priv_p remote_priv = priv->remote_priv; struct mbuf *m; @@ -385,7 +385,7 @@ m = NGI_M(item); m->m_flags |= M_REMOTE_VNET; CURVNET_SET_QUIET(remote_priv->vnet); - NG_FWD_ITEM_HOOK(error, item, remote_priv->hook); + NG_FWD_ITEM_HOOK(error, item, remote_priv->hook); CURVNET_RESTORE(); } return (error); ==== //depot/projects/vimage-devel/src/sys/netinet/in_pcb.c#4 (text+ko) ==== @@ -128,8 +128,8 @@ #endif { #ifdef VIMAGE - INIT_VNET_INET(curvnet); - SYSCTL_RESOLVE_V_ARG1(); + INIT_VNET_INET(curvnet); + SYSCTL_RESOLVE_V_ARG1(); #endif int error; ==== //depot/projects/vimage-devel/src/sys/netinet/tcp_syncache.h#3 (text+ko) ==== @@ -1,6 +1,12 @@ /*- - * Copyright (c) 1982, 1986, 1993, 1994, 1995 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2001 McAfee, Inc. + * Copyright (c) 2006 Andre Oppermann, Internet Business Solutions AG + * All rights reserved. + * + * This software was developed for the FreeBSD Project by Jonathan Lemon + * and McAfee Research, the Security Research Division of McAfee, Inc. under + * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the + * DARPA CHATS research program. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,14 +16,11 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -26,27 +29,95 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95 - * $FreeBSD: src/sys/netinet/tcp_syncache.h,v 1.2 2007/12/12 20:35:59 kmacy Exp $ + * XXX RCS ID */ #ifndef _NETINET_TCP_SYNCACHE_H_ #define _NETINET_TCP_SYNCACHE_H_ #ifdef _KERNEL -void syncache_init(void); -void syncache_unreach(struct in_conninfo *, struct tcphdr *); -int syncache_expand(struct in_conninfo *, struct tcpopt *, - struct tcphdr *, struct socket **, struct mbuf *); -void syncache_add(struct in_conninfo *, struct tcpopt *, - struct tcphdr *, struct inpcb *, struct socket **, struct mbuf *); -void syncache_offload_add(struct in_conninfo *, struct tcpopt *, - struct tcphdr *, struct inpcb *, struct socket **, - struct toe_usrreqs *tu, void *toepcb); -void syncache_chkrst(struct in_conninfo *, struct tcphdr *); -void syncache_badack(struct in_conninfo *); -int syncache_pcbcount(void); -int syncache_pcblist(struct sysctl_req *req, int max_pcbs, int *pcbs_exported); +void syncache_init(void); +#ifdef VIMAGE +void syncache_destroy(void); +#endif +void syncache_unreach(struct in_conninfo *, struct tcphdr *); +int syncache_expand(struct in_conninfo *, struct tcpopt *, + struct tcphdr *, struct socket **, struct mbuf *); +void syncache_add(struct in_conninfo *, struct tcpopt *, + struct tcphdr *, struct inpcb *, struct socket **, struct mbuf *); +void syncache_offload_add(struct in_conninfo *, struct tcpopt *, + struct tcphdr *, struct inpcb *, struct socket **, + struct toe_usrreqs *tu, void *toepcb); +void syncache_chkrst(struct in_conninfo *, struct tcphdr *); +void syncache_badack(struct in_conninfo *); +int syncache_pcbcount(void); +int syncache_pcblist(struct sysctl_req *req, int max_pcbs, + int *pcbs_exported); + +struct syncache { + TAILQ_ENTRY(syncache) sc_hash; + struct in_conninfo sc_inc; /* addresses */ + u_long sc_rxttime; /* retransmit time */ + u_int16_t sc_rxmits; /* retransmit counter */ + + u_int32_t sc_tsreflect; /* timestamp to reflect */ + u_int32_t sc_ts; /* our timestamp to send */ + u_int32_t sc_tsoff; /* ts offset w/ syncookies */ + u_int32_t sc_flowlabel; /* IPv6 flowlabel */ + tcp_seq sc_irs; /* seq from peer */ + tcp_seq sc_iss; /* our ISS */ + struct mbuf *sc_ipopts; /* source route */ + + u_int16_t sc_peer_mss; /* peer's MSS */ + u_int16_t sc_wnd; /* advertised window */ + u_int8_t sc_ip_ttl; /* IPv4 TTL */ + u_int8_t sc_ip_tos; /* IPv4 TOS */ + u_int8_t sc_requested_s_scale:4, + sc_requested_r_scale:4; + u_int8_t sc_flags; +#define SCF_NOOPT 0x01 /* no TCP options */ +#define SCF_WINSCALE 0x02 /* negotiated window scaling */ +#define SCF_TIMESTAMP 0x04 /* negotiated timestamps */ + /* MSS is implicit */ +#define SCF_UNREACH 0x10 /* icmp unreachable received */ +#define SCF_SIGNATURE 0x20 /* send MD5 digests */ +#define SCF_SACK 0x80 /* send SACK option */ +#ifndef TCP_OFFLOAD_DISABLE + struct toe_usrreqs *sc_tu; /* TOE operations */ + void *sc_toepcb; /* TOE protocol block */ +#endif +#ifdef MAC + struct label *sc_label; /* MAC label reference */ +#endif +}; + +#define SYNCOOKIE_SECRET_SIZE 8 /* dwords */ +#define SYNCOOKIE_LIFETIME 16 /* seconds */ + +struct syncache_head { + struct mtx sch_mtx; + TAILQ_HEAD(sch_head, syncache) sch_bucket; + struct vnet *sch_vnet; + struct callout sch_timer; + int sch_nextc; + u_int sch_length; + u_int sch_oddeven; + u_int32_t sch_secbits_odd[SYNCOOKIE_SECRET_SIZE]; + u_int32_t sch_secbits_even[SYNCOOKIE_SECRET_SIZE]; + u_int sch_reseed; /* time_uptime, seconds */ +}; + +struct tcp_syncache { + struct syncache_head *hashbase; + uma_zone_t zone; + u_int hashsize; + u_int hashmask; + u_int bucket_limit; + u_int cache_count; /* XXX: unprotected */ + u_int cache_limit; + u_int rexmt_limit; + u_int hash_secret; +}; #endif /* _KERNEL */ -#endif /* _NETINET_TCP_SYNCACHE_H_ */ +#endif /* !_NETINET_TCP_SYNCACHE_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806190513.m5J5DAj4026228>