Skip to content

Commit 411ee7e

Browse files
authored
Merge pull request #458 from WebPlatformForEmbedded/development/webpa-ccsp
CCSP package integration with DBUS
2 parents 569c25b + 8c7a314 commit 411ee7e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1268
-174
lines changed

board/raspberrypi/rpi23-linux-5.10.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CONFIG_LOCALVERSION="-v7"
22
# CONFIG_LOCALVERSION_AUTO is not set
3+
CONFIG_SYSVIPC=y
34
CONFIG_KERNEL_LZ4=y
45
CONFIG_DEFAULT_HOSTNAME="wpe"
56
# CONFIG_SWAP is not set

package/Config.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ menu "Debugging, profiling and benchmark"
9696
source "package/bonnie/Config.in"
9797
source "package/cache-calibrator/Config.in"
9898
source "package/ccspcommonlibrary/Config.in"
99+
source "package/ccspcr/Config.in"
99100
source "package/cimplog/Config.in"
100101
source "package/clinfo/Config.in"
101102
source "package/dacapo/Config.in"
@@ -118,6 +119,7 @@ menu "Debugging, profiling and benchmark"
118119
source "package/kyua/Config.in"
119120
source "package/latencytop/Config.in"
120121
source "package/libparodus/Config.in"
122+
source "package/libunpriv/Config.in"
121123
source "package/lmbench/Config.in"
122124
source "package/lsof/Config.in"
123125
source "package/ltp-testsuite/Config.in"
@@ -144,6 +146,9 @@ menu "Debugging, profiling and benchmark"
144146
source "package/racehound/Config.in"
145147
source "package/ramsmp/Config.in"
146148
source "package/ramspeed/Config.in"
149+
source "package/rbus/Config.in"
150+
source "package/rbus-core/Config.in"
151+
source "package/rtmessage/Config.in"
147152
source "package/rt-tests/Config.in"
148153
source "package/spidev_test/Config.in"
149154
source "package/strace/Config.in"
@@ -153,11 +158,13 @@ menu "Debugging, profiling and benchmark"
153158
source "package/sysprof/Config.in"
154159
source "package/tcf-agent/Config.in"
155160
source "package/tinymembench/Config.in"
161+
source "package/telemetry/Config.in"
156162
source "package/trace-cmd/Config.in"
157163
source "package/trinity/Config.in"
158164
source "package/trower-base64/Config.in"
159165
source "package/uclibc-ng-test/Config.in"
160166
source "package/ucresolv/Config.in"
167+
source "package/utopia/Config.in"
161168
source "package/valgrind/Config.in"
162169
source "package/vmtouch/Config.in"
163170
source "package/wdmp-c/Config.in"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From d69f7dc3304bb5dd8803cef63a1a96e7c102e153 Mon Sep 17 00:00:00 2001
2+
From: Jaga <[email protected]>
3+
Date: Mon, 6 Apr 2020 17:29:42 +0000
4+
Subject: [PATCH] DBusLoop-SSL_state-TLS_ST_OK
5+
6+
Reason for change: typedef DBusLoop struct, changed ssl->state
7+
to SSL_state(ssl) for openssl > 1.1 and SSL_get_state(ssl) for openssl >
8+
1.1.1
9+
10+
Source: COMCAST
11+
License: Apache-2.0
12+
Upstream-Status: Pending
13+
Signed-off-by: Jaga <[email protected]>
14+
---
15+
source/ccsp/include/ccsp_message_bus.h | 2 ++
16+
source/util_api/ansc/AnscPlatform/user_openssl.c | 10 +++++++++-
17+
2 files changed, 11 insertions(+), 1 deletion(-)
18+
19+
diff --git a/source/ccsp/include/ccsp_message_bus.h b/source/ccsp/include/ccsp_message_bus.h
20+
index 9fb9aae9..7c315be0 100644
21+
--- a/source/ccsp/include/ccsp_message_bus.h
22+
+++ b/source/ccsp/include/ccsp_message_bus.h
23+
@@ -153,6 +153,8 @@ typedef struct _CCSP_MESSAGE_FILTER
24+
25+
} CCSP_MESSAGE_FILTER;
26+
27+
+typedef struct DBusLoop DBusLoop;
28+
+
29+
typedef struct _CCSP_MESSAGE_BUS_CONNECTION
30+
{
31+
DBusConnection *conn;
32+
diff --git a/source/util_api/ansc/AnscPlatform/user_openssl.c b/source/util_api/ansc/AnscPlatform/user_openssl.c
33+
index 7e5c2c7d..6d1f4f51 100644
34+
--- a/source/util_api/ansc/AnscPlatform/user_openssl.c
35+
+++ b/source/util_api/ansc/AnscPlatform/user_openssl.c
36+
@@ -392,7 +392,15 @@ SSL * openssl_connect (int fd)
37+
38+
SSL_set_connect_state (ssl);
39+
40+
- if (SSL_connect (ssl) <= 0 || ssl->state != SSL_ST_OK)
41+
+ if (SSL_connect (ssl) <= 0 ||
42+
+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
43+
+ SSL_get_state(ssl) != TLS_ST_OK)
44+
+#elif (OPENSSL_VERSION_NUMBER >= 0x10100000L)
45+
+ SSL_state(ssl) != TLS_ST_OK)
46+
+#else
47+
+ ssl->state != SSL_ST_OK)
48+
+#endif
49+
+
50+
{
51+
AnscTraceWarning(("openssl_connect - failed in SSL_set_connect_state \n"));
52+
goto error;

package/ccspcommonlibrary/0001-openssl-usage-based-on-version.patch

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From d1b13416095d4fe513ee739de179913222539993 Mon Sep 17 00:00:00 2001
2+
From: Jaga <[email protected]>
3+
Date: Mon, 6 Apr 2020 18:35:17 +0000
4+
Subject: [PATCH] SSLeay_add_all_algorithms remove in openssl 1.1
5+
6+
Reason for change: Remove deprecated API SSLeay_add_all_algorithms for
7+
openssl 1.1 and above
8+
9+
Source: COMCAST
10+
License: Apache-2.0
11+
Upstream-Status: Pending
12+
Signed-off-by: Jaga <[email protected]>
13+
---
14+
source/util_api/ansc/AnscPlatform/user_openssl.c | 2 ++
15+
1 file changed, 2 insertions(+)
16+
17+
diff --git a/source/util_api/ansc/AnscPlatform/user_openssl.c b/source/util_api/ansc/AnscPlatform/user_openssl.c
18+
index 0d74871f..4cac8483 100644
19+
--- a/source/util_api/ansc/AnscPlatform/user_openssl.c
20+
+++ b/source/util_api/ansc/AnscPlatform/user_openssl.c
21+
@@ -68,7 +68,9 @@ void initialize_openssl_lib()
22+
23+
SSL_library_init ();
24+
SSL_load_error_strings ();
25+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
26+
SSLeay_add_all_algorithms ();
27+
+#endif
28+
SSLeay_add_ssl_algorithms ();
29+
}
30+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/source/debug_api/ansc_debug.c b/source/debug_api/ansc_debug.c
2+
index 7945da13..b6a47d42 100644
3+
--- a/source/debug_api/ansc_debug.c
4+
+++ b/source/debug_api/ansc_debug.c
5+
@@ -534,10 +534,12 @@ void CcspTraceLogAPI(char *fileName, char *pComponentName, int level, const char
6+
char sfn[32];
7+
va_list args;
8+
9+
+#if FEATURE_SUPPORT_RDKLOG
10+
CcspTraceShortenFileName(sfn, 32, fileName);
11+
va_start(args, format);
12+
RDK_LOG1(level, ComponentName, format, args);
13+
va_end(args);
14+
+#endif
15+
}
16+
}
17+
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
config BR2_PACKAGE_CCSPCOMMONLIBRARY
22
bool "CCSP Common Library"
3-
default n
43
select BR2_PACKAGE_DBUS
4+
select BR2_PACKAGE_RBUS
5+
select BR2_PACKAGE_SAFECLIB
6+
default n
57
help
68
Ccsp common library

