Revision: 572
http://sourceforge.net/p/vde/svn/572
Author: rd235
Date: 2014-02-07 15:06:10 +0000 (Fri, 07 Feb 2014)
Log Message:
-----------
back compatibility with libvdeplug v2
Modified Paths:
--------------
branches/rd235/vde-2/configure.ac
branches/rd235/vde-2/src/lib/libvdeplug/Makefile.am
branches/rd235/vde-2/src/vde_vxlan/vxlan_hash.c
Added Paths:
-----------
branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug2/
branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug2/Makefile.am
branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug2/vdeplug.pc
Modified: branches/rd235/vde-2/configure.ac
===================================================================
--- branches/rd235/vde-2/configure.ac 2014-02-07 11:48:49 UTC (rev 571)
+++ branches/rd235/vde-2/configure.ac 2014-02-07 15:06:10 UTC (rev 572)
@@ -241,6 +241,7 @@
[src/Makefile]
[src/lib/Makefile]
[src/lib/libvdeplug/Makefile]
+ [src/lib/libvdeplug/libvdeplug2/Makefile]
[src/lib/vdesnmp.pc]
[src/lib/vdemgmt.pc]
[src/lib/libvdeplug/vdeplug.pc]
Modified: branches/rd235/vde-2/src/lib/libvdeplug/Makefile.am
===================================================================
--- branches/rd235/vde-2/src/lib/libvdeplug/Makefile.am 2014-02-07 11:48:49 UTC
(rev 571)
+++ branches/rd235/vde-2/src/lib/libvdeplug/Makefile.am 2014-02-07 15:06:10 UTC
(rev 572)
@@ -1,14 +1,14 @@
AM_CPPFLAGS = -I$(top_srcdir)/include \
-DSYSCONFDIR="\"$(sysconfdir)\""
-DLOCALSTATEDIR="\"$(localstatedir)\""
LIBADD = $(top_builddir)/src/common/libvdecommon.la
-SUBDIRS =
+SUBDIRS = libvdeplug2
if ENABLE_PROFILE
AM_CFLAGS = -pg --coverage
AM_LDFLAGS = -pg --coverage
endif
-lib_LTLIBRARIES = libvdeplug.la
+lib_LTLIBRARIES = libvdeplug.la
# read before touching
http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
Added: branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug2/Makefile.am
===================================================================
--- branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug2/Makefile.am
(rev 0)
+++ branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug2/Makefile.am
2014-02-07 15:06:10 UTC (rev 572)
@@ -0,0 +1,29 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include \
+ -DSYSCONFDIR="\"$(sysconfdir)\""
-DLOCALSTATEDIR="\"$(localstatedir)\""
+LIBADD = $(top_builddir)/src/common/libvdecommon.la
+SUBDIRS =
+
+if ENABLE_PROFILE
+ AM_CFLAGS = -pg --coverage
+ AM_LDFLAGS = -pg --coverage
+endif
+
+lib_LTLIBRARIES = libvdeplug.la
+
+# read before touching
http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
+
+libvdeplug_la_SOURCES = \
+ ../libvdeplug.c \
+ ../libvdeplug_ptp.c \
+ ../libvdeplug_vde.c \
+ ../libvdeplug_kvde.c \
+ ../libvdeplug_udp.c \
+ ../libvdeplug_vxhash.c \
+ ../libvdeplug_vxlan.c \
+ ../libvdeplug_vxvde.c
+
+libvdeplug_la_LIBADD = $(LIBADD)
+libvdeplug_la_LDFLAGS = $(AM_LDFLAGS) -version-number 2:2:2 -export-dynamic
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = vdeplug.pc
Added: branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug2/vdeplug.pc
===================================================================
--- branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug2/vdeplug.pc
(rev 0)
+++ branches/rd235/vde-2/src/lib/libvdeplug/libvdeplug2/vdeplug.pc
2014-02-07 15:06:10 UTC (rev 572)
@@ -0,0 +1,11 @@
+prefix=/usr/local
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: vdeplug
+Description: Virtual Distributed Ethernet connection library.
+Version: 2.2.2
+Libs: -L${libdir} -lvdeplug
+Cflags: -I${includedir}
+
Modified: branches/rd235/vde-2/src/vde_vxlan/vxlan_hash.c
===================================================================
--- branches/rd235/vde-2/src/vde_vxlan/vxlan_hash.c 2014-02-07 11:48:49 UTC
(rev 571)
+++ branches/rd235/vde-2/src/vde_vxlan/vxlan_hash.c 2014-02-07 15:06:10 UTC
(rev 572)
@@ -50,7 +50,7 @@
struct hash_entry *next;
struct hash_entry **prev;
time_t last_seen;
- in_addr_t port;
+ in_addr_t ipaddr;
u_int64_t dst;
};
@@ -92,22 +92,22 @@
((*(u_int32_t *) &((MAC)[0])) + ((u_int64_t) ((*(u_int16_t *)
&((MAC)[4]))+ ((u_int64_t) (VLAN) << 16)) << 32))
/* looks in global hash table 'h' for given address, and return associated
- * port */
+ * ipaddr */
int find_in_hash(unsigned char *dst, int vlan, in_addr_t *out)
{
struct hash_entry *e = find_entry(extmac(dst,vlan));
*out = 0;
if(e == NULL) return 0;
- *out = e->port;
+ *out = e->ipaddr;
return 1;
}
-int find_in_hash_update(unsigned char *src, int vlan, in_addr_t port,
in_addr_t *out)
+int find_in_hash_update(unsigned char *src, int vlan, in_addr_t ipaddr,
in_addr_t *out)
{
struct hash_entry *e;
u_int64_t esrc=extmac(src,vlan);
int k = calc_hash(esrc);
- in_addr_t oldport;
+ in_addr_t oldipaddr;
time_t now;
for(e = h[k]; e && e->dst != esrc; e = e->next)
;
@@ -118,34 +118,29 @@
return 0;
}
- DBGOUT(DBGHASHNEW,"%02x:%02x:%02x:%02x:%02x:%02x VLAN %02x:%02x
Port %d",
- EMAC2MAC6(esrc), EMAC2VLAN2(esrc), port);
- EVENTOUT(DBGHASHNEW,esrc);
e->dst = esrc;
if(h[k] != NULL) h[k]->prev = &(e->next);
e->next = h[k];
e->prev = &(h[k]);
- e->port = port;
+ e->ipaddr = ipaddr;
h[k] = e;
}
- oldport=e->port;
+ oldipaddr=e->ipaddr;
now=time(NULL);
- if (oldport!=port) {
+ if (oldipaddr!=ipaddr) {
if ((now - e->last_seen) > min_persistence) {
- e->port=port;
+ e->ipaddr=ipaddr;
e->last_seen = now;
}
} else {
e->last_seen = now;
}
- if (out != NULL) *out = oldport;
+ if (out != NULL) *out = oldipaddr;
return 1;
}
#define delete_hash_entry(OLD) \
({ \
- DBGOUT(DBGHASHDEL,"%02x:%02x:%02x:%02x:%02x:%02x VLAN %02x:%02x Port
%d", EMAC2MAC6(OLD->dst), EMAC2VLAN2(OLD->dst), OLD->port); \
- EVENTOUT(DBGHASHDEL,OLD->dst);\
*((OLD)->prev)=(OLD)->next; \
if((OLD)->next != NULL) (OLD)->next->prev = (OLD)->prev; \
free((OLD)); \
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
vde-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vde-users