Skip to content

Commit

Permalink
Convert meta to saimetadata library (sonic-net#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored Oct 25, 2016
1 parent 23df60b commit f081975
Show file tree
Hide file tree
Showing 28 changed files with 229 additions and 414 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SUBDIRS = lib vslib syncd
SUBDIRS = meta lib vslib syncd player
48 changes: 46 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,56 @@ AM_COND_IF([SAITHRIFT], [
AC_CHECK_LIB([thrift], [main], [], [AC_MSG_ERROR(libthrift is required for rpcserver)])
])

CFLAGS_COMMON="-std=c++11 -Wall -fPIC -Wno-write-strings"
CFLAGS_COMMON=""
CFLAGS_COMMON+=" -ansi"
CFLAGS_COMMON+=" -fPIC"
CFLAGS_COMMON+=" -std=c++11"
CFLAGS_COMMON+=" -Wall"
CFLAGS_COMMON+=" -Wcast-align"
CFLAGS_COMMON+=" -Wcast-qual"
CFLAGS_COMMON+=" -Wconversion"
CFLAGS_COMMON+=" -Wdisabled-optimization"
CFLAGS_COMMON+=" -Werror"
CFLAGS_COMMON+=" -Wextra"
CFLAGS_COMMON+=" -Wextra"
CFLAGS_COMMON+=" -Wfloat-equal"
CFLAGS_COMMON+=" -Wformat=2"
CFLAGS_COMMON+=" -Wformat-nonliteral"
CFLAGS_COMMON+=" -Wformat-security"
CFLAGS_COMMON+=" -Wformat-y2k"
CFLAGS_COMMON+=" -Wimport"
CFLAGS_COMMON+=" -Winit-self"
CFLAGS_COMMON+=" -Winline"
CFLAGS_COMMON+=" -Winvalid-pch"
CFLAGS_COMMON+=" -Wlong-long"
CFLAGS_COMMON+=" -Wmissing-field-initializers"
CFLAGS_COMMON+=" -Wmissing-format-attribute"
CFLAGS_COMMON+=" -Wmissing-include-dirs"
CFLAGS_COMMON+=" -Wmissing-noreturn"
CFLAGS_COMMON+=" -Wno-aggregate-return"
CFLAGS_COMMON+=" -Wno-padded"
CFLAGS_COMMON+=" -Wno-switch-enum"
CFLAGS_COMMON+=" -Wno-unused-parameter"
CFLAGS_COMMON+=" -Wpacked"
CFLAGS_COMMON+=" -Wpointer-arith"
CFLAGS_COMMON+=" -Wredundant-decls"
CFLAGS_COMMON+=" -Wshadow"
CFLAGS_COMMON+=" -Wstack-protector"
CFLAGS_COMMON+=" -Wstrict-aliasing=3"
CFLAGS_COMMON+=" -Wswitch"
CFLAGS_COMMON+=" -Wswitch-default"
CFLAGS_COMMON+=" -Wunreachable-code"
CFLAGS_COMMON+=" -Wunused"
CFLAGS_COMMON+=" -Wvariadic-macros"
CFLAGS_COMMON+=" -Wno-write-strings"

AC_SUBST(CFLAGS_COMMON)

AC_OUTPUT(Makefile
meta/Makefile
lib/Makefile
lib/src/Makefile
vslib/Makefile
vslib/src/Makefile
syncd/Makefile)
syncd/Makefile
player/Makefile)
11 changes: 11 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,14 @@ Architecture: any
Depends: libsaivs (= ${binary:Version})
Section: libdevel
Description: This package contains development files for SAI-VirtualSwitch.

Package: libsaimetadata
Architecture: any
Section: libs
Description: This package contains SAI-Metadata implementation for SONiC project.

