Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Ericsson/xcm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.10.0
Choose a base ref
...
head repository: Ericsson/xcm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 4,686 additions and 1,375 deletions.
  1. +30 −19 Makefile.am
  2. +1 −1 README.md
  3. +6 −3 common/slist.c
  4. +11 −6 common/util.c
  5. +2 −0 common/util.h
  6. +5 −0 common/xcm_attr_names.h
  7. +3 −3 configure.ac
  8. +1 −1 devtools/check-release.py
  9. +877 −334 doc/doxygen.conf
  10. +156 −36 include/xcm.h
  11. +1 −3 include/xcm_addr.h
  12. +175 −5 include/xcm_attr.h
  13. +1 −1 include/xcm_attr_map.h
  14. +1 −1 include/xcm_attr_types.h
  15. +1 −1 include/xcm_compat.h
  16. +4 −3 include/xcm_version.h.in
  17. +278 −0 libxcm/core/attr_node.c
  18. +71 −0 libxcm/core/attr_node.h
  19. +346 −0 libxcm/core/attr_path.c
  20. +54 −0 libxcm/core/attr_path.h
  21. +432 −0 libxcm/core/attr_tree.c
  22. +45 −0 libxcm/core/attr_tree.h
  23. +3 −1 libxcm/core/log.h
  24. +74 −0 libxcm/core/log_attr_tree.c
  25. +90 −0 libxcm/core/log_attr_tree.h
  26. +114 −173 libxcm/core/xcm.c
  27. +74 −50 libxcm/ctl/ctl.c
  28. +7 −0 libxcm/libxcm.vs
  29. +0 −65 libxcm/tp/common/log_tp.c
  30. +11 −10 libxcm/tp/common/log_tp.h
  31. +1 −1 libxcm/tp/common/mbuf.h
  32. +104 −108 libxcm/tp/common/xcm_tp.c
  33. +7 −24 libxcm/tp/common/xcm_tp.h
  34. +10 −4 libxcm/tp/dns/xcm_dns_cares.c
  35. +40 −41 libxcm/tp/sctp/xcm_tp_sctp.c
  36. +67 −71 libxcm/tp/tcp/xcm_tp_btcp.c
  37. +4 −6 libxcm/tp/tcp/xcm_tp_tcp.c
  38. +232 −0 libxcm/tp/tls/cert.c
  39. +31 −0 libxcm/tp/tls/cert.h
  40. +2 −2 libxcm/tp/tls/log_tls.h
  41. +269 −161 libxcm/tp/tls/xcm_tp_btls.c
  42. +4 −6 libxcm/tp/tls/xcm_tp_tls.c
  43. +5 −7 libxcm/tp/tls/xcm_tp_utls.c
  44. +3 −0 libxcm/tp/ux/log_ux.h
  45. +83 −24 libxcm/tp/ux/xcm_tp_ux.c
  46. +3 −1 python/xcm.py
  47. +2 −2 python/xtest.py
  48. +4 −0 test/{ → src}/addr_testcases.c
  49. 0 test/{ → src}/attr_map_testcases.c
  50. +143 −0 test/src/attr_path_testcases.c
  51. +178 −0 test/src/attr_tree_testcases.c
  52. 0 test/{ → src}/glibc.supp
  53. 0 test/{ → src}/iowrap.c
  54. 0 test/{ → src}/iowrap.h
  55. 0 test/{ → src}/lttng.supp
  56. 0 test/{ → src}/openssl.supp
  57. 0 test/{ → src}/pingpong.c
  58. 0 test/{ → src}/pingpong.h
  59. 0 test/{ → src}/slist_testcases.c
  60. +41 −24 test/{ → src}/test_xcmrelay.py
  61. +48 −11 test/{ → src}/testutil.c
  62. +2 −0 test/{ → src}/testutil.h
  63. 0 test/{ → src}/tnet.c
  64. 0 test/{ → src}/tnet.h
  65. 0 test/{ → src}/utest/utest.c
  66. 0 test/{ → src}/utest/utest.h
  67. 0 test/{ → src}/utest/utest.sh
  68. 0 test/{ → src}/utest/utesthumanreport.c
  69. 0 test/{ → src}/utest/utesthumanreport.h
  70. 0 test/{ → src}/utest/utestpriv.h
  71. 0 test/{ → src}/utest/utestreport.c
  72. 0 test/{ → src}/utest/utestreport.h
  73. +459 −157 test/{ → src}/xcm_testcases.c
  74. +41 −6 test/{ → tools}/gencert.py
  75. 0 test/{ → tools}/testall.sh
  76. 0 test/{ → tools}/verify_versioning.py
  77. 0 test/{ → tools}/with_lttng.sh
  78. +27 −2 tools/xcmrelay/xrelay.c
  79. +2 −1 tools/xcmrelay/xrelay.h