package/ccspcommonlibrary/ccspcommonlibrary.mk

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
#
55
################################################################################
66

7-
CCSPCOMMONLIBRARY_VERSION = a3117b5c45532a24507557886910cdaa9d0c411c
7+
CCSPCOMMONLIBRARY_VERSION = 6432e257aa30bdf766db16a0db83394801bc4708
88
CCSPCOMMONLIBRARY_SITE_METHOD = git
99
CCSPCOMMONLIBRARY_SITE = https://github.com/rdkcmf/rdkb-CcspCommonLibrary.git
1010
CCSPCOMMONLIBRARY_INSTALL_STAGING = YES
1111
CCSPCOMMONLIBRARY_AUTORECONF = YES
12-
CCSPCOMMONLIBRARY_DEPENDENCIES = dbus
12+
CCSPCOMMONLIBRARY_DEPENDENCIES = dbus safeclib rbus
1313

1414
define CCSPCOMMONLIBRARY_FIXUP_M4_DIR
1515
mkdir $(@D)/m4
@@ -18,42 +18,63 @@ CCSPCOMMONLIBRARY_POST_EXTRACT_HOOKS += CCSPCOMMONLIBRARY_FIXUP_M4_DIR
1818

1919
CCSPCOMMONLIBRARY_CONF_OPTS = \
2020
--prefix=/usr/ \
21-
--includedir=${STAGING_DIR}/usr/include \
22-
--libdir=${STAGING_DIR}/usr/lib \
23-
--bindir=${STAGING_DIR}/usr/bin \
24-
--docdir=${STAGING_DIR}/usr/share/doc \
25-
${CUSTOM_HOST}
21+
--includedir=$(STAGING_DIR)/usr/include \
22+
--libdir=$(STAGING_DIR)/usr/lib \
23+
--bindir=$(STAGING_DIR)/usr/bin \
24+
--docdir=$(STAGING_DIR)/usr/share/doc \
25+
--with-ccsp-platform=bcm \
26+
--with-ccsp-arch=arm \
27+
$(CUSTOM_HOST)
2628

