Skip to content

Commit efd6a0b

Browse files
committed
Import from Ericsson repo
1 parent 129bb3d commit efd6a0b

Some content is hidden

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

111 files changed

+21477
-0
lines changed

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
*.o
2+
*.d
3+
*.so
4+
*.so.*
5+
*.lo
6+
*~
7+
*.pyc
8+
*.la
9+
.libs/
10+
11+
test/xcmtest.c
12+
13+
# Autoconf/Automake leaves an enormous amount of junk
14+
Makefile.in
15+
Makefile
16+
aclocal.m4
17+
autom4te.cache/
18+
compile
19+
config.guess
20+
config.sub
21+
configure
22+
depcomp
23+
*/.deps/*
24+
*/.dirstamp
25+
common/config.h
26+
common/config.h.in
27+
common/stamp-h1
28+
config.log
29+
config.status
30+
libtool
31+
install-sh
32+
ltmain.sh
33+
libxcm/git_version.c
34+
m4/
35+
36+
client
37+
server
38+
xcm
39+
xcmctl
40+
xcmpong
41+
xcmtest

INSTALL

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Introduction
2+
============
3+
4+
This is Extensible Connection-oriented Messaging (XCM) - an
5+
Inter-process Messaging service. See 'include/xcm.h' for a detailed
6+
description.
7+
8+
Build and Component Test Requirements
9+
=====================================
10+
11+
To build this software the system needs to have the following packages
12+
(not including "standard" things like a C compiler):
13+
14+
automake
15+
autoconf (2.63 and later are known to work, some older versions will not)
16+
libtool
17+
python (2.x)
18+
openssl (1.0.x, including the dev package with header files) (if UTLS/TLS
19+
is enabled)
20+
lttng-ust (including the dev and tools package) (if LTTng is enabled)
21+
libevent2 (if the 'xcm' command-line tool is enabled)
22+
doxygen and plantuml (for documentation)
23+
libsctp-dev (in case the SCTP transport is enabled)
24+
25+
26+
To build and run tests:
27+
28+
./autogen.sh
29+
./configure
30+
make
31+
make check
32+
# optional - run tests as root
33+
sudo make check
34+
35+
Build and test process doesn't require root permission, but some test
36+
cases will be skipped for non-root users.
37+
38+
If you don't have OpenSSL installed, and don't need the TLS and UTLS
39+
transports, those can be disabled with:
40+
./configure --disabled-tls
41+
42+
If you for some reason don't want LTTng tracing support, you may
43+
disable LTTng UST with:
44+
./configure --disable-lttng
45+
46+
If you don't need the 'xcm' command-line tool, you can avoid the
47+
libevent dependency by using:
48+
./configure --disable-xcm-tool
49+
50+
The control interface can be disabled by using:
51+
./configure --disable-ctl
52+
53+
Static Library Builds
54+
=====================
55+
56+
XCM depends on constructor functions to register transports into the
57+
core library. If XCM is built statically, libxcm.a needs to be linked
58+
to the application with the --whole-archive linker flag, or else all
59+
transports will be removed.
60+
61+
Documentation
62+
=============
63+
64+
XCM uses Doxygen (primarily in xcm.h) for its user manual and the API
65+
descriptions.
66+
67+
Run
68+
make doxygen
69+
to generate the documentation.
70+
71+
The HTML version of the documentation will be available in doc/html/.
72+
A PDF file with the same contents is in doc/latex/refman.pdf.
73+
74+
For doxygen PDF generation to work, you need to have the latex package
75+
installed.