49 changes: 30 additions & 19 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -44,15 +44,19 @@ XCMCTL_VERSION_AGE=$(XCMCTL_VERSION_CURRENT)
libxcm_la_SOURCES = \
common/slist.c \
common/util.c \
libxcm/core/xpoll.c \
libxcm/core/attr_node.c \
libxcm/core/attr_path.c \
libxcm/core/attr_tree.c \
libxcm/core/log.c \
libxcm/core/log_attr_tree.c \
libxcm/core/timer_mgr.c \
libxcm/core/xcm.c \
libxcm/core/xcm_addr.c \
libxcm/core/xcm_addr_compat.c \
libxcm/core/xcm_attr_map.c \
libxcm/core/xcm_compat.c \
libxcm/core/xcm_version.c \
libxcm/core/xpoll.c \
libxcm/tp/common/active_fd.c \
libxcm/tp/common/common_tp.c \
libxcm/tp/common/dns_attr.c \
@@ -80,6 +84,7 @@ endif

if TLS
libxcm_la_SOURCES += \
libxcm/tp/tls/cert.c \
libxcm/tp/tls/ctx_store.c \
libxcm/tp/tls/item.c \
libxcm/tp/tls/log_tls.c \
@@ -167,25 +172,33 @@ echod_LDADD = libxcm.la
echod_LDFLAGS = @EVENT_LIBS@
endif

UTEST_SOURCES = test/utest/utest.c test/utest/utestreport.c \
test/utest/utesthumanreport.c
TEST_CPPFLAGS=-I$(srcdir)/test -I$(srcdir)/test/utest
UTEST_SOURCES = test/src/utest/utest.c test/src/utest/utestreport.c \
test/src/utest/utesthumanreport.c
TEST_CPPFLAGS=-I$(srcdir)/test -I$(srcdir)/test/src/utest \
-I$(srcdir)/libxcm/core -I$(srcdir)/libxcm/tp/common

XCMTEST_TESTCASE_SOURCES = \
test/addr_testcases.c \
test/attr_map_testcases.c \
test/slist_testcases.c \
test/xcm_testcases.c
test/src/addr_testcases.c \
test/src/attr_map_testcases.c \
test/src/attr_path_testcases.c \
test/src/attr_tree_testcases.c \
test/src/slist_testcases.c \
test/src/xcm_testcases.c

xcmtest_SOURCES = \
$(XCMTEST_TESTCASE_SOURCES) \
$(UTEST_SOURCES) \
libxcm/core/log.c \
libxcm/core/attr_node.c \
libxcm/core/attr_path.c \
libxcm/core/attr_tree.c \
libxcm/core/log_attr_tree.c \
common/slist.c \
common/util.c \
test/iowrap.c \
test/pingpong.c \
test/testutil.c \
test/tnet.c
test/src/iowrap.c \
test/src/pingpong.c \
test/src/testutil.c \
test/src/tnet.c

xcmtest_CPPFLAGS=$(AM_CPPFLAGS) $(TEST_CPPFLAGS) -DUT_STD_ASSERT
xcmtest_LDFLAGS = @RT_LIBS@ @PTHREAD_LIBS@ -ldl -no-install
@@ -207,9 +220,7 @@ clean-local:
rm -rf doc/latex
rm -f common/*.d libxcm/*.d libxcmc/*.d example/*.d tools/*.d
rm -f .doxygenerated
rm -rf test/cert
rm -rf test/ctl
rm -rf test/uxf
rm -rf test/data

distclean-local:
rm -rf autom4te.cache m4
@@ -226,12 +237,12 @@ xcmtest-run: xcmtest
fi

if LTTNG
LTTNGWRAP=./test/with_lttng.sh
LTTNGWRAP=./test/tools/with_lttng.sh
endif

if VALGRIND
xcmtest-run-valgrind: xcmtest
cmd="$(LTTNGWRAP) valgrind --tool=memcheck --leak-check=full -q --suppressions=./test/lttng.supp --suppressions=./test/glibc.supp --num-callers=20 --error-exitcode=1 ./xcmtest -v -c"; \
cmd="$(LTTNGWRAP) valgrind --tool=memcheck --leak-check=full -q --suppressions=./test/src/lttng.supp --suppressions=./test/src/glibc.supp --num-callers=20 --error-exitcode=1 ./xcmtest -v -c"; \
if [ "`id -u`" = 0 ]; then \
$$cmd -p 8 $(TESTS); \
else \
@@ -244,13 +255,13 @@ xcm_PYTHON=python/xcm.py
xcmdir = $(pythondir)
python-test: libxcm.la
python3 -m flake8 $(xcm_PYTHON) \
python/test_xcm.py test/test_xcmrelay.py
python/test_xcm.py test/src/test_xcmrelay.py
LD_LIBRARY_PATH=$(builddir)/.libs \
$(PYTEST) -vv $(PYTESTOPTS) -s $(PYTESTS)
endif

verify-versioning:
./test/verify_versioning.py $(srcdir)/include/xcm.h \
./test/tools/verify_versioning.py $(srcdir)/include/xcm.h \
$(srcdir)/README.md $(builddir) \
@XCM_ABI_MAJOR_VERSION@ @XCM_ABI_MINOR_VERSION@ \
@XCM_MAJOR_VERSION@ @XCM_MINOR_VERSION@ \
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ installed, `make doxygen-pdf` will produce a PDF version of the
document.

An online copy of this API version's documentation can be found here:
https://ericsson.github.io/xcm/api/0.25/
https://ericsson.github.io/xcm/api/0.26/

## Building

9 changes: 6 additions & 3 deletions common/slist.c
Original file line number Diff line number Diff line change
@@ -43,15 +43,18 @@ static void append(struct slist *slist, const char *str, size_t str_len)

slist->elems = ut_realloc(slist->elems, sizeof(char *) * new_len);

slist->elems[slist->len] = ut_calloc(str_len + 1);
memcpy(slist->elems[slist->len], str, str_len);
if (str != NULL) {
slist->elems[slist->len] = ut_calloc(str_len + 1);
memcpy(slist->elems[slist->len], str, str_len);
} else
slist->elems[slist->len] = NULL;

slist->len = new_len;
}

void slist_append(struct slist *slist, const char *str)
{
append(slist, str, strlen(str));
append(slist, str, str != NULL ? strlen(str) : 0);
}

const char *slist_get(const struct slist *slist, size_t index)
17 changes: 11 additions & 6 deletions common/util.c
Original file line number Diff line number Diff line change
@@ -164,9 +164,6 @@ void ut_vaprintf(char *buf, size_t capacity, const char *format, va_list ap)

int rc = vsnprintf(buf+len, left, format, ap);
ut_assert(rc >= 0);

if (rc >= left) /* NUL-terminate on truncation */
buf[left - 1] = '\0';
}