27-
CCSPCOMMONLIBRARY_CONF_ENV += CPPFLAGS="$(TARGET_CXXFLAGS) -I${STAGING_DIR}/usr/include/dbus-1.0 -I${STAGING_DIR}/usr/lib/dbus-1.0/include"
29+
CCSPCOMMONLIBRARY_CPPFLAGS = $(TARGET_CXXFLAGS) -I$(STAGING_DIR)/usr/include/dbus-1.0 -I$(STAGING_DIR)/usr/lib/dbus-1.0/include -I$(STAGING_DIR)/usr/include/libsafec -I$(STAGING_DIR)/usr/include/rtmessage -I$(STAGING_DIR)/usr/include/rbus -D_DEBUG
2830

31+
ifeq ($(BR2_PACKAGE_RPI_FIRMWARE),y)
32+
# -U_COSA_SIM_ -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-strict-aliasing \
33+
-D_ANSC_LINUX -D_ANSC_USER -D_ANSC_LITTLE_ENDIAN_ -D_CCSP_CWMP_TCP_CONNREQ_HANDLER \
34+
-D_DSLH_STUN_ -D_NO_PKI_KB5_SUPPORT -D_BBHM_SSE_FILE_IO -D_ANSC_USE_OPENSSL_ -DENABLE_SA_KEY \
35+
-D_ANSC_AES_USED_ -D_COSA_INTEL_USG_ARM_ -D_COSA_FOR_COMCAST_ -D_NO_EXECINFO_H_ -DFEATURE_SUPPORT_SYSLOG \
36+
-DBUILD_WEB -D_NO_ANSC_ZLIB_ -D_DEBUG -U_ANSC_IPV6_COMPATIBLE_ -D_COSA_BCM_ARM_ -DUSE_NOTIFY_COMPONENT \
37+
-D_PLATFORM_RASPBERRYPI_ -DENABLE_SD_NOTIFY -DCOSA_DML_WIFI_FEATURE_LoadPsmDefaults -UPARODUS_ENABLE \
38+
-DCONFIG_VENDOR_CUSTOMER_COMCAST
39+
CCSPCOMMONLIBRARY_CPPFLAGS += -D_ANSC_LINUX -D_ANSC_USE_OPENSSL_ -D_NO_PKI_KB5_SUPPORT
40+
endif
41+
42+
CCSPCOMMONLIBRARY_CONF_ENV += CPPFLAGS="$(CCSPCOMMONLIBRARY_CPPFLAGS)"
43+
CCSPCOMMONLIBRARY_CONF_ENV += LIBS=`pkg-config --libs dbus-1`
44+
CCSPCOMMONLIBRARY_CONF_ENV += LIBS=`pkg-config --libs libsafec`
45+
46+
define CCSPCOMMONLIBRARY_INSTALL_PACKAGE
47+
cp -ar $(@D)/source/.libs/libccsp_common.so* $(1)/usr/lib
48+
endef
2949

