-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into evpn_vxlan_vxlanmgr
- Loading branch information
Showing
70 changed files
with
5,519 additions
and
3,005 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
path_classifiers: | ||
test: | ||
exclude: tests | ||
extraction: | ||
python: | ||
python_setup: | ||
version: "2" | ||
cpp: | ||
prepare: | ||
packages: | ||
- libxml-simple-perl | ||
- aspell | ||
- aspell-en | ||
- libhiredis-dev | ||
- libnl-3-dev | ||
- libnl-genl-3-dev | ||
- libnl-route-3-dev | ||
- libnl-nf-3-dev | ||
- swig3.0 | ||
- libpython2.7-dev | ||
- libgtest-dev | ||
- dh-exec | ||
- doxygen | ||
- graphviz | ||
after_prepare: | ||
- git clone https://github.com/Azure/sonic-swss-common; pushd sonic-swss-common; ./autogen.sh; fakeroot dpkg-buildpackage -us -uc -b; popd | ||
- dpkg-deb -x libswsscommon_1.0.0_amd64.deb $LGTM_WORKSPACE | ||
- dpkg-deb -x libswsscommon-dev_1.0.0_amd64.deb $LGTM_WORKSPACE | ||
- git clone --recursive https://github.com/Azure/sonic-sairedis; pushd sonic-sairedis; ./autogen.sh; DEB_BUILD_OPTIONS=nocheck SWSS_COMMON_INC="$LGTM_WORKSPACE/usr/include" SWSS_COMMON_LIB="$LGTM_WORKSPACE/usr/lib/x86_64-linux-gnu" fakeroot debian/rules binary-syncd-vs; popd | ||
- dpkg-deb -x libsairedis_1.0.0_amd64.deb $LGTM_WORKSPACE | ||
- dpkg-deb -x libsairedis-dev_1.0.0_amd64.deb $LGTM_WORKSPACE | ||
- dpkg-deb -x libsaimetadata_1.0.0_amd64.deb $LGTM_WORKSPACE | ||
- dpkg-deb -x libsaimetadata-dev_1.0.0_amd64.deb $LGTM_WORKSPACE | ||
- dpkg-deb -x libsaivs_1.0.0_amd64.deb $LGTM_WORKSPACE | ||
- dpkg-deb -x libsaivs-dev_1.0.0_amd64.deb $LGTM_WORKSPACE | ||
configure: | ||
command: | ||
- ./autogen.sh | ||
- ./configure --prefix=/usr --with-extra-inc=$LGTM_WORKSPACE/usr/include --with-extra-lib=$LGTM_WORKSPACE/usr/lib/x86_64-linux-gnu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
INCLUDES = -I $(top_srcdir) | ||
|
||
bin_PROGRAMS = mclagsyncd | ||
|
||
if DEBUG | ||
DBGFLAGS = -ggdb -DDEBUG | ||
else | ||
DBGFLAGS = -g | ||
endif | ||
|
||
mclagsyncd_SOURCES = mclagsyncd.cpp mclaglink.cpp | ||
|
||
mclagsyncd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) | ||
mclagsyncd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) | ||
mclagsyncd_LDADD = -lnl-3 -lnl-route-3 -lswsscommon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
/* Copyright(c) 2016-2019 Nephos. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms and conditions of the GNU General Public License, | ||
* version 2, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program; if not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* The full GNU General Public License is included in this distribution in | ||
* the file called "COPYING". | ||
* | ||
* Maintainer: Jim Jiang from nephos | ||
*/ | ||
|
||
#ifndef _MCLAG_H | ||
#define _MCLAG_H | ||
#define MCLAG_DEFAULT_IP 0x7f000006 | ||
|
||
enum MCLAG_FDB_OP_TYPE { | ||
MCLAG_FDB_OPER_ADD =1, | ||
MCLAG_FDB_OPER_DEL = 2, | ||
}; | ||
|
||
enum MCLAG_FDB_TYPE { | ||
MCLAG_FDB_TYPE_STATIC = 1, | ||
MCLAG_FDB_TYPE_DYNAMIC = 2, | ||
}; | ||
|
||
/* | ||
* default port for mclag connections | ||
*/ | ||
#define MCLAG_DEFAULT_PORT 2626 | ||
|
||
/* | ||
* Largest message that can be sent to or received from the MCLAG. | ||
*/ | ||
#define MCLAG_MAX_MSG_LEN 4096 | ||
#define MCLAG_MAX_SEND_MSG_LEN 4096 | ||
|
||
typedef struct mclag_msg_hdr_t_ { | ||
/* | ||
* Protocol version. | ||
*/ | ||
uint8_t version; | ||
|
||
/* | ||
* Type of message, see below. | ||
*/ | ||
uint8_t msg_type; | ||
|
||
/* | ||
* Length of entire message, including the header. | ||
*/ | ||
uint16_t msg_len; | ||
}mclag_msg_hdr_t; | ||
|
||
#define MCLAG_PROTO_VERSION 1 | ||
#define MCLAG_MSG_HDR_LEN (sizeof (mclag_msg_hdr_t)) | ||
|
||
/*syncd send msg type to iccpd*/ | ||
typedef enum mclag_syncd_msg_type_e_ { | ||
MCLAG_SYNCD_MSG_TYPE_NONE = 0, | ||
MCLAG_SYNCD_MSG_TYPE_FDB_OPERATION = 1 | ||
}mclag_syncd_msg_type_e; | ||
|
||
/*iccpd send msg type to syncd*/ | ||
typedef enum mclag_msg_type_e_ { | ||
MCLAG_MSG_TYPE_NONE = 0, | ||
MCLAG_MSG_TYPE_PORT_ISOLATE = 1, | ||
MCLAG_MSG_TYPE_PORT_MAC_LEARN_MODE = 2, | ||
MCLAG_MSG_TYPE_FLUSH_FDB = 3, | ||
MCLAG_MSG_TYPE_SET_INTF_MAC = 4, | ||
MCLAG_MSG_TYPE_SET_FDB = 5, | ||
MCLAG_MSG_TYPE_FLUSH_FDB_BY_PORT = 6, | ||
MCLAG_MSG_TYPE_GET_FDB_CHANGES = 20 | ||
}mclag_msg_type_e; | ||
|
||
typedef struct mclag_sub_option_hdr_t_ { | ||
uint8_t op_type; | ||
|
||
/* | ||
* Length of option value, not including the header. | ||
*/ | ||
uint16_t op_len; | ||
}mclag_sub_option_hdr_t; | ||
|
||
#define MCLAG_SUB_OPTION_HDR_LEN (sizeof (mclag_sub_option_hdr_t)) | ||
|
||
typedef enum mclag_sub_option_type_e_ { | ||
MCLAG_SUB_OPTION_TYPE_NONE = 0, | ||
MCLAG_SUB_OPTION_TYPE_ISOLATE_SRC = 1, | ||
MCLAG_SUB_OPTION_TYPE_ISOLATE_DST = 2, | ||
MCLAG_SUB_OPTION_TYPE_MAC_LEARN_ENABLE = 3, | ||
MCLAG_SUB_OPTION_TYPE_MAC_LEARN_DISABLE = 4, | ||
MCLAG_SUB_OPTION_TYPE_SET_MAC_SRC = 5, | ||
MCLAG_SUB_OPTION_TYPE_SET_MAC_DST = 6 | ||
} mclag_sub_option_type_e; | ||
|
||
static inline size_t | ||
mclag_msg_len (const mclag_msg_hdr_t *hdr) | ||
{ | ||
return hdr->msg_len; | ||
} | ||
|
||
/* | ||
* mclag_msg_data_len | ||
*/ | ||
static inline size_t | ||
mclag_msg_data_len (const mclag_msg_hdr_t *hdr) | ||
{ | ||
return (mclag_msg_len (hdr) - MCLAG_MSG_HDR_LEN); | ||
} | ||
|
||
/* | ||
* mclag_msg_hdr_ok | ||
* | ||
* Returns TRUE if a message header looks well-formed. | ||
*/ | ||
static inline int | ||
mclag_msg_hdr_ok (const mclag_msg_hdr_t *hdr) | ||
{ | ||
size_t msg_len; | ||
|
||
if (hdr->msg_type == MCLAG_MSG_TYPE_NONE) | ||
return 0; | ||
|
||
msg_len = mclag_msg_len (hdr); | ||
|
||
if (msg_len < MCLAG_MSG_HDR_LEN || msg_len > MCLAG_MAX_MSG_LEN) | ||
return 0; | ||
|
||
return 1; | ||
} | ||
|
||
/* | ||
* mclag_msg_ok | ||
* | ||
* Returns TRUE if a message looks well-formed. | ||
* | ||
* @param len The length in bytes from 'hdr' to the end of the buffer. | ||
*/ | ||
static inline int | ||
mclag_msg_ok (const mclag_msg_hdr_t *hdr, size_t len) | ||
{ | ||
if (len < MCLAG_MSG_HDR_LEN) | ||
return 0; | ||
|
||
if (!mclag_msg_hdr_ok (hdr)) | ||
return 0; | ||
|
||
if (mclag_msg_len (hdr) > len) | ||
return 0; | ||
|
||
return 1; | ||
} | ||
|
||
|
||
#endif |
Oops, something went wrong.