LICENSE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright 2020 Ericsson AB
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile.am

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
ACLOCAL_AMFLAGS = -I m4
2+
3+
AM_CFLAGS = -std=gnu99 -Wall -Werror -D_POSIX_C_SOURCE=200809L \
4+
-D_BSD_SOURCE -D_DEFAULT_SOURCE
5+
6+
AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/common \
7+
-DSYSCONFDIR='"$(sysconfdir)"'
8+
9+
lib_LTLIBRARIES = libxcm.la
10+
if CTL
11+
lib_LTLIBRARIES += libxcmctl.la
12+
endif
13+
14+
include_HEADERS = include/xcm.h include/xcm_addr.h include/xcm_addr_compat.h \
15+
include/xcm_attr.h include/xcm_attr_types.h
16+
17+
noinst_PROGRAMS = server client
18+
19+
bin_PROGRAMS = xcmpong
20+
if XCM_TOOL
21+
bin_PROGRAMS += xcm
22+
endif
23+
if CTL
24+
bin_PROGRAMS += xcmctl
25+
endif
26+
27+
check_PROGRAMS = xcmtest
28+
29+
# For information on how to update these numbers, see:
30+
# https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html#Libtool-versioning
31+
XCM_VERSION_CURRENT=11
32+
XCM_VERSION_REVISION=0
33+
XCM_VERSION_AGE=$(XCM_VERSION_CURRENT)
34+
35+
XCMCTL_VERSION_CURRENT=1
36+
XCMCTL_VERSION_REVISION=0
37+
XCMCTL_VERSION_AGE=$(XCMCTL_VERSION_CURRENT)
38+
39+
LIBXCM_SOURCES = libxcm/xcm.c libxcm/xcm_addr.c libxcm/xcm_addr_compat.c \
40+
libxcm/xcm_tp_tcp.c libxcm/xcm_tp_ux.c libxcm/xcm_tp.c \
41+
libxcm/common_tp.c libxcm/tcp_attr.c libxcm/log.c common/util.c \
42+
libxcm/xcm_dns_glibc.c
43+
44+
if TLS
45+
LIBXCM_SOURCES += libxcm/xcm_tp_tls.c libxcm/xcm_tp_utls.c libxcm/log_tls.c
46+
endif
47+
48+
if SCTP
49+
LIBXCM_SOURCES += libxcm/xcm_tp_sctp.c
50+
endif
51+
52+
if CTL
53+
LIBXCM_SOURCES += libxcm/ctl.c common/common_ctl.c
54+
endif
55+
56+
libxcm_la_SOURCES = $(LIBXCM_SOURCES)
57+
libxcm_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libxcm/libxcm.vs \
58+
-version-info $(XCM_VERSION_CURRENT):$(XCM_VERSION_REVISION):$(XCM_VERSION_AGE)
59+
libxcm_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/libxcm
60+
61+
if LTTNG
62+
libxcm_la_SOURCES += lttng/xcm_lttng.c
63+
libxcm_la_CPPFLAGS += -DXCM_LTTNG -I$(srcdir)/lttng
64+
endif
65+
66+
if CTL
67+
libxcmctl_la_SOURCES = libxcmctl/xcmc.c common/common_ctl.c common/util.c
68+
libxcmctl_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libxcmctl/libxcmctl.vs \
69+
-version-info $(XCMCTL_VERSION_CURRENT):$(XCMCTL_VERSION_REVISION):$(XCMCTL_VERSION_AGE)
70+
libxcmctl_la_CPPFLAGS = $(AM_CPPFLAGS) -DUT_STD_ASSERT -I$(srcdir)/libxcmctl
71+
endif
72+
73+
xcmpong_SOURCES = tools/xcmpong.c tools/epoll_set.c common/util.c
74+
# You might think of _CFLAGS setting as a no-op, but in fact this
75+
# makes 'xcmmon/util.c' to be built in a separate version for
76+
# 'umpong', which is needed since the other version is built by
77+
# libtool.
78+
xcmpong_CFLAGS = $(AM_CFLAGS)
79+
xcmpong_CPPFLAGS = $(AM_CPPFLAGS) -DUT_STD_ASSERT
80+
xcmpong_LDADD = libxcm.la
81+
xcmpong_LDFLAGS = -lrt
82+
83+
if XCM_TOOL
84+
xcm_SOURCES = tools/xcm.c tools/fdfwd.c tools/evutil.c common/util.c
85+
# You might think of _CFLAGS setting as a no-op, but in fact this
86+
# makes 'xcmmon/util.c' to be built in a separate version for
87+
# 'umpong', which is needed since the other version is built by
88+
# libtool.
89+
xcm_CFLAGS = $(AM_CFLAGS)
90+
xcm_CPPFLAGS = $(AM_CPPFLAGS) -DUT_STD_ASSERT
91+
xcm_LDADD = libxcm.la
92+
xcm_LDFLAGS = -levent
93+
endif
94+
95+
if CTL
96+
xcmctl_SOURCES = tools/xcmctl.c common/util.c
97+
xcmctl_CFLAGS = $(AM_CFLAGS)
98+
xcmctl_CPPFLAGS = $(AM_CPPFLAGS) -DUT_STD_ASSERT
99+
xcmctl_LDADD = libxcmctl.la
100+
endif
101+
102+
server_SOURCES = example/server.c
103+
server_CFLAGS = $(AM_CFLAGS)
104+
server_LDADD = libxcm.la
105+
106+
client_SOURCES = example/client.c
107+
client_CFLAGS = $(AM_CFLAGS)
108+
client_LDADD = libxcm.la
109+
110+
UTEST_SOURCES = test/utest/utest.c test/utest/utestreport.c \
111+
test/utest/utesthumanreport.c
112+
TEST_CPPFLAGS=-I$(srcdir)/test -I$(srcdir)/test/utest
113+
114+
XCMTEST_TESTCASE_SOURCES = test/xcm_testcases.c test/addr_testcases.c
115+
116+
xcmtest_SOURCES = $(XCMTEST_TESTCASE_SOURCES) $(UTEST_SOURCES) \
117+
common/util.c test/testutil.c test/pingpong.c
118+
xcmtest_CPPFLAGS=$(AM_CPPFLAGS) $(TEST_CPPFLAGS) -DUT_STD_ASSERT
119+
xcmtest_LDADD = libxcm.la
120+
if CTL
121+
xcmtest_LDADD += libxcmctl.la
122+
endif
123+
xcmtest_LDFLAGS = -no-install
124+
125+
doxygen: .doxygenerated
126+
127+
.doxygenerated: doc/doxygen.conf include/xcm.h include/xcm_addr.h \
128+
include/xcm_attr.h include/xcm_attr_types.h
129+
doxygen doc/doxygen.conf && touch .doxygenerated
130+
if [ -n "`command -v pdflatex`" ]; then \
131+
make -C doc/latex; \
132+
fi
133+
134+
clean-local:
135+
rm -rf doc/html
136+
rm -rf doc/latex
137+
rm -f common/*.d libxcm/*.d libxcmc/*.d example/*.d tools/*.d
138+
rm -f .doxygenerated
139+
140+
distclean-local:
141+
rm -rf autom4te.cache m4
142+
rm -f Makefile.in aclocal.m4 compile config.guess include/stamp-h1 \
143+
config.sub configure depcomp install-sh ltmain.sh missing \
144+
common/config.h.in
145+
find . -name \*~ -print0 | xargs -0 rm -f
146+
147+
xcmtest-run: xcmtest
148+
if [ "`id -u`" = 0 ]; then \
149+
./xcmtest -c -v -p 8 $(TESTS); \
150+
else \
151+
./xcmtest -c -v $(TESTS); \
152+
fi
153+
154+
if LTTNG
155+
LTTNGWRAP=./test/with_lttng.sh
156+
endif
157+
158+
if VALGRIND
159+
xcmtest-run-valgrind: xcmtest
160+
cmd="$(LTTNGWRAP) valgrind --tool=memcheck --leak-check=full -q --suppressions=./test/lttng.supp --suppressions=./test/glibc.supp --num-callers=20 ./xcmtest -v -c"; \
161+
if [ "`id -u`" = 0 ]; then \
162+
IN_VALGRIND=1 $$cmd -p 8 $(TESTS); \
163+
else \
164+
IN_VALGRIND=1 $$cmd $(TESTS); \
165+
fi
166+
endif
167+
168+
if PYTHON
169+
xcm_PYTHON=python/xcm.py
170+
xcmdir = $(pythondir)
171+
python-test: libxcm.la
172+
LD_LIBRARY_PATH=$(builddir)/.libs ./python/xcmtest.py
173+
endif
174+
175+
verify-versioning:
176+
./test/verify_versioning.py $(srcdir)/include/xcm.h \
177+
$(builddir) 0 $(XCM_VERSION_CURRENT) $(XCM_VERSION_REVISION)
178+
179+
BASIC_TEST_TARGETS=xcmtest-run verify-versioning
180+
181+
if VALGRIND
182+
TEST_TARGETS=xcmtest-run-valgrind $(BASIC_TEST_TARGETS)
183+
else
184+
TEST_TARGETS=$(BASIC_TEST_TARGETS)
185+
endif
186+
187+
if PYTHON
188+
TEST_TARGETS += python-test
189+
endif
190+
191+
check-local: $(TEST_TARGETS)
192+
193+
count: clean
194+
wc -l `git ls-files | grep -E '\.[ch]{1}$$' | grep -v test/utest | grep -v example`

TODO

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
XCM TODO
2+
********
3+
4+
This file will, in whole or part, be obsoleted by the Hansoft backlog,
5+
but we keep it for a bit longer.
6+
7+
Development Work
8+
----------------
9+
o Add libev/libevent/glib-based example programs
10+
o Extend the test suite, in particular
11+
o Mock/stub OpenSSL and libc calls to allow more negative testing
12+
o Increase the maximum allowed size for the UX transport
13+
o Improve autoconf/automake
14+
o Make sure it builds on different version of Linux
15+
o Make sure it detects missing library runtime/dev packages
16+
o Add likely/unlikely macros, and test if they improve performance
17+
o Introduce integration test suite for vRCS (outside crl-xcm likely).
18+
o Make all the RET_ convience macros into GOTO_ variants, and add LTTng
19+
logging to all those error cases.
20+
21+
Potential API Changes
22+
---------------------
23+
o Consider adding API to allow application to ask a connection socket what
24+
is its maximum message size supported.
25+
o Consider if the exception fdset (from select(2) needs to be handled as
26+
well as read/write events (and thus go into the fd_event enum).
27+
o Consider adding a connect() with automatic retry and a timeout
28+
o Consider the possibility to have timeouts for connect(), send() and receive()
29+
o xcm_receive() should return ssize_t.

autogen.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /bin/sh
2+
3+
autoheader && \
4+
libtoolize && \
5+
aclocal && \
6+
automake --add-missing && \
7+
autoconf

0 commit comments

Comments
 (0)