Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
af17e19
Set socket TTL to configured session-ttl before accepting connections
Nov 8, 2017
122492f
Send Peer Offer to correct port
Nov 8, 2017
78bba1f
Use RFC8175 IANA assigned port
Nov 8, 2017
75f9623
Set TTL to 255
Nov 8, 2017
5a91c30
Merge branch 'master' into master
pv0 Jun 26, 2018
4e7ae17
Set socket TTL to configured session-ttl before accepting connections
Nov 8, 2017
73ad0e0
Set TTL to 255
Nov 8, 2017
31c9017
Add syntax = "proto2"; to silence a protobuf compiler warning.
airbus-mipn Aug 24, 2018
a16ca8b
Adding fix for "catch by value" compiler warning
airbus-mipn Jan 24, 2020
3748347
Adding gitlab-ci.yml'
Jan 27, 2020
ae98549
updating gitlab-ci.yml
Jan 27, 2020
a453536
updating gitlab-ci.yml
Jan 27, 2020
b7a8deb
updating gitlab-ci.yml
Jan 27, 2020
62eb2d9
Changed to use ll_dlep_debian_stable_build image
Jan 27, 2020
394d5e4
Updating gitlab-ci.yml
Jan 27, 2020
c050709
Updating gitlab-ci.yml
Jan 27, 2020
9bb7471
Updating gitlab-ci.yml
Jan 27, 2020
55958fd
Updating gitlab-ci.yml
Jan 27, 2020
a3e1cb4
Updating gitlab-ci.yml
Jan 27, 2020
334fc72
Updating gitlab-ci.yml
Jan 27, 2020
c369a0a
Updating gitlab-ci.yml
Jan 28, 2020
f6776c0
Updating .gitlab-ci.yml
Jan 31, 2020
ca15db7
Updating .gitlab-ci.yml
Jan 31, 2020
115c95d
Updating .gitlab-ci.yml
Jan 31, 2020
68ad69d
Updating .gitlab-ci.yml
Jan 31, 2020
376ef40
Updating .gitlab-ci.yml
Jan 31, 2020
3e2b942
Updating ci config
Feb 3, 2020
7c40bc6
Updating ci file
Feb 3, 2020
c22df1d
Updating ci file
Feb 3, 2020
aac5a2e
Updating ci file
Feb 3, 2020
f07cfbe
Updating ci file
Feb 4, 2020
8dae5dd
Updating gitlab ci/cd to publish sources to nexus
Apr 30, 2020
7992576
Making test and doc generation optional
Apr 30, 2020
9d1f23f
Adding cmake cmd line flags to make to control if docementation and t…
airbus-mipn May 1, 2020
4cd5def
Build and publish
Aug 18, 2020
236b597
Corrected spelling on filter
Aug 18, 2020
442da60
Updating gitlab ci
Aug 18, 2020
1d4e5b9
Fixing typo
Aug 19, 2020
86d7d4f
Correcting typo
Aug 19, 2020
bb2058e
Updated to use correct build image
Aug 19, 2020
96c48ea
Use correct image tag
Aug 19, 2020
849b312
Send peer offers back using the same port, not 854
airbus-mipn Apr 26, 2021
0234097
Merge branch 'master' of gitlab.mipn:netsim/development/third_party/L…
airbus-mipn Apr 26, 2021
a740025
Merge branch 'master' of https://github.com/pv0/LL-DLEP
airbus-mipn Apr 26, 2021
faf1490
Merge branch 'master' of https://github.com/airbus-mipn/LL-DLEP.git
airbus-mipn Apr 26, 2021
6c7af4c
Fix bad merge
airbus-mipn Apr 26, 2021
deee415
Merge branch 'HEAD' of https://github.com/airbus-mipn/LL-DLEP.git
airbus-mipn Apr 26, 2021
9c566a2
Silence warning
airbus-mipn Oct 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
image: dkr-reg1.mipn:5000/ll_dlep_build:master

stages:
- build
- test
- deploy

build:
stage: build
script:
- cd build
- mkdir release
- cmake -DCMAKE_INSTALL_PREFIX:PATH=./release ..
- make install
artifacts:
name: "${CI_PROJECT_NAME}"
paths:
- "build"

test:
stage: test
script:
- cd build
- make test

deploy_binaries:
stage: deploy
only:
refs:
- master
variables:
- $CI_PROJECT_NAMESPACE == "netsim/third_party"
variables:
ARCHIVE_NAME: "${CI_PROJECT_NAME}_binaries_${CI_COMMIT_REF_NAME}.tar.gz"
script:
- tar zcf ${ARCHIVE_NAME} ./build/release
- curl -vfs -u ${NEXUS_USERNAME}:${NEXUS_PASSWORD} --upload-file "${ARCHIVE_NAME}" "${NEXUS_SIMULATION_THIRD_PARTY_DIR}/${CI_PROJECT_NAME}/${ARCHIVE_NAME}"

deploy_sources:
stage: deploy
dependencies: []
only:
refs:
- master
variables:
- $CI_PROJECT_NAMESPACE == "netsim/third_party"
variables:
ARCHIVE_NAME: "${CI_PROJECT_NAME}_src_${CI_COMMIT_REF_NAME}.tar.gz"
script:
- touch "${ARCHIVE_NAME}"
- tar --exclude-vcs --exclude="${ARCHIVE_NAME}" -zcf "${ARCHIVE_NAME}" .
- curl -vfs -u ${NEXUS_USERNAME}:${NEXUS_PASSWORD} --upload-file "${ARCHIVE_NAME}" "${NEXUS_SIMULATION_THIRD_PARTY_DIR}/${CI_PROJECT_NAME}/${ARCHIVE_NAME}"
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cmake_minimum_required (VERSION 2.8)
project (dlep)