3050
define CCSPCOMMONLIBRARY_INSTALL_STAGING_CMDS
31-
cp -ar $(@D)/.libs/libccsp_common.so* $(STAGING_DIR)/usr/lib
32-
mkdir -p ${STAGING_DIR}/usr/include/ccsp
33-
cp -ar $(@D)/source/debug_api/include/* ${STAGING_DIR}/usr/include/ccsp
34-
cp -ar $(@D)/source/util_api/ansc/include/* ${STAGING_DIR}/usr/include/ccsp
35-
cp -ar $(@D)/source/util_api/asn.1/include/* ${STAGING_DIR}/usr/include/ccsp
36-
cp -ar $(@D)/source/util_api/http/include/* ${STAGING_DIR}/usr/include/ccsp
37-
cp -ar $(@D)/source/util_api/stun/include/* ${STAGING_DIR}/usr/include/ccsp
38-
cp -ar $(@D)/source/util_api/tls/include/* ${STAGING_DIR}/usr/include/ccsp
39-
cp -ar $(@D)/source/util_api/web/include/* ${STAGING_DIR}/usr/include/ccsp
40-
cp -ar $(@D)/source/cosa/include/* ${STAGING_DIR}/usr/include/ccsp
41-
cp -ar $(@D)/source/cosa/package/slap/include/* ${STAGING_DIR}/usr/include/ccsp
42-
cp -ar $(@D)/source/cosa/package/system/include/* ${STAGING_DIR}/usr/include/ccsp
43-
cp -ar $(@D)/source/ccsp/include/* ${STAGING_DIR}/usr/include/ccsp
44-
cp -ar $(@D)/source/ccsp/custom/* ${STAGING_DIR}/usr/include/ccsp
45-
cp -ar $(@D)/source/ccsp/components/include/* ${STAGING_DIR}/usr/include/ccsp
46-
cp -ar $(@D)/source/ccsp/components/common/MessageBusHelper/include/* ${STAGING_DIR}/usr/include/ccsp
47-
cp $(@D)/source/util_api/slap/components/SlapVarConverter/slap_vco_global.h ${STAGING_DIR}/usr/include/ccsp
48-
cp $(@D)/source/ccsp/components/common/PoamIrepFolder/poam_irepfo_exported_api.h ${STAGING_DIR}/usr/include/ccsp
49-
cp $(@D)/source/ccsp/components/common/PoamIrepFolder/poam_irepfo_global.h ${STAGING_DIR}/usr/include/ccsp
50-
cp $(@D)/source/ccsp/components/common/PoamIrepFolder/poam_irepfo_interface.h ${STAGING_DIR}/usr/include/ccsp
51-
cp $(@D)/source/ccsp/components/common/PoamIrepFolder/poam_irepfo_internal_api.h ${STAGING_DIR}/usr/include/ccsp
51+
$(call CCSPCOMMONLIBRARY_INSTALL_PACKAGE,$(STAGING_DIR))
52+
mkdir -p $(STAGING_DIR)/usr/include/ccsp
53+
cp -ar $(@D)/source/debug_api/include/*.h $(STAGING_DIR)/usr/include/ccsp
54+
cp -ar $(@D)/source/util_api/ansc/include/* $(STAGING_DIR)/usr/include/ccsp
55+
cp -ar $(@D)/source/util_api/asn.1/include/* $(STAGING_DIR)/usr/include/ccsp
56+
cp -ar $(@D)/source/util_api/http/include/* $(STAGING_DIR)/usr/include/ccsp
57+
cp -ar $(@D)/source/util_api/stun/include/* $(STAGING_DIR)/usr/include/ccsp
58+
cp -ar $(@D)/source/util_api/tls/include/* $(STAGING_DIR)/usr/include/ccsp
59+
cp -ar $(@D)/source/util_api/web/include/* $(STAGING_DIR)/usr/include/ccsp
60+
cp -ar $(@D)/source/cosa/include/* $(STAGING_DIR)/usr/include/ccsp
61+
cp -ar $(@D)/source/cosa/include/linux/*.h $(STAGING_DIR)/usr/include/ccsp
62+
cp -ar $(@D)/source/cosa/package/slap/include/* $(STAGING_DIR)/usr/include/ccsp
63+
cp -ar $(@D)/source/cosa/package/system/include/* $(STAGING_DIR)/usr/include/ccsp
64+
cp -ar $(@D)/source/ccsp/include/* $(STAGING_DIR)/usr/include/ccsp
65+
cp -ar $(@D)/source/ccsp/custom/* $(STAGING_DIR)/usr/include/ccsp
66+
cp -ar $(@D)/source/ccsp/components/include/* $(STAGING_DIR)/usr/include/ccsp
67+
cp -ar $(@D)/source/ccsp/components/common/MessageBusHelper/include/* $(STAGING_DIR)/usr/include/ccsp
68+
cp $(@D)/source/util_api/slap/components/SlapVarConverter/slap_vco_global.h $(STAGING_DIR)/usr/include/ccsp
69+
cp $(@D)/source/ccsp/components/common/PoamIrepFolder/poam_irepfo_exported_api.h $(STAGING_DIR)/usr/include/ccsp
70+
cp $(@D)/source/ccsp/components/common/PoamIrepFolder/poam_irepfo_global.h $(STAGING_DIR)/usr/include/ccsp
71+
cp $(@D)/source/ccsp/components/common/PoamIrepFolder/poam_irepfo_interface.h $(STAGING_DIR)/usr/include/ccsp
72+
cp $(@D)/source/ccsp/components/common/PoamIrepFolder/poam_irepfo_internal_api.h $(STAGING_DIR)/usr/include/ccsp
5273
endef
5374

5475
define CCSPCOMMONLIBRARY_INSTALL_TARGET_CMDS
55-
cp -ar $(@D)/.libs/libccsp_common.so* $(TARGET_DIR)/usr/lib
56-
mkdir -p ${TARGET_DIR}/usr/share/ccspcommonlibrary
57-
cp $(@D)/config/ccsp_msg.cfg ${TARGET_DIR}/usr/share/ccspcommonlibrary
76+
$(call CCSPCOMMONLIBRARY_INSTALL_PACKAGE,$(TARGET_DIR))
77+
mkdir -p $(TARGET_DIR)/usr/ccsp
78+
cp $(@D)/config/ccsp_msg.cfg $(TARGET_DIR)/usr/ccsp
5879
endef
5980
$(eval $(autotools-package))
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
diff --git a/source/CCSP_CR/ccsp_cr_exportDM.c b/source/CCSP_CR/ccsp_cr_exportDM.c
2+
index 4b41ecb..088ffcd 100644
3+
--- a/source/CCSP_CR/ccsp_cr_exportDM.c
4+
+++ b/source/CCSP_CR/ccsp_cr_exportDM.c
5+
@@ -135,6 +135,7 @@ static void WriteXmlHead(FILE *file)
6+
if(NULL == g_pDbusHandle)
7+
printf("g_pDbusHanle is NULL\n");
8+
/* CID 57006 - Unchecked return value */
9+
+#ifdef RDK_BUILD
10+
ret = CcspBaseIf_getParameterValues(g_pDbusHandle, "com.cisco.spvtg.ccsp.tdm", "/com/cisco/spvtg/ccsp/tdm", pParamNames, 5, &valCount, &ppReturnVal);
11+
if (CCSP_Message_Bus_OK != ret)
12+
{
13+
@@ -154,7 +155,8 @@ static void WriteXmlHead(FILE *file)
14+
fprintf(file, "%s%s%s\n", "<softwareVersion>",ppReturnVal[4]->parameterValue, "</softwareVersion>");
15+
free_parameterValStruct_t(g_pDbusHandle, valCount, ppReturnVal);
16+
}
17+
-
18+
+#endif
19+
+
20+
fprintf(file, "%s", ATTRIBUTE_STR);
21+
}
22+
23+
diff --git a/source/CrSsp/ssp_main.c b/source/CrSsp/ssp_main.c
24+
index 9320169..a1639ff 100644
25+
--- a/source/CrSsp/ssp_main.c
26+
+++ b/source/CrSsp/ssp_main.c
27+
@@ -48,7 +48,9 @@
28+
#endif
29+
30+
#include "ssp_global.h"
31+
+#ifdef RDK_BUILD
32+
#include "syscfg/syscfg.h"
33+
+#endif
34+
#include "cap.h"
35+
#include "telemetry_busmessage_sender.h"
36+
37+
@@ -456,6 +458,7 @@ static void* waitforsyscfgReady(void *arg)
38+
#define MAX_WAIT_TIME 90
39+
int times = 0;
40+
pthread_detach(pthread_self());
41+
+#ifdef RDK_BUILD
42+
while(times++ < MAX_WAIT_TIME) {
43+
if ( 0 != syscfg_init( ) ) {
44+
CCSP_Msg_SleepInMilliSeconds(TIME_INTERVAL);
45+
@@ -465,6 +468,7 @@ static void* waitforsyscfgReady(void *arg)
46+
break;
47+
}
48+
}
49+
+#endif
50+
pthread_exit(NULL);
51+
}
52+
53+
diff --git a/source/Makefile.am b/source/Makefile.am
54+
index 0b60f65..aeb6c09 100644
55+
--- a/source/Makefile.am
56+
+++ b/source/Makefile.am
57+
@@ -44,7 +44,7 @@ CcspCrSsp_SOURCES = \
58+
CCSP_CR/ccsp_cr_profile.c \
59+
CCSP_CR/ccsp_cr_session.c \
60+
CCSP_CR/ccsp_cr_utility.c
61+
-CcspCrSsp_LDFLAGS += -lccsp_common -lsyscfg -ltelemetry_msgsender -lprivilege $(SYSTEMD_LDFLAGS) -lpthread
62+
+CcspCrSsp_LDFLAGS += -lccsp_common -ldbus-1 -ltelemetry_msgsender -lprivilege $(SYSTEMD_LDFLAGS) -lpthread
63+
if RBUS_BUILD_INTEGRATED
64+
CcspCrSsp_SOURCES += CrSsp/ssp_rbus.c
65+
CcspCrSsp_LDFLAGS += -lrbus -lrbus-core -lrtMessage -lxml2

package/ccspcr/Config.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
config BR2_PACKAGE_CCSPCR
2+
bool "CCSP cr module"
3+
select BR2_PACKAGE_TELEMETRY
4+
select BR2_PACKAGE_LIBUNPRIV
5+
default n
6+
help
7+
Ccsp cr module

0 commit comments

Comments
 (0)