Package: libsaimetadata-dev
Architecture: any
Depends: libsaimetadata (= ${binary:Version})
Section: libdevel
Description: This package contains development files for SAI-Metadata.
2 changes: 2 additions & 0 deletions debian/libsaimetadata-dev.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/lib
usr/include
1 change: 1 addition & 0 deletions debian/libsaimetadata-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
meta/*.h usr/include/sai
2 changes: 2 additions & 0 deletions debian/libsaimetadata-dev.links
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /usr/bin/dh-exec
/usr/lib/${DEB_HOST_MULTIARCH}/libsaimetadata.so.0 /usr/lib/${DEB_HOST_MULTIARCH}/libsaimetadata.so
1 change: 1 addition & 0 deletions debian/libsaimetadata.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib
1 change: 1 addition & 0 deletions debian/libsaimetadata.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/*/libsaimetadata.so.*
2 changes: 1 addition & 1 deletion debian/libsaivs-dev.links
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#! /usr/bin/dh-exec
/usr/lib/${DEB_HOST_MULTIARCH}/libsai.so.0 /usr/lib/${DEB_HOST_MULTIARCH}/libsai.so
/usr/lib/${DEB_HOST_MULTIARCH}/libsaivs.so.0 /usr/lib/${DEB_HOST_MULTIARCH}/libsaivs.so
2 changes: 1 addition & 1 deletion debian/libsaivs.install
Original file line number Diff line number Diff line change
@@ -1 +1 @@
usr/lib/*/libsai.so.*
usr/lib/*/libsaivs.so.*
2 changes: 1 addition & 1 deletion debian/syncd.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
usr/bin/*
usr/bin/syncd*
etc/*
4 changes: 2 additions & 2 deletions lib/inc/sai_redis.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern "C" {
}
#include "meta/saiserialize.h"
#include "meta/saiattributelist.h"
#include "redisclient.h"
#include "common/redisclient.h"

#include "swss/dbconnector.h"
#include "swss/producertable.h"
Expand All @@ -23,7 +23,7 @@ extern "C" {
#include "swss/table.h"
#include "swss/select.h"
#include "swss/logger.h"
#include "sai_meta.h"
#include "meta/sai_meta.h"

extern volatile bool g_record;
extern void setRecording(bool record);
Expand Down
73 changes: 2 additions & 71 deletions lib/src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
AM_CPPFLAGS =
AM_CPPFLAGS += -I/usr/include/sai -I/usr/include/swss -I$(top_srcdir)/common
AM_CPPFLAGS += -I../inc -I../../meta
AM_CPPFLAGS += \
-Wcast-align \
-Wcast-qual \
-Wconversion \
-Wdisabled-optimization \
-Werror \
-Wextra \
-Wfloat-equal \
-Wformat=2 \
-Wformat-nonliteral \
-Wformat-security \
-Wformat-y2k \
-Wimport \
-Winit-self \
-Winline \
-Winvalid-pch \
-Wlong-long \
-Wmissing-field-initializers \
-Wmissing-format-attribute \
-Wmissing-include-dirs \
-Wmissing-noreturn \
-Wno-aggregate-return \
-Wno-padded \
-Wno-switch-enum \
-Wno-unused-parameter \
-Wpacked \
-Wpointer-arith \
-Wredundant-decls \
-Wstack-protector \
-Wstrict-aliasing=3 \
-Wswitch \
-Wswitch-default \
-Wunreachable-code \
-Wunused \
-Wvariadic-macros \
-Wwrite-strings
AM_CPPFLAGS = -I/usr/include/sai -I$(top_srcdir) -I$(top_srcdir)/lib/inc

if DEBUG
DBGFLAGS = -ggdb -D_DEBUG_
Expand Down Expand Up @@ -80,38 +42,7 @@ libsairedis_la_SOURCES = \
sai_redis_generic_get.cpp \
sai_redis_notifications.cpp \
sai_redis_record.cpp \
../../common/redisclient.cpp \
../../meta/saiserialize.cpp \
../../meta/saiattributelist.cpp \
../../meta/sai_meta.cpp \
../../meta/sai_meta_sanity.cpp \
../../meta/sai_meta_acl.cpp \
../../meta/sai_meta_buffer.cpp \
../../meta/sai_meta_fdb.cpp \
../../meta/sai_meta_hash.cpp \
../../meta/sai_meta_hostintf.cpp \
../../meta/sai_meta_lag.cpp \
../../meta/sai_meta_mirror.cpp \
../../meta/sai_meta_neighbor.cpp \
../../meta/sai_meta_nexthop.cpp \
../../meta/sai_meta_nexthopgroup.cpp \
../../meta/sai_meta_policer.cpp \
../../meta/sai_meta_port.cpp \
../../meta/sai_meta_qosmaps.cpp \
../../meta/sai_meta_queue.cpp \
../../meta/sai_meta_route.cpp \
../../meta/sai_meta_router.cpp \
../../meta/sai_meta_routerintf.cpp \
../../meta/sai_meta_samplepacket.cpp \
../../meta/sai_meta_scheduler.cpp \
../../meta/sai_meta_schedulergroup.cpp \
../../meta/sai_meta_stp.cpp \
../../meta/sai_meta_switch.cpp \
../../meta/sai_meta_tunnel.cpp \
../../meta/sai_meta_udf.cpp \
../../meta/sai_meta_vlan.cpp \
../../meta/sai_meta_wred.cpp
../../common/redisclient.cpp

libsairedis_la_CPPFLAGS = $(DBGFLAGS) $(AM_CPPFLAGS) $(CFLAGS_COMMON)

libsairedis_la_LIBADD = -lhiredis -lswsscommon
12 changes: 0 additions & 12 deletions lib/src/sai_redis_notifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ void handle_switch_state_change(

if (on_switch_state_change != NULL)
{
SWSS_LOG_ENTER();

on_switch_state_change(switch_oper_status);
}
}
Expand Down Expand Up @@ -56,8 +54,6 @@ void handle_fdb_event(

if (on_fdb_event != NULL)
{
SWSS_LOG_ENTER();

on_fdb_event(count, fdbdata.data());
}

Expand Down Expand Up @@ -102,8 +98,6 @@ void handle_port_state_change(

if (on_port_state_change != NULL)
{
SWSS_LOG_ENTER();

on_port_state_change(count, portdata.data());
}
}
Expand Down Expand Up @@ -136,8 +130,6 @@ void handle_port_event(

if (on_port_event != NULL)
{
SWSS_LOG_ENTER();

on_port_event(count, portdata.data());
}
}
Expand All @@ -153,8 +145,6 @@ void handle_switch_shutdown_request(

if (on_switch_shutdown_request != NULL)
{
SWSS_LOG_ENTER();

on_switch_shutdown_request();
}
}
Expand Down Expand Up @@ -185,8 +175,6 @@ void handle_packet_event(

if (on_packet_event != NULL)
{
SWSS_LOG_ENTER();

on_packet_event(buffer.data(), buffer_size, list.get_attr_count(), list.get_attr_list());
}
}
Expand Down
117 changes: 0 additions & 117 deletions meta/Makefile

This file was deleted.

Loading

0 comments on commit f081975

Please sign in to comment.