option(BUILD_DOCS "Build Documentation" ON)
option(BUILD_TESTS "Build Tests" ON)

SET(DLEP_VERSION 2.1) # Release version of the software
SET(SOVERSION 2.1) # The library version (e.g. libdlep.so.1.0 would be SOVERSION 1.0)

Expand Down Expand Up @@ -109,8 +112,14 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/package/copyright DESTINATION ${DOCDIR

ENABLE_TESTING()
add_subdirectory(config)
add_subdirectory(doc)
add_subdirectory(tests)

if(BUILD_DOCS)
add_subdirectory(doc)
endif(BUILD_DOCS)

if(BUILD_TESTS)
add_subdirectory(tests)
endif(BUILD_TESTS)

# Linux Packaging
SET(CPACK_PACKAGE_CONTACT "David P. Wiggins <David.Wiggins@ll.mit.edu>")
Expand Down
14 changes: 14 additions & 0 deletions Dlep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,20 @@ Dlep::start_dlep()
session_acceptor =
new boost::asio::ip::tcp::acceptor(io_service_,
boost::asio::ip::tcp::endpoint(session_address, session_port));

// Set the socket's TTL to the session-ttl config parameter
// if it exists.
try
{
unsigned int ttl;
dlep_client.get_config_parameter("session-ttl", &ttl);
session_acceptor->set_option(boost::asio::ip::unicast::hops(ttl));
}
catch (const LLDLEP::DlepClient::BadParameterName &)
{
// Let the default TTL take effect.
}

start_async_accept();
}
else // we're the router
Expand Down
4 changes: 2 additions & 2 deletions DlepMac.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ inline void getDifference(const DlepMacAddrs & A, const DlepMacAddrs & B,
DlepMacAddrs & C)
{
// whats in here
for (const auto a : A)
for (const auto& a : A)
{
bool found = false;

// and not in here
for (const auto b : B)
for (const auto& b : B)
{
if (a == b)
{
Expand Down
6 changes: 2 additions & 4 deletions PeerDiscovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,7 @@ PeerDiscovery::send_peer_offer(boost::asio::ip::udp::endpoint to_endpoint)
pm.add_data_item(di_conn_pt);
}

boost::asio::ip::udp::endpoint send_endpoint(to_endpoint.address(),
udp_port);
msg << "Sending signal to " << send_endpoint;
msg << "Sending signal to " << to_endpoint;
LOG(DLEP_LOG_INFO, msg);

// A freshly built message should be parseable.
Expand All @@ -601,7 +599,7 @@ PeerDiscovery::send_peer_offer(boost::asio::ip::udp::endpoint to_endpoint)
assert(err == "");

peer_offer_socket.async_send_to(
boost::asio::buffer(pm.get_buffer(), pm.get_length()), send_endpoint,
boost::asio::buffer(pm.get_buffer(), pm.get_length()), to_endpoint,
boost::bind(&PeerDiscovery::handle_send_peer_offer, this,
boost::asio::placeholders::error));
}
14 changes: 8 additions & 6 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ file(GLOB DRAFTS_XML RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE
# gather all xml/xsd files
file(GLOB XML_INSTALL_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/protocol/*.x[ms][ld])

foreach ( file ${XML_INSTALL_FILES} )
add_test(wellformedxml_${file} ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_CURRENT_SOURCE_DIR}/${file})
endforeach(file)
if(BUILD_TESTS)
foreach ( file ${XML_INSTALL_FILES} )
add_test(wellformedxml_${file} ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_CURRENT_SOURCE_DIR}/${file})
endforeach(file)

foreach ( file ${DRAFTS_XML} )
add_test(validatedxml_${file} ${LIBXML2_XMLLINT_EXECUTABLE} --noout --xinclude --schema ${CMAKE_CURRENT_SOURCE_DIR}/protocol/protocol-config.xsd ${CMAKE_CURRENT_SOURCE_DIR}/${file})
endforeach(file)
foreach ( file ${DRAFTS_XML} )
add_test(validatedxml_${file} ${LIBXML2_XMLLINT_EXECUTABLE} --noout --xinclude --schema ${CMAKE_CURRENT_SOURCE_DIR}/protocol/protocol-config.xsd ${CMAKE_CURRENT_SOURCE_DIR}/${file})
endforeach(file)
endif(BUILD_TESTS)

install(FILES ${XML_INSTALL_FILES} DESTINATION ${ETCDIR}/dlep)
13 changes: 8 additions & 5 deletions config/modem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ as a modem.
<local-type>modem</local-type>
<discovery-enable>1</discovery-enable>

<!-- change this to reflect your chosen interface -->
<!-- change this to reflect your chosen interface -->
<discovery-iface>eth0</discovery-iface>

<!-- override default privileged port 854 -->
<discovery-ttl>255</discovery-ttl>
<session-ttl>255</session-ttl>
<!-- override default privileged port 854 -->
<discovery-port>4854</discovery-port>

<!-- override default privileged address 224.0.0.117 -->
<!-- override default privileged address 224.0.0.117 -->
<discovery-mcast-address>225.0.0.117</discovery-mcast-address>
<discovery-interval>60</discovery-interval>
<discovery-ttl>255</discovery-ttl>
<session-ttl>255</session-ttl>

<!-- override default privileged port 854 -->
<!-- override default privileged port 854 -->
<session-port>4854</session-port>
<heartbeat-interval>60</heartbeat-interval>
<heartbeat-threshold>2</heartbeat-threshold>
Expand Down
2 changes: 2 additions & 0 deletions destadvert.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
syntax = "proto2";

message DestinationAdvertisement {
required uint32 reportinterval = 1; // report interval in seconds
required uint32 sequencenumber = 2; // sequence number
Expand Down