Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2017-07-13,master
>---------------------------------------------------------------
commit 5417ff74495af020f4f543a3f4c8847013ccf4de
Author: Simon Wunderlich <sw(a)simonwunderlich.de>
Date: Thu Mar 17 15:17:36 2011 +0000
doc: attachments/vde2-2.3.1_colour.patch
>---------------------------------------------------------------
5417ff74495af020f4f543a3f4c8847013ccf4de
...-2.2.3_colour.patch => vde2-2.3.1_colour.patch} | 80 +++++++++++-----------
1 file changed, 41 insertions(+), 39 deletions(-)
diff --git a/attachments/vde2-2.2.3_colour.patch b/attachments/vde2-2.3.1_colour.patch
similarity index 63%
copy from attachments/vde2-2.2.3_colour.patch
copy to attachments/vde2-2.3.1_colour.patch
index 49e2c466..9aee63e0 100644
--- a/attachments/vde2-2.2.3_colour.patch
+++ b/attachments/vde2-2.3.1_colour.patch
@@ -1,16 +1,15 @@
-diff --git a/src/vde_switch/port.c b/src/vde_switch/port.c
-index 00a60e6..5135db0 100644
---- a/src/vde_switch/port.c
-+++ b/src/vde_switch/port.c
+diff -urp vde2-2.3.1-orig/src/vde_switch/port.c vde2-2.3.1/src/vde_switch/port.c
+--- vde2-2.3.1-orig/src/vde_switch/port.c 2010-07-25 19:48:01.000000000 +0200
++++ vde2-2.3.1/src/vde_switch/port.c 2011-03-17 11:54:46.000000000 +0100
@@ -91,6 +91,7 @@ struct port {
int fd_data;
struct endpoint *ep;
int flag;
-+ int colour;
++ int colour;
/* sender is already inside ms, but it needs one more memaccess */
int (*sender)(int fd, int fd_ctl, void *packet, int len, void *data, int port);
struct mod_support *ms;
-@@ -148,6 +149,7 @@ static int alloc_port(unsigned int portno)
+@@ -148,6 +149,7 @@ static int alloc_port(unsigned int portn
EVENTOUT(DBGPORTNEW,i);
portv[i]=port;
@@ -18,7 +17,7 @@ index 00a60e6..5135db0 100644
port->fd_data=-1;
port->ep=NULL;
port->user=port->group=port->curuser=-1;
-@@ -552,7 +554,7 @@ void handle_in_packet(int port, struct packet *packet, int len)
+@@ -552,7 +554,7 @@ void handle_in_packet(int port, struct
if (pflag & HUB_TAG) { /* this is a HUB */
register int i;
for(i = 1; i < numports; i++)
@@ -27,7 +26,7 @@ index 00a60e6..5135db0 100644
SEND_PACKET_PORT(portv[i],i,packet,len);
} else { /* This is a switch, not a HUB! */
if (packet->header.proto[0] == 0x81 && packet->header.proto[1] == 0x00) {
-@@ -595,17 +597,17 @@ void handle_in_packet(int port, struct packet *packet, int len)
+@@ -595,17 +597,17 @@ void handle_in_packet(int port, struct
if (tagged) {
register int i;
ba_FORALL(vlant[vlan].bctag,numports,
@@ -49,37 +48,37 @@ index 00a60e6..5135db0 100644
}
}
else {
-@@ -614,15 +616,21 @@ void handle_in_packet(int port, struct packet *packet, int len)
- if (tarport==port)
+@@ -615,17 +617,23 @@ void handle_in_packet(int port, struct
return; /*do not loop!*/
if (tagged) {
-- if (portv[tarport]->vlanuntag==vlan) /* TAG->UNTAG */
-- SEND_PACKET_PORT(portv[tarport],tarport,TAG2UNTAG(packet,len),len);
-- else /* TAG->TAG */
+ if (portv[tarport]->vlanuntag==vlan) { /* TAG->UNTAG */
+- packet = TAG2UNTAG(packet,len);
- SEND_PACKET_PORT(portv[tarport],tarport,packet,len);
-+ if (portv[tarport]->vlanuntag==vlan) { /* TAG->UNTAG */
-+ if (!(pflag & COLOURFUL_TAG) || portv[tarport]->colour != portv[port]->colour)
-+ SEND_PACKET_PORT(portv[tarport],tarport,TAG2UNTAG(packet,len),len);
-+ } else { /* TAG->TAG */
-+ if (!(pflag & COLOURFUL_TAG) || portv[tarport]->colour != portv[port]->colour)
++ if (!(pflag & COLOURFUL_TAG) || portv[tarport]->colour != portv[port]->colour) {
++ packet = TAG2UNTAG(packet,len);
+ SEND_PACKET_PORT(portv[tarport],tarport,packet,len);
-+ }
++ }
+ } else { /* TAG->TAG */
+- SEND_PACKET_PORT(portv[tarport],tarport,packet,len);
++ if (!(pflag & COLOURFUL_TAG) || portv[tarport]->colour != portv[port]->colour)
++ SEND_PACKET_PORT(portv[tarport],tarport,packet,len);
+ }
} else {
-- if (portv[tarport]->vlanuntag==vlan) /* UNTAG->UNTAG */
+ if (portv[tarport]->vlanuntag==vlan) { /* UNTAG->UNTAG */
- SEND_PACKET_PORT(portv[tarport],tarport,packet,len);
-- else /* UNTAG->TAG */
-- SEND_PACKET_PORT(portv[tarport],tarport,UNTAG2TAG(packet,vlan,len),len);
-+ if (portv[tarport]->vlanuntag==vlan) { /* UNTAG->UNTAG */
-+ if (!(pflag & COLOURFUL_TAG) || portv[tarport]->colour != portv[port]->colour)
++ if (!(pflag & COLOURFUL_TAG) || portv[tarport]->colour != portv[port]->colour)
+ SEND_PACKET_PORT(portv[tarport],tarport,packet,len);
-+ } else { /* UNTAG->TAG */
-+ if (!(pflag & COLOURFUL_TAG) || portv[tarport]->colour != portv[port]->colour)
-+ SEND_PACKET_PORT(portv[tarport],tarport,UNTAG2TAG(packet,vlan,len),len);
-+ }
+ } else { /* UNTAG->TAG */
+- packet = UNTAG2TAG(packet,vlan,len);
+- SEND_PACKET_PORT(portv[tarport],tarport,packet,len);
++ if (!(pflag & COLOURFUL_TAG) || portv[tarport]->colour != portv[port]->colour) {
++ packet = UNTAG2TAG(packet,vlan,len);
++ SEND_PACKET_PORT(portv[tarport],tarport,packet,len);
++ }
+ }
}
} /* if(BROADCAST) */
- } /* if(HUB) */
-@@ -635,6 +643,7 @@ static int showinfo(FILE *fd)
+@@ -639,6 +647,7 @@ static int showinfo(FILE *fd)
{
printoutc(fd,"Numports=%d",numports);
printoutc(fd,"HUB=%s",(pflag & HUB_TAG)?"true":"false");
@@ -87,7 +86,7 @@ index 00a60e6..5135db0 100644
#ifdef PORTCOUNTERS
printoutc(fd,"counters=true");
#else
-@@ -796,6 +805,18 @@ static int epclose(char *arg)
+@@ -814,6 +823,19 @@ static int epclose(char *arg)
return close_ep(port,id);
}
@@ -103,10 +102,11 @@ index 00a60e6..5135db0 100644
+ portv[port]->colour= colour;
+ return 0;
+}
++
static char *port_getuser(uid_t uid)
{
static char buf[6];
-@@ -846,6 +867,7 @@ static int print_port(FILE *fd,int i,int inclinactive)
+@@ -864,6 +886,7 @@ static int print_port(FILE *fd,int i,int
printoutc(fd," IN: pkts %10lld bytes %20lld",portv[i]->pktsin,portv[i]->bytesin);
printoutc(fd," OUT: pkts %10lld bytes %20lld",portv[i]->pktsout,portv[i]->bytesout);
#endif
@@ -114,7 +114,7 @@ index 00a60e6..5135db0 100644
for (ep=portv[i]->ep; ep != NULL; ep=ep->next)
printoutc(fd," -- endpoint ID %04d module %-12s: %s",ep->fd_ctl,
portv[i]->ms->modname,(ep->descr)?ep->descr:"no endpoint description");
-@@ -930,6 +952,15 @@ static int portsethub(int val)
+@@ -948,6 +971,15 @@ static int portsethub(int val)
return 0;
}
@@ -130,14 +130,15 @@ index 00a60e6..5135db0 100644
static int portsetvlan(char *arg)
{
int port,vlan;
-@@ -1184,12 +1215,14 @@ static struct comlist cl[]={
+@@ -1202,6 +1234,7 @@ static struct comlist cl[]={
{"port/setnumports","N","set the number of ports",portsetnumports,INTARG},
/*{"port/setmacaddr","MAC","set the switch MAC address",setmacaddr,STRARG},*/
{"port/sethub","0/1","1=HUB 0=switch",portsethub,INTARG},
+ {"port/setcolourful","0/1","1=colourful 0=no colour",portsetcolourful,INTARG},
{"port/setvlan","N VLAN","set port VLAN (untagged)",portsetvlan,STRARG},
+ {"port/createauto","","create a port with an automatically allocated id (inactive|notallocatable)",portcreateauto,NOARG|WITHFILE},
{"port/create","N","create the port N (inactive|notallocatable)",portcreate,INTARG},
- {"port/remove","N","remove the port N",portremove,INTARG},
+@@ -1209,6 +1242,7 @@ static struct comlist cl[]={
{"port/allocatable","N 0/1","Is the port allocatable as unnamed? 1=Y 0=N",portallocatable,STRARG},
{"port/setuser","N user","access control: set user",portsetuser,STRARG},
{"port/setgroup","N user","access control: set group",portsetgroup,STRARG},
@@ -145,10 +146,9 @@ index 00a60e6..5135db0 100644
{"port/epclose","N ID","remove the endpoint port N/id ID",epclose,STRARG},
#ifdef PORTCOUNTERS
{"port/resetcounter","[N]","reset the port (N) counters",portresetcounters,STRARG},
-diff --git a/src/vde_switch/port.h b/src/vde_switch/port.h
-index a65ad1d..57eeae1 100644
---- a/src/vde_switch/port.h
-+++ b/src/vde_switch/port.h
+diff -urp vde2-2.3.1-orig/src/vde_switch/port.h vde2-2.3.1/src/vde_switch/port.h
+--- vde2-2.3.1-orig/src/vde_switch/port.h 2010-07-25 19:48:01.000000000 +0200
++++ vde2-2.3.1/src/vde_switch/port.h 2011-03-17 11:54:46.000000000 +0100
@@ -62,6 +62,7 @@ int portflag(int op, int f);
#define P_CLRFLAG 3
@@ -157,3 +157,5 @@ index a65ad1d..57eeae1 100644
void port_init(int numports);
+Only in vde2-2.3.1/src/vde_switch: port.h.orig
+Only in vde2-2.3.1/src/vde_switch: port.o