PERFORCE change 112706 for review
Marko Zec
zec at FreeBSD.org
Wed Jan 10 04:47:13 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=112706
Change 112706 by zec at zec_tca51 on 2007/01/10 12:46:48
Whitespace cleanup.
Pointed out by: julian
Affected files ...
.. //depot/projects/vimage/src/sys/kern/init_main.c#4 edit
.. //depot/projects/vimage/src/sys/kern/kern_linker.c#3 edit
.. //depot/projects/vimage/src/sys/kern/kern_vimage.c#11 edit
.. //depot/projects/vimage/src/sys/net/if_loop.c#7 edit
.. //depot/projects/vimage/src/sys/net/route.c#4 edit
.. //depot/projects/vimage/src/sys/netgraph/ng_base.c#4 edit
.. //depot/projects/vimage/src/sys/netinet/in_var.h#4 edit
.. //depot/projects/vimage/src/sys/netinet/ip_fastfwd.c#4 edit
.. //depot/projects/vimage/src/sys/netinet/ip_icmp.c#3 edit
.. //depot/projects/vimage/src/sys/netinet/ip_input.c#7 edit
.. //depot/projects/vimage/src/sys/netinet/ip_options.c#3 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_hostcache.c#7 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_syncache.h#3 edit
.. //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#6 edit
.. //depot/projects/vimage/src/sys/netinet6/ip6_input.c#5 edit
.. //depot/projects/vimage/src/sys/netinet6/ip6_output.c#3 edit
.. //depot/projects/vimage/src/sys/netinet6/vinet6.h#3 edit
.. //depot/projects/vimage/src/sys/sys/sockio.h#3 edit
.. //depot/projects/vimage/src/sys/sys/vimage.h#9 edit
Differences ...
==== //depot/projects/vimage/src/sys/kern/init_main.c#4 (text+ko) ====
@@ -451,8 +451,8 @@
td->td_ucred = crhold(p->p_ucred);
#ifdef VIMAGE
- /* Init lives in the default vimage */
- td->td_vimage = &vimage_0;
+ /* Init lives in the default vimage */
+ td->td_vimage = &vimage_0;
#endif
/* Create sigacts. */
==== //depot/projects/vimage/src/sys/kern/kern_linker.c#3 (text+ko) ====
@@ -1199,7 +1199,7 @@
lookup.symvalue = (uintptr_t)symval.value;
lookup.symsize = symval.size;
error = copyout(&lookup, uap->data,
- sizeof(lookup));
+ sizeof(lookup));
break;
}
}
@@ -1210,7 +1210,7 @@
CURVNETB_RESTORE();
if (error == 0) {
error = copyout(&lookup, uap->data,
- sizeof(lookup));
+ sizeof(lookup));
}
}
#else
==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#11 (text+ko) ====
@@ -182,12 +182,12 @@
}
if (new_vnetb == NULL)
- return (ENXIO);
+ return (ENXIO);
if (ifp == NULL)
- ifp = ifunit(vi_req->vi_chroot);
+ ifp = ifunit(vi_req->vi_chroot);
if (ifp == NULL)
- return (ENXIO);
+ return (ENXIO);
if (vi_req != NULL) {
struct ifnet *t_ifp;
@@ -209,15 +209,15 @@
* that, we reassing the interface unit number to look nice
* in the target vnetb.
*/
- switch (ifp->if_type) {
- case IFT_ETHER:
+ switch (ifp->if_type) {
+ case IFT_ETHER:
bcopy(IF_LLADDR(ifp), eaddr, 6);
ether_ifdetach(ifp);
break;
- default:
+ default:
panic("don't know yet how to handle iftype %d", ifp->if_type);
/* if_detach(ifp); */
- }
+ }
ifp->if_bpf = NULL;
CURVNETB_SET(new_vnetb);
@@ -242,14 +242,14 @@
if_grow();
ifnet_byindex(ifp->if_index) = ifp;
- switch (ifp->if_type) {
- case IFT_ETHER:
+ switch (ifp->if_type) {
+ case IFT_ETHER:
ether_ifattach(ifp, eaddr);
break;
- default:
+ default:
panic("don't know yet how to handle iftype %d", ifp->if_type);
/* if_attach(ifp); */
- }
+ }
getmicrotime(&ifp->if_lastchange);
if (vi_req != NULL)
@@ -283,10 +283,10 @@
break;
}
if (vip_r == NULL && !(vi_req->req_action & VI_CREATE)) {
- return (ESRCH);
+ return (ESRCH);
}
if (vip_r != NULL && vi_req->req_action & VI_CREATE) {
- return (EADDRINUSE);
+ return (EADDRINUSE);
}
if (vi_req->req_action == VI_GETNEXT) {
vi_getnext_loop:
@@ -344,7 +344,7 @@
}
if (vip == vip_r && vip != &vimage_0) {
- return (EPERM);
+ return (EPERM);
}
}
@@ -388,28 +388,28 @@
int maxsock, tsc_hashs, tsc_buckl;
{
struct vimage *vip;
- struct vnet_base *vnetb;
- struct vprocg *vprocg;
- struct vcpu *vcpu;
+ struct vnet_base *vnetb;
+ struct vprocg *vprocg;
+ struct vcpu *vcpu;
struct domain *dp;
int i;
printf("vi_alloc: %s\n", name);
/* A brute force check whether there's enough mem for a new vimage */
- vip = malloc(127*1024, M_VIMAGE, M_NOWAIT); /* XXX aaaargh... */
- if (vip == NULL)
+ vip = malloc(127*1024, M_VIMAGE, M_NOWAIT); /* XXX aaaargh... */
+ if (vip == NULL)
return NULL;
- vip = realloc(vip, sizeof(struct vimage), M_VIMAGE, M_NOWAIT);
- if (vip == NULL)
- panic("vi_alloc: malloc failed for vimage \"%s\"\n", name);
- bzero(vip, sizeof(struct vimage));
- vip->vi_id = last_vi_id++;
+ vip = realloc(vip, sizeof(struct vimage), M_VIMAGE, M_NOWAIT);
+ if (vip == NULL)
+ panic("vi_alloc: malloc failed for vimage \"%s\"\n", name);
+ bzero(vip, sizeof(struct vimage));
+ vip->vi_id = last_vi_id++;
- vnetb = malloc(sizeof(struct vnet_base), M_VNET, M_NOWAIT);
- if (vnetb == NULL)
- panic("vi_alloc: malloc failed for vnetb \"%s\"\n", name);
- bzero(vnetb, sizeof(struct vnet_base));
+ vnetb = malloc(sizeof(struct vnet_base), M_VNET, M_NOWAIT);
+ if (vnetb == NULL)
+ panic("vi_alloc: malloc failed for vnetb \"%s\"\n", name);
+ bzero(vnetb, sizeof(struct vnet_base));
vip->v_vnetb = vnetb;
vnetb->vnet_magic_n = VNET_MAGIC_N;
for (i = 0; i < 100; i++) /* XXX !!! */
@@ -419,19 +419,19 @@
break;
}
- vprocg = malloc(sizeof(struct vprocg), M_VPROCG, M_NOWAIT);
- if (vprocg == NULL)
- panic("vi_alloc: malloc failed for vprocg \"%s\"\n", name);
- bzero(vprocg, sizeof(struct vprocg));
+ vprocg = malloc(sizeof(struct vprocg), M_VPROCG, M_NOWAIT);
+ if (vprocg == NULL)
+ panic("vi_alloc: malloc failed for vprocg \"%s\"\n", name);
+ bzero(vprocg, sizeof(struct vprocg));
vip->v_procg = vprocg;
- vcpu = malloc(sizeof(struct vcpu), M_VCPU, M_NOWAIT);
- if (vcpu == NULL)
- panic ("vi_alloc: malloc failed for vcpu \"%s\"\n", name);
- bzero (vcpu, sizeof(struct vcpu));
+ vcpu = malloc(sizeof(struct vcpu), M_VCPU, M_NOWAIT);
+ if (vcpu == NULL)
+ panic ("vi_alloc: malloc failed for vcpu \"%s\"\n", name);
+ bzero (vcpu, sizeof(struct vcpu));
vip->v_cpu = vcpu;
- /* Some initialization stuff... */
+ /* Some initialization stuff... */
sprintf(vip->vi_name, "%s", name);
/*
@@ -535,16 +535,16 @@
/* hopefully, we are finally OK to free the vnetb container itself! */
LIST_REMOVE(vnetb, vnetb_le);
vnetb->vnet_magic_n = -1;
- free(vnetb, M_VNET);
+ free(vnetb, M_VNET);
LIST_REMOVE(vprocg, vprocg_le);
- free(vprocg, M_VPROCG);
+ free(vprocg, M_VPROCG);
LIST_REMOVE(vcpu, vcpu_le);
- free(vcpu, M_VCPU);
+ free(vcpu, M_VCPU);
LIST_REMOVE(vip, vi_le);
- free(vip, M_VIMAGE);
+ free(vip, M_VIMAGE);
}
==== //depot/projects/vimage/src/sys/net/if_loop.c#7 (text+ko) ====
@@ -124,7 +124,7 @@
lo_clone_destroy(ifp)
struct ifnet *ifp;
{
- INIT_VNET_NET(ifp->if_vnetb);
+ INIT_VNET_NET(ifp->if_vnetb);
struct lo_softc *sc;
sc = ifp->if_softc;
@@ -147,7 +147,7 @@
int unit;
caddr_t params;
{
- INIT_VNET_NET(curvnetb);
+ INIT_VNET_NET(curvnetb);
struct ifnet *ifp;
struct lo_softc *sc;
@@ -181,12 +181,12 @@
#ifdef VIMAGE
static struct vnet_modinfo vnet_loif_modinfo = {
- .id = VNET_MOD_LOIF,
+ .id = VNET_MOD_LOIF,
.flags = VNET_MFLAG_ORDER_2ND,
- .name = "loif",
- .symmap = NULL,
- .i_attach = vnet_loif_iattach,
- .i_detach = NULL,
+ .name = "loif",
+ .symmap = NULL,
+ .i_attach = vnet_loif_iattach,
+ .i_detach = NULL,
};
#endif
@@ -213,9 +213,9 @@
case MOD_LOAD:
mtx_init(&lo_mtx, "lo_mtx", NULL, MTX_DEF);
#ifdef VIMAGE
- vnet_mod_register(&vnet_loif_modinfo);
+ vnet_mod_register(&vnet_loif_modinfo);
#else
- vnet_loif_iattach();
+ vnet_loif_iattach();
#endif
break;
case MOD_UNLOAD:
@@ -249,7 +249,7 @@
if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
m_freem(m);
return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
- rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
+ rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
}
ifp->if_opackets++;
@@ -295,7 +295,7 @@
int af;
int hlen;
{
- INIT_VNET_NET(ifp->if_vnetb);
+ INIT_VNET_NET(ifp->if_vnetb);
int isr;
M_ASSERTPKTHDR(m);
==== //depot/projects/vimage/src/sys/net/route.c#4 (text+ko) ====
@@ -79,10 +79,10 @@
#ifdef VIMAGE
static struct vnet_modinfo vnet_rtable_modinfo = {
- .id = VNET_MOD_RTABLE,
+ .id = VNET_MOD_RTABLE,
.flags = VNET_MFLAG_ORDER_2ND,
- .name = "rtable",
- .i_attach = rtable_init
+ .name = "rtable",
+ .i_attach = rtable_init
};
#endif
@@ -108,7 +108,7 @@
NULL, NULL, UMA_ALIGN_PTR, 0);
rn_init(); /* initialize all zeroes, all ones, mask table */
#ifdef VIMAGE
- vnet_mod_register(&vnet_rtable_modinfo);
+ vnet_mod_register(&vnet_rtable_modinfo);
#else
rtable_init();
#endif
==== //depot/projects/vimage/src/sys/netgraph/ng_base.c#4 (text+ko) ====
@@ -242,12 +242,12 @@
struct vnet_netgraph vnet_netgraph_0;
static struct vnet_modinfo vnet_netgraph_modinfo = {
- .id = VNET_MOD_NETGRAPH,
+ .id = VNET_MOD_NETGRAPH,
.flags = VNET_MFLAG_ORDER_2ND,
- .name = "netgraph",
- .symmap = NULL,
- .i_attach = vnet_netgraph_iattach,
- .i_detach = NULL,
+ .name = "netgraph",
+ .symmap = NULL,
+ .i_attach = vnet_netgraph_iattach,
+ .i_detach = NULL,
};
#endif
==== //depot/projects/vimage/src/sys/netinet/in_var.h#4 (text+ko) ====
@@ -95,17 +95,17 @@
/*
* IP datagram reassembly.
*/
-#define IPREASS_NHASH_LOG2 6
-#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2)
-#define IPREASS_HMASK (IPREASS_NHASH - 1)
+#define IPREASS_NHASH_LOG2 6
+#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2)
+#define IPREASS_HMASK (IPREASS_NHASH - 1)
#define IPREASS_HASH(x,y) \
- (((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)
+ (((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)
/*
* Macro for finding the internet address structure (in_ifaddr)
* corresponding to one of our IP addresses (in_addr).
*/
-#define INADDR_NHASH_LOG2 9
+#define INADDR_NHASH_LOG2 9
#define INADDR_NHASH (1 << INADDR_NHASH_LOG2)
#define INADDR_HASHVAL(x) fnv_32_buf((&(x)), sizeof(x), FNV1_32_INIT)
#define INADDR_HASH(x) \
==== //depot/projects/vimage/src/sys/netinet/ip_fastfwd.c#4 (text+ko) ====
@@ -159,7 +159,7 @@
struct mbuf *
ip_fastforward(struct mbuf *m)
{
- INIT_VNET_INET(curvnetb);
+ INIT_VNET_INET(curvnetb);
struct ip *ip;
struct mbuf *m0 = NULL;
struct route ro;
==== //depot/projects/vimage/src/sys/netinet/ip_icmp.c#3 (text+ko) ====
@@ -304,7 +304,7 @@
struct mbuf *m;
int off;
{
- INIT_VNET_INET(curvnetb);
+ INIT_VNET_INET(curvnetb);
struct icmp *icp;
struct in_ifaddr *ia;
struct ip *ip = mtod(m, struct ip *);
==== //depot/projects/vimage/src/sys/netinet/ip_input.c#7 (text+ko) ====
@@ -212,7 +212,7 @@
struct vnet_inet vnet_inet_0;
struct vnet_symmap vnet_inet_symmap[] = {
- VNET_SYMMAP_END
+ VNET_SYMMAP_END
};
static struct vnet_modinfo vnet_inet_modinfo = {
@@ -221,7 +221,7 @@
.symmap = vnet_inet_symmap,
.i_attach = NULL,
.i_detach = NULL,
-};
+};
MALLOC_DEFINE(M_INET, "inet", "INET domain instance");
#endif /* VIMAGE */
@@ -239,17 +239,17 @@
#ifdef VIMAGE
struct vnet_inet *vnet_inet;
- if (curvnetb == &vnetb_0) {
+ if (curvnetb == &vnetb_0) {
vnet_mod_register(&vnet_inet_modinfo);
vnet_inet = &vnet_inet_0;
- } else {
+ } else {
vnet_inet = malloc(sizeof(struct vnet_inet),
M_INET, M_NOWAIT | M_ZERO);
if (vnet_inet == NULL)
panic("couldn't allocate memory for vnet_inet");
- }
+ }
curvnetb->mod_data[vnet_inet_modinfo.id] = vnet_inet;
- vnet_inet->parent_vnetb = curvnetb;
+ vnet_inet->parent_vnetb = curvnetb;
#endif
TAILQ_INIT(&V_in_ifaddrhead);
@@ -258,7 +258,7 @@
/* Initialize IP reassembly queue. */
for (i = 0; i < IPREASS_NHASH; i++)
- TAILQ_INIT(&V_ipq[i]);
+ TAILQ_INIT(&V_ipq[i]);
V_maxnipq = nmbclusters / 32;
V_maxfragsperpacket = 16;
V_ipq_zone = uma_zcreate("ipq", sizeof(struct ipq), NULL, NULL, NULL,
@@ -270,7 +270,7 @@
* Skip global initialization stuff
* for non-default instances.
*/
- if (curvnetb != &vnetb_0)
+ if (curvnetb != &vnetb_0)
return;
#endif
==== //depot/projects/vimage/src/sys/netinet/ip_options.c#3 (text+ko) ====
@@ -101,7 +101,7 @@
int
ip_dooptions(struct mbuf *m, int pass)
{
- INIT_VNET_INET(curvnetb);
+ INIT_VNET_INET(curvnetb);
struct ip *ip = mtod(m, struct ip *);
u_char *cp;
struct in_ifaddr *ia;
==== //depot/projects/vimage/src/sys/netinet/tcp_hostcache.c#7 (text+ko) ====
@@ -176,15 +176,15 @@
V_tcp_hostcache.hashsize = TCP_HOSTCACHE_HASHSIZE;
V_tcp_hostcache.bucket_limit = TCP_HOSTCACHE_BUCKETLIMIT;
V_tcp_hostcache.cache_limit =
- V_tcp_hostcache.hashsize * V_tcp_hostcache.bucket_limit;
+ V_tcp_hostcache.hashsize * V_tcp_hostcache.bucket_limit;
V_tcp_hostcache.expire = TCP_HOSTCACHE_EXPIRE;
TUNABLE_INT_FETCH("net.inet.tcp.hostcache.hashsize",
- &V_tcp_hostcache.hashsize);
+ &V_tcp_hostcache.hashsize);
TUNABLE_INT_FETCH("net.inet.tcp.hostcache.cachelimit",
- &V_tcp_hostcache.cache_limit);
+ &V_tcp_hostcache.cache_limit);
TUNABLE_INT_FETCH("net.inet.tcp.hostcache.bucketlimit",
- &V_tcp_hostcache.bucket_limit);
+ &V_tcp_hostcache.bucket_limit);
if (!powerof2(V_tcp_hostcache.hashsize)) {
printf("WARNING: hostcache hash size is not a power of 2.\n");
V_tcp_hostcache.hashsize = 512; /* safe default */
@@ -214,7 +214,7 @@
* XXX don't need a separate zone for each hc instance - revisit!!!
*/
V_tcp_hostcache.zone =
- uma_zcreate("hostcache", sizeof(struct hc_metrics),
+ uma_zcreate("hostcache", sizeof(struct hc_metrics),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
uma_zone_set_max(V_tcp_hostcache.zone, V_tcp_hostcache.cache_limit);
==== //depot/projects/vimage/src/sys/netinet/tcp_syncache.h#3 (text+ko) ====
@@ -67,8 +67,8 @@
struct label *sc_label; /* MAC label reference */
};
-#define SYNCOOKIE_SECRET_SIZE 8 /* dwords */
-#define SYNCOOKIE_LIFETIME 16 /* seconds */
+#define SYNCOOKIE_SECRET_SIZE 8 /* dwords */
+#define SYNCOOKIE_LIFETIME 16 /* seconds */
struct syncache_head {
struct mtx sch_mtx;
==== //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#6 (text+ko) ====
@@ -170,7 +170,7 @@
INIT_VNET_INET(curvnetb);
#ifdef VIMAGE
- if (curvnetb == &vnetb_0) {
+ if (curvnetb == &vnetb_0) {
#endif
udp_ipi_zone = uma_zcreate("udpcb", sizeof(struct inpcb), NULL,
NULL, udp_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
@@ -178,7 +178,7 @@
EVENTHANDLER_REGISTER(maxsockets_change, udp_zone_change, NULL,
EVENTHANDLER_PRI_ANY);
#ifdef VIMAGE
- }
+ }
#endif
INP_INFO_LOCK_INIT(&V_udbinfo, "udp");
==== //depot/projects/vimage/src/sys/netinet6/ip6_input.c#5 (text+ko) ====
@@ -150,17 +150,17 @@
#ifdef VIMAGE
struct vnet_inet6 vnet_inet6_0;
-
+
struct vnet_symmap vnet_inet6_symmap[] = {
- VNET_SYMMAP_END
+ VNET_SYMMAP_END
};
static struct vnet_modinfo vnet_inet6_modinfo = {
- .id = VNET_MOD_INET6,
- .name = "inet6",
- .symmap = vnet_inet6_symmap,
- .i_attach = NULL,
- .i_detach = NULL,
+ .id = VNET_MOD_INET6,
+ .name = "inet6",
+ .symmap = vnet_inet6_symmap,
+ .i_attach = NULL,
+ .i_detach = NULL,
};
MALLOC_DEFINE(M_INET6, "inet", "INET6 domain instance");
@@ -177,25 +177,25 @@
int i;
#ifdef VIMAGE
- struct vnet_inet6 *vnet_inet6;
+ struct vnet_inet6 *vnet_inet6;
- if (curvnetb == &vnetb_0) {
- vnet_mod_register(&vnet_inet6_modinfo);
- vnet_inet6 = &vnet_inet6_0;
- } else {
- vnet_inet6 = malloc(sizeof(struct vnet_inet6),
- M_INET6, M_NOWAIT | M_ZERO);
- if (vnet_inet6 == NULL)
- panic("couldn't allocate memory for vnet_inet6");
- }
- curvnetb->mod_data[vnet_inet6_modinfo.id] = vnet_inet6;
- vnet_inet6->parent_vnetb = curvnetb;
+ if (curvnetb == &vnetb_0) {
+ vnet_mod_register(&vnet_inet6_modinfo);
+ vnet_inet6 = &vnet_inet6_0;
+ } else {
+ vnet_inet6 = malloc(sizeof(struct vnet_inet6),
+ M_INET6, M_NOWAIT | M_ZERO);
+ if (vnet_inet6 == NULL)
+ panic("couldn't allocate memory for vnet_inet6");
+ }
+ curvnetb->mod_data[vnet_inet6_modinfo.id] = vnet_inet6;
+ vnet_inet6->parent_vnetb = curvnetb;
/*
* Skip global initialization stuff
* for non-default instances.
*/
- if (curvnetb != &vnetb_0)
+ if (curvnetb != &vnetb_0)
return;
#endif
@@ -267,7 +267,7 @@
ip6_input(m)
struct mbuf *m;
{
- INIT_VNET_NET(curvnetb);
+ INIT_VNET_NET(curvnetb);
struct ip6_hdr *ip6;
int off = sizeof(struct ip6_hdr), nest;
u_int32_t plen;
==== //depot/projects/vimage/src/sys/netinet6/ip6_output.c#3 (text+ko) ====
@@ -2524,7 +2524,7 @@
struct ip6_moptions **im6op;
struct mbuf *m;
{
- INIT_VNET_NET(curvnetb);
+ INIT_VNET_NET(curvnetb);
int error = 0;
u_int loop, ifindex;
struct ipv6_mreq *mreq;
@@ -2964,7 +2964,7 @@
u_char *buf;
struct ip6_pktopts *opt;
{
- INIT_VNET_NET(curvnetb);
+ INIT_VNET_NET(curvnetb);
int minmtupolicy, preftemp;
if (!sticky && !cmsg) {
==== //depot/projects/vimage/src/sys/netinet6/vinet6.h#3 (text+ko) ====
@@ -43,7 +43,7 @@
#ifdef VIMAGE
struct vnet_inet6 {
- struct vnet_base *parent_vnetb;
+ struct vnet_base *parent_vnetb;
};
#endif
==== //depot/projects/vimage/src/sys/sys/sockio.h#3 (text+ko) ====
@@ -108,9 +108,9 @@
#define SIOCGPRIVATE_0 _IOWR('i', 80, struct ifreq) /* device private 0 */
#define SIOCGPRIVATE_1 _IOWR('i', 81, struct ifreq) /* device private 1 */
-#define SIOCSPVIMAGE _IOW('i', 101, struct vi_req) /* set proc vimage */
-#define SIOCGPVIMAGE _IOWR('i', 102, struct vi_req) /* get proc vimage */
-#define SIOCSIFVIMAGE _IOWR('i', 103, struct vi_req) /* set ifc vi/net */
+#define SIOCSPVIMAGE _IOW('i', 101, struct vi_req) /* set proc vimage */
+#define SIOCGPVIMAGE _IOWR('i', 102, struct vi_req) /* get proc vimage */
+#define SIOCSIFVIMAGE _IOWR('i', 103, struct vi_req) /* set ifc vi/net */
#define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific
parameters */
==== //depot/projects/vimage/src/sys/sys/vimage.h#9 (text+ko) ====
@@ -67,7 +67,7 @@
#define VNET_MOD_RTABLE 30
#define VNET_MOD_LOIF 31
#define VNET_MOD_DYNAMIC_START 32
-#define VNET_MOD_MAX 64
+#define VNET_MOD_MAX 64
/* Needed for ugly sysctl virtualization macros */
#define V_MOD_vnet_net VNET_MOD_NET
@@ -76,12 +76,12 @@
#define V_MOD_vnet_inet6 VNET_MOD_INET6
struct vnet_base {
- LIST_ENTRY(vnet_base) vnetb_le;
+ LIST_ENTRY(vnet_base) vnetb_le;
- void *mod_data[VNET_MOD_MAX];
+ void *mod_data[VNET_MOD_MAX];
- int ifccnt;
- int sockcnt;
+ int ifccnt;
+ int sockcnt;
int vnet_id; /* index to vnetb_tbl */
@@ -131,7 +131,7 @@
struct vnet_base *saved_vnetb = curvnetb; \
const char *saved_vnet_lpush = curthread->td_vnet_lpush; \
curvnetb = arg; \
- curthread->td_vnet_lpush = __FUNCTION__ ;
+ curthread->td_vnet_lpush = __FUNCTION__;
#define CURVNETB_SET_VERBOSE(arg) \
CURVNETB_SET_QUIET(arg) \
@@ -199,7 +199,7 @@
struct vimage *vi_alloc(char *, int, int, int);
void vi_cpu_acct(void *);
int vi_td_ioctl(u_long, struct vi_req *, struct thread *);
-int vi_if_move(struct vi_req *, struct ifnet *, struct vimage *);
+int vi_if_move(struct vi_req *, struct ifnet *, struct vimage *);
int vi_child_of(struct vimage *, struct vimage *);
int vi_symlookup(struct kld_sym_lookup *, char *);
struct vimage *vnetb2vimage(struct vnet_base *);
@@ -230,7 +230,7 @@
struct vimage {
LIST_ENTRY(vimage) vi_le;
- struct vimage *vi_parent; /* ptr to parent vimage */
+ struct vimage *vi_parent; /* ptr to parent vimage */
u_int vi_id; /* ID num */
char vi_name[MAXHOSTNAMELEN]; /* assigned by parent */
@@ -246,8 +246,8 @@
#if 0
int cp_time[CPUSTATES]; /* from kern/clock.c */
- struct loadavg averunnable; /* from kern/kern_synch.c */
- int nrun;
+ struct loadavg averunnable; /* from kern/kern_synch.c */
+ int nrun;
u_int proc_count; /* current number of processes */
u_int proc_limit; /* max. number of processes */
@@ -281,8 +281,8 @@
LIST_ENTRY(vcpu) vcpu_le;
#if 0
- u_int cp_time_avg[CPUSTATES];
- u_int cp_time_avg1[CPUSTATES];
+ u_int cp_time_avg[CPUSTATES];
+ u_int cp_time_avg1[CPUSTATES];
u_int cpu_min; /* Guaranteed CPU share */
u_int cpu_max; /* Maximum average CPU usage */
@@ -297,46 +297,46 @@
#endif /* VIMAGE */
struct vi_req {
- int req_action; /* What to do with this reqest? */
- u_int vi_cpu_min; /* Guaranteed CPU share */
- u_int vi_cpu_max; /* Maximum average CPU usage */
- u_int vi_cpu_weight; /* Prop. share scheduling priority */
- int vi_intr_limit; /* Limit on CPU usage in intr ctx */
- int vi_maxsockets;
- int vi_tsc_hashs;
- int vi_tsc_buckl;
- u_short vi_id; /* IDnum - but do we need it at all? */
- u_short vi_proc_limit; /* max. number of processes */
- u_short vi_proc_count; /* current number of processes */
- u_short vi_child_limit; /* max. number of child vnets */
- u_short vi_child_count; /* current number of child vnets */
- int vi_if_count; /* current number network interfaces */
- int vi_sock_count;
- char vi_name[MAXHOSTNAMELEN];
- char vi_parent_name[MAXHOSTNAMELEN];
- char vi_chroot[MAXPATHLEN];
- int cp_time_avg[CPUSTATES];
- struct loadavg averunnable;
+ int req_action; /* What to do with this reqest? */
+ u_int vi_cpu_min; /* Guaranteed CPU share */
+ u_int vi_cpu_max; /* Maximum average CPU usage */
+ u_int vi_cpu_weight; /* Prop. share scheduling priority */
+ int vi_intr_limit; /* Limit on CPU usage in intr ctx */
+ int vi_maxsockets;
+ int vi_tsc_hashs;
+ int vi_tsc_buckl;
+ u_short vi_id; /* IDnum - but do we need it at all? */
+ u_short vi_proc_limit; /* max. number of processes */
+ u_short vi_proc_count; /* current number of processes */
+ u_short vi_child_limit; /* max. number of child vnets */
+ u_short vi_child_count; /* current number of child vnets */
+ int vi_if_count; /* current number network interfaces */
+ int vi_sock_count;
+ char vi_name[MAXHOSTNAMELEN];
+ char vi_parent_name[MAXHOSTNAMELEN];
+ char vi_chroot[MAXPATHLEN];
+ int cp_time_avg[CPUSTATES];
+ struct loadavg averunnable;
};
-#define VI_CREATE 0x00000001
-#define VI_DESTROY 0x00000002
-#define VI_MODIFY 0x00000004
-#define VI_SWITCHTO 0x00000008
-#define VI_IFACE 0x00000010
+#define VI_CREATE 0x00000001
+#define VI_DESTROY 0x00000002
+#define VI_MODIFY 0x00000004
+#define VI_SWITCHTO 0x00000008
+#define VI_IFACE 0x00000010
-#define VI_GET 0x00000100
-#define VI_GETNEXT 0x00000200
+#define VI_GET 0x00000100
+#define VI_GETNEXT 0x00000200
-#define VI_SET_CPU_MIN 0x00001000
-#define VI_SET_CPU_MAX 0x00002000
-#define VI_SET_CPU_WEIGHT 0x00004000
-#define VI_SET_INTR_LIMIT 0x00008000
-#define VI_SET_PROC_LIMIT 0x00010000
-#define VI_SET_CHILD_LIMIT 0x00020000
-#define VI_SET_SOCK_LIMIT 0x00040000
-#define VI_SET_NAME 0x00100000
-#define VI_SET_CHROOT 0x00200000
+#define VI_SET_CPU_MIN 0x00001000
+#define VI_SET_CPU_MAX 0x00002000
+#define VI_SET_CPU_WEIGHT 0x00004000
+#define VI_SET_INTR_LIMIT 0x00008000
+#define VI_SET_PROC_LIMIT 0x00010000
+#define VI_SET_CHILD_LIMIT 0x00020000
+#define VI_SET_SOCK_LIMIT 0x00040000
+#define VI_SET_NAME 0x00100000
+#define VI_SET_CHROOT 0x00200000
#endif /* _NET_VIMAGE_H_ */
More information about the p4-projects
mailing list