void ut_aprintf(char *buf, size_t capacity, const char *format, ...)
@@ -177,16 +174,24 @@ void ut_aprintf(char *buf, size_t capacity, const char *format, ...)
va_end(ap);
}

char *ut_asprintf(const char *fmt, ...)
char *ut_vasprintf(const char *fmt, va_list ap)
{
va_list ap;
va_start(ap, fmt);
char *str;

int rc = vasprintf(&str, fmt, ap);
if (rc < 0)
ut_fatal();

return str;
}

char *ut_asprintf(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);

char *str = ut_vasprintf(fmt, ap);

va_end(ap);

return str;
2 changes: 2 additions & 0 deletions common/util.h
Original file line number Diff line number Diff line change
@@ -48,6 +48,8 @@ void ut_vaprintf(char *buf, size_t capacity, const char *format, va_list ap)
__attribute__ ((format (printf, 3, 0)));
void ut_aprintf(char *buf, size_t capacity, const char *format, ...)
__attribute__ ((format (printf, 3, 4)));
char *ut_vasprintf(const char *fmt, va_list ap)
__attribute__ ((format (printf, 1, 0)));
char *ut_asprintf(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));

5 changes: 5 additions & 0 deletions common/xcm_attr_names.h
Original file line number Diff line number Diff line change
@@ -70,6 +70,11 @@
#define XCM_ATTR_TLS_VERIFY_PEER_NAME "tls.verify_peer_name"
#define XCM_ATTR_TLS_PEER_NAMES "tls.peer_names"
#define XCM_ATTR_TLS_PEER_SUBJECT_KEY_ID "tls.peer_subject_key_id"
#define XCM_ATTR_TLS_PEER_CERT_SUBJECT_CN "tls.peer.cert.subject.cn"
#define XCM_ATTR_TLS_PEER_CERT_SAN_DNS "tls.peer.cert.san.dns"
#define XCM_ATTR_TLS_PEER_CERT_SAN_EMAILS "tls.peer.cert.san.emails"
#define XCM_ATTR_TLS_PEER_CERT_SAN_DIRS "tls.peer.cert.san.dirs"
#define XCM_ATTR_TLS_PEER_CERT_SAN_DIR_CN "cn"

/* IPv6-level attributes */

6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
-*- Autoconf -*-

m4_define([xcm_major_version], [1])
m4_define([xcm_minor_version], [10])
m4_define([xcm_patch_version], [0])
m4_define([xcm_minor_version], [11])
m4_define([xcm_patch_version], [1])
m4_define([xcm_version],[xcm_major_version.xcm_minor_version.xcm_patch_version])

# XCM never had a non-backward-compatible API/ABI change for any
# release, even before version 1.0.0.
m4_define([xcm_abi_major_version], [m4_eval(xcm_major_version - 1)])
# step xcm_minor_version if this is increased
m4_define([xcm_abi_minor_version], 25)
m4_define([xcm_abi_minor_version], 26)
m4_define([xcm_abi_version],[xcm_abi_major_version.xcm_abi_minor_version])

AC_INIT(xcm, [xcm_version], [mattias.ronnblom@ericsson.com])
2 changes: 1 addition & 1 deletion devtools/check-release.py
Original file line number Diff line number Diff line change
@@ -242,7 +242,7 @@ def check_meta(repo, release_commit):
print(" Previous release: %s (API %s)" % (prev_impl_version,
prev_api_version))
print("Releases:")
for version in get_release_versions(repo):
for version in sorted(get_release_versions(repo)):
print(" %s" % version)

validate_against_prev(api_version, impl_version,
Loading