diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..b65abb5d --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,2 @@ +@Library('bus-jenkins@ntf-libs') _ +ntfLibsCi(project: 'ntf-core', packageName: 'libntc-dev') diff --git a/debian/bbsdpkgconfig b/debian/bbsdpkgconfig new file mode 100644 index 00000000..cdbc7fe8 --- /dev/null +++ b/debian/bbsdpkgconfig @@ -0,0 +1,275 @@ +{ +"platforms": { + "amd64": [ + { + "ufids": [ + "opt_dbg_64_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev": [ + "ntc", + "ntc-symlinks", + "ntc-release", + "ntc-pkgconfig", + "ntc-headers_direct", + "ntc-bdemeta_direct" + ], + "libnts-dev": [ + "nts", + "nts-symlinks", + "nts-release", + "nts-pkgconfig", + "nts-headers_direct", + "nts-bdemeta_direct" + ] + } + }, + { + "ufids": [ + "opt_dbg_32_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev": [ + "ntc", + "ntc-symlinks", + "ntc-release", + "ntc-pkgconfig" + ], + "libnts-dev": [ + "nts", + "nts-symlinks", + "nts-release", + "nts-pkgconfig" + ] + } + }, + { + "ufids": [ + "dbg_64_pic", + "opt_64_pic", + "dbg_32_pic", + "opt_32_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev": [ + "ntc", + "ntc-symlinks" + ], + "libnts-dev": [ + "nts", + "nts-symlinks" + ] + } + }, + { + "ufids": [ + "dbg_64_safe_pic", + "dbg_32_safe_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev-extra": [ + "ntc", + "ntc-symlinks" + ], + "libnts-dev-extra": [ + "nts", + "nts-symlinks" + ] + } + } + ], + "aix6_powerpc": [ + { + "ufids": [ + "opt_dbg_64_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev": [ + "ntc", + "ntc-symlinks", + "ntc-release", + "ntc-pkgconfig", + "ntc-headers_direct", + "ntc-bdemeta_direct" + ], + "libnts-dev": [ + "nts", + "nts-symlinks", + "nts-release", + "nts-pkgconfig", + "nts-headers_direct", + "nts-bdemeta_direct" + ] + } + }, + { + "ufids": [ + "opt_dbg_32_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev": [ + "ntc", + "ntc-symlinks", + "ntc-release", + "ntc-pkgconfig" + ], + "libnts-dev": [ + "nts", + "nts-symlinks", + "nts-release", + "nts-pkgconfig" + ] + } + }, + { + "ufids": [ + "dbg_64_pic", + "opt_64_pic", + "dbg_32_pic", + "opt_32_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev": [ + "ntc", + "ntc-symlinks" + ], + "libnts-dev": [ + "nts", + "nts-symlinks" + ] + } + }, + { + "ufids": [ + "dbg_64_safe_pic", + "dbg_32_safe_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev-extra": [ + "ntc", + "ntc-symlinks" + ], + "libnts-dev-extra": [ + "nts", + "nts-symlinks" + ] + } + } + ], + "solaris10_sparc": [ + { + "ufids": [ + "opt_dbg_64_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev": [ + "ntc", + "ntc-symlinks", + "ntc-release", + "ntc-pkgconfig", + "ntc-headers_direct", + "ntc-bdemeta_direct" + ], + "libnts-dev": [ + "nts", + "nts-symlinks", + "nts-release", + "nts-pkgconfig", + "nts-headers_direct", + "nts-bdemeta_direct" + ] + } + }, + { + "ufids": [ + "opt_dbg_32_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev": [ + "ntc", + "ntc-symlinks", + "ntc-release", + "ntc-pkgconfig" + ], + "libnts-dev": [ + "nts", + "nts-symlinks", + "nts-release", + "nts-pkgconfig" + ] + } + }, + { + "ufids": [ + "dbg_64_pic", + "opt_64_pic", + "dbg_32_pic", + "opt_32_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev": [ + "ntc", + "ntc-symlinks" + ], + "libnts-dev": [ + "nts", + "nts-symlinks" + ] + } + }, + { + "ufids": [ + "dbg_64_safe_pic", + "dbg_32_safe_pic" + ], + "targets": [ + "all" + ], + "install": { + "libntc-dev-extra": [ + "ntc", + "ntc-symlinks" + ], + "libnts-dev-extra": [ + "nts", + "nts-symlinks" + ] + } + } + ] + } +} + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..33dcf6bc --- /dev/null +++ b/debian/changelog @@ -0,0 +1,302 @@ +ntf-core (2.4.8) unstable; urgency=low + + * 45c0bdc Release 2.4.8 + * 592a6a4 Include cstring for memset in ntsa_ethernetheader.h + * e5663a0 Release 2.4.7 + * e78e7f2 Fix typos in the documentation of ntsa::IpAddress::v4() and v6() + * 4c9e412 Inject the stream socket's data pool into the encryption mechanism for it to use when allocating blob buffers + * 37cac88 ntsa::Ipv4Address::isLoopback() should return true for all 127.0. 0.0/8 and not just 127.0.0.1 + * 32d51a4 Configure the default scheduler with a maximum number of threads equal to the number of cores on the machine + * a35689e Allow setting URI host and port by ntsa::Endpoint + * 666102e Allow ntsa::Host to represent a local name and include and optional transport hint in ntsa::Uri + * 47463b0 Support valgrind-aware builds and fix accidental reads from uninitialized data when hashing ntsa::DomainName + * 02da370 Utilize full I/O uring submission queue capacity and correct ntco_ioring test case 1 + * 72dcabc Describe Ethernet addresses, protocols, and its header + + -- Matt Millett Mon, 9 Sep 2024 22:54:59 -0400 + +ntf-core (2.4.6) git; urgency=low + + * 122f1de Release 2.4.6 to DPKG + * 5e23063 Release 2.4.6 + * 794dbee Avoid sorting timers in ntcs::Chronology::load during potential timer rescheduling + * bf1e585 Fix typedef for ntci::UnLockGuard to properly alias the correct guard class + * 67fd2c8 Resolve compiler ambiguity in bslma::SharedPtrRep-based shared pointer ctor on Solaris + * cc7e467 Remove bdedox from build dependencies (#41) + * b760843 Begin migrating ntci::Interface to ntci::Scheduler, part 1: introduce typedef (#201) + * 54869ed Enable functions and timers deferred/scheduled at the ntci::Interface level to be distributed between all threads + * dfb36b6 GitHub Actions: increase BDE version to 4.8.0.0 & set C++ standard to C++20 + * 490d57d Support MCAST_JOIN_SOURCE_GROUP on Linux + * 82a5978 Apply branch prediction to NTCI_LOG + * 203863a Provide an abstraction of dlopen/dlsym on Unixes + * 2f7fab3 Announce ntci::ListenerSocketManager::processListenerSocketLimit when max connections is violated + + -- Matt Millett Wed, 7 Aug 2024 10:56:11 -0400 + +ntf-core (2.4.5) git; urgency=low + + * bbb23b3 Release 2.4.5 to DPKG + * 3fe9912 Release 2.4.5 + * d719427 Add usage examples for ntca::EncryptionServerOptions + * 9312907 Add usage examples for ntca::EncryptionClientOptions + * 7045778 Fix typo in ntsa::Ipv4Address incorrectly initializing a fixed-length array + * 2f2ffe5 Define secure defaults for ntca::EncryptionAuthentication and ntca::EncryptionMethod + * 03f27b3 Define move and nothrow semantics for ntsa::Ipv6Address + * 0830433 Define move and nothrow semantics for ntsa::Ipv4Address and ntsa::TcpCongestionControl + + -- Matt Millett Tue, 2 Jul 2024 11:32:14 -0400 + +ntf-core (2.4.4) git; urgency=low + + * 3ef0dcd Release 2.4.4 to DPKG + * ba9aa3d Release 2.4.4 + * 8c193bf Add ntccfg_mutex to ntccfg.mem + + -- Matt Millett Sun, 23 Jun 2024 19:03:09 -0400 + +ntf-core (2.4.3) git; urgency=low + + * cb3e629 Release 2.4.3 to DPKG + * c935d1a Release 2.4.3 (#182) + * 82c5f6c ntsu_adapterutil: fixed assigments in assertions to be equality comparisons + * b37883c Adopt ntccfg::Mutex or ntccfg::ConditionMutex instead of bslmt::Mutex + * 0020e47 Use lock guards suitable for configurable mutex implementations + * e1d25f0 Fix incorrect mutex implementation selector when futexes are desired + * a624d18 Enable mutex implementation and inlining strategy to be configurable at build-time + * a9571fa Use weak_ptr when creating a callback for resolver in ntcr/ntcp::StreamSocket + * 043113c Add tsan.supp file to ignore some tsan warnings + * 5d5372d Templatize the type of a mutex parameter specified to ntci::Callback::dispatch + * 53ec376 Define build branch and commit in generated configuration files + * 5adc5ff Add optimizations log + * 2686795 Define build branch and commit in generated configuration files + + -- Matt Millett Sun, 23 Jun 2024 12:53:39 -0400 + +ntf-core (2.4.2) git; urgency=low + + * 2392567 Release 2.4.2 to DPKG + * c2e9609 Release 2.4.2 + * c86b4c8 Allow the encryption certificate version to be omitted from the encoding if using X.509 v1 + * 904bbe5 TSAN: Fix data race in ntcs::Chronology test driver + * efa622b Enhance mocking framework, re-enable mocking framework support in C++03, and enhance participating test drivers + * 81de50a ntsu::SocketUtil::pair: always set `reuseAddress` to false + * a591a82 Depend on system libraries based on system name, not on the compiler name (#166) + + -- Matt Millett Fri, 14 Jun 2024 14:11:24 -0400 + +ntf-core (2.4.1) git; urgency=low + + * e21287c Release 2.4.1 to DPKG + * dc5cfe2 Release 2.4.1 + * 2db3ec0 Remove -fcoroutines-ts flag for clang starting from 16.0 + + -- Matt Millett Mon, 3 Jun 2024 13:34:03 -0400 + +ntf-core (2.4.0) git; urgency=low + + * 2568497 Release 2.4.0 + * 2470996 Fix bug incorrectly narrowing a 64-bit unsigned integer to a size_t when encoding to base-128 + * 7985595 Fix compilation errors in the ntsa_abstract test driver for 32-bit platforms in C++03 + * f1bc1f2 Modernize usage and support for public key cryptography + + -- Matt Millett Mon, 3 Jun 2024 13:19:54 -0400 + +ntf-core (2.3.9) git; urgency=low + + * 65e8c02 Release 2.3.9 to DPKG + * f42b8f0 Release 2.3.9 + * d597d26 Implement ntsu::SocketOptionUtil::get/setTcpCongestionControl on Windows, implement ntsf::System::getBlocking + + -- Matt Millett Thu, 9 May 2024 08:33:09 -0400 + +ntf-core (2.3.8) git; urgency=low + + * 7262361 Release 2.3.8 to DPKG + * 481289b Release 2.3.8 + * a604360 Encapsulate mocking test structures and functions inside a struct instead of a nested namespace + + -- Matt Millett Sat, 4 May 2024 10:29:44 -0400 + +ntf-core (2.3.7) git; urgency=low + + * 1f9ff72 Release 2.3.7 to DPKG + * 4b84e95 Release 2.3.7 (#152) + * d2f23c8 Disable mocking test framework and dependant tests unless built with C++20 + + -- Matt Millett Thu, 2 May 2024 13:04:44 -0400 + +ntf-core (2.3.6) git; urgency=low + + * d4d0674 Release 2.3.6 to DPKG + * 9f50b57 Release 2.3.6 + * 64cf5da Eliminate warnings from unused variables on platforms that do not support congestion control algorithm specification + * 174e5b4 Introduce slimmer wrapper around 'recv' for simple use-cases + * da1cedc Support the explicit configuration of a specific TCP congestion control algorithm + * ab4c796 Publicize buffer algorithms previously in ntsu_buffer to ntsa_buffer + * 33fd060 Implement a mocking testing framework and test the ntcr::StreamSocket shutdown sequence during connection phase using a white-box testing approach + + -- Matt Millett Thu, 2 May 2024 11:32:31 -0400 + +ntf-core (2.3.5) git; urgency=low + + * bdd5057 Release 2.3.5 to DPKG + * e114e3a Release 2.3.5 + * f87558c Fix typo bind to `Kqueue::removeDetached` in `ntco::Kqueue` constructor for C++03 builds + + -- Sergey Mitrofanov Fri, 19 Apr 2024 09:56:06 -0400 + +ntf-core (2.3.4) git; urgency=low + + * 13f50d5 Release 2.3.4 to DPKG + * cecbabb Release 2.3.4 + * 33859c7 Rename ntsi::{Datagram,Stream,Listener}Socket::isBlocking to getBlocking + * a309110 Rename ntsi::{Datagram,Stream,Listener}Socket::isBlocking to getBlocking + * 4faad11 Add overload to `send(const ntsa::ConstBuffer*, bsl::size_t` for NTS sockets + * b9e5d3c Support detection of file descriptor blocking mode on Unixes + * fe4a079 Fix compilation errors specifically compiling for C++03 + + -- Matt Millett Fri, 12 Apr 2024 17:48:53 -0400 + +ntf-core (2.3.3) git; urgency=low + + * 60f95cb Release 2.3.3 to DPKG + * bb7740a Release 2.3.3 + * 2208636 Add explicit constructors for ntsa::Endpoint taking a ntsa::Ipv4Endpoint and ntsa::Ipv6Endpoint + * 9ce2bd2 Add ntsi::{Datagram,Listener,Stream}SocketFactory + * 1ec2138 Defer StreamSocket shutdown execution if the socket is waiting for detachment to be finished + * 7d7ae93 Eliminate warnings when metrics are explicitly disabled + + -- Matt Millett Fri, 22 Mar 2024 16:59:18 -0400 + +ntf-core (2.3.2) git; urgency=low + + * 16034f0 Release 2.3.2 to DPKG + * c5580af Release 2.3.2 + * d87f42a Remove support for the old BDE build system + + -- Matt Millett Fri, 23 Feb 2024 16:05:21 -0500 + +ntf-core (2.3.1) git; urgency=low + + * 5a4f38a Release 2.3.1 to DPKG + * 008d7e2 Release 2.3.1 + * 01b3431 Do not define template member functions for fields of ntcs::Event not defined on Windows + + -- Matt Millett Fri, 16 Feb 2024 21:30:49 -0500 + +ntf-core (2.3.0) git; urgency=low + + * 441405c Release 2.3.0 to DPKG + * 128e639 Release 2.3.0 + * c6095e9 Release 2.2.5 + * 3a62855 Standardize bbsdpkgconfig + * fd40ef5 Ensure upgrade callbacks are correctly reset when shutting down sending while a TLS upgrade is in-progress + * 6a01a3b Update build system to 2.0.1 + * ba2d242 Support explicit open and close of an ntcs::Controller + * e069109 Implement ntsu::SocketOptionUtil::setZeroCopy on Windows + * c94325d Fix ntcs_controller test driver to be able to handle spurious POLLIN events from event ports on Solaris + * d8ba307 Maintainence for AIX and Solaris + * 4d4759c Maintainence for AIX and Solaris + * 9ddbf80 Update ntso.mem with missing components + * 32c5b55 Add internal meta-data + * cbd81d4 Do not exclude network devices that do not have IFF_RUNNING set enumerating network devices + * 07c817e Ensure that reading from error queue does not hang if the socket is in a blocking mode or recvmsg returns 0 + * 5a04483 Consolidate run-time checks determine support for timestamping and zero-copy + * eaef18d Support zero-copy transmission on Linux through reactor-based ntci::DatagramSockets and ntci::StreamSockets + * 835d7e2 Make path to toolchain.cmake configurable + * a5997c6 Hoist scope of struct ::iovec array to be consistent with the scope of struct ::msghdr + * 8526fef Selectively disable -Wmaybe-uninitialized + * 1431943 Log operation of ntco_kqueue using ntci_log instead of bsls_log + * 19af8ae Correct the name of the ntsu_zerocopyutil test driver + * f4ea959 GitHub Actions: stop on first failure and cat ctest log + * f73e830 Correctly reschedule an initially non-recurring timer when a new definite period is specified + * 87a2533 Support zero-copy transmissions in NTS + * a512761 GitHub Actions: cache dependencies and reorganize file locations + * 013191a Fix incorrect polling for events in ntcs_controller tests and port the test driver to all platforms + * 2f5a5a0 Add initial support for GitHub Actions + * 5156042 Merge backwards-incompatible ntci::Proactor::detachSocketAsync with detachSocket + * 9d40528 Fix trivial compiler error initializing control channel implemented with anonymous pipes + * fff52db Implement the control channel on Windows with a Unix domain socket pair, but fall back to TCP if necessary + * b834498 Support sending and receiving file descriptors over Unix domain sockets + * 25c786c Provide a simple, single-threaded abstraction of select, poll, epoll, kqueue, /dev/poll, event ports, and pollset + * 43d8cc0 Create all timer callbacks bound to a strong reference to 'this' with the standard strand semantics and announce rate limit events + * a878579 Overload ntsa::LocalName::generateUnique to return an error and check for failure where called + * 71bcc3a Implement asynchronous socket detachment for reactors and proactors + * 3baad2e Release 2.2.4 + * 2c0db84 Enhance the build configuration scripts to optionally generate CLion configuration files + * 05b08bb Allow toolchain.cmake to properly detect compiler paths already save in the CMake variable cache + * 87f45c5 Do not read LOCATION property from targets during verbose CMake configuration + * ffe209a Release 2.2.3 + * 34974ef Install headers generated at configuration time under nts-headers and ntc-headers, respectively + * 6252205 Release 2.2.2 + * fd0275c Install ntscfg_config.h and ntscfg_config.h as part of the nts and ntc components, respectively + * b453a46 Release 2.2.1 + + -- Matt Millett Fri, 16 Feb 2024 12:15:03 -0500 + +ntf-core (2.2.0) git; urgency=low + + * 4bd7b8c Release 2.2.0 + * a49817f Release 2.2.0 + * af25d8a Fix timestamping tests for network devices that don't support timestamps + * b470fdb Implement all less-than comparator operators in terms of only less-then comparator operators + * e887378 Update build system: support standalone libraries, pkgconfig Libs.private, and do not require debuggers to be found on the PATH + * ed7dd0d Increase ntcs::Event::d_address size to >= _SS_MAXSIZE on all supported Unix platforms, by platform + * 8fcdf31 Set architecture flags in toolchain.cmake for Solaris and AIX compilers + * 2f21e9a Support a default, globally-accessible ntci::Interface + * c6cb817 Increase ntcs::Event::d_address size to >= _SS_MAXSIZE on all supported Unix platforms + * b3a640b Implement an ntci::Proactor using io_uring + * 9a5e12a Do not require gdb/lldb to be found on the path + * a82f30b Lock the mutex inside 'processNotifications()' in ntcr_datagramsocket and ntcr_streamsocket + * 539be03 Fix build system linker flags on Windows and warnings issued when using MSVC v142 + * bc1c548 Support bbs_build as a viable build system + * f5fa644 Standardize output directory determined by configuration script on Windows + * b14dd5f Expose the transport used by a proactor socket + * e67d625 Fix typo specifying link-time code generation options to MSVC + * 1ed320e Fix equality comparison of domain names + * 46efa9f Use bsl::numeric_limits instead of constants from cstdint + * 8ea0cf3 Test resolvers using dns.google.com instead of microsoft.com + + -- Matt Millett Wed, 6 Sep 2023 21:34:36 -0400 + +ntf-core (2.1.0) git; urgency=low + + * a511d00 Release 2.1.0 + * 6d4ad8b Maintenance for Windows: fix ntsu::SocketUtil::isLocal, ntcd::Machine packet timestamp handling, and allow for WSAENETUNREACH connecting to 240.0.0.1 in ntcf_system test driver + * eed8a81 Implement ntsu::SocketOptionUtil::isLocal on Darwin without using SO_DOMAIN + * c74b619 Fix a typo in the Quick Start section of README.md stating ntci::Connect instead of ntci::Connector + * 2956f47 Support TX and RX timestamping on Linux and collect and publish TX and RX system delay as metrics + * 27a8009 Sort ntsa::Ipv4Endpoint IP addresses from "smaller" to "larger" + * 0ff3125 Provide a default resolver and allow resolvers to be configured to disallow resolution from the operating system + * c5f0706 Modify .gitignore to ignore CLion files + * 737e7e4 Use a class E IPv4 address when testing connections to "non-existent" machines and additionally tolerate ENETUNREACH + * ab6f596 Respect the CC and CXX environment variables when configuring the toolchain + * 35dd90c Explicitly specify the source directory when running CMake from the configuration script + + -- Matt Millett Fri, 9 Jun 2023 10:47:43 -0400 + +ntf-core (2.0.0) git; urgency=low + + * efe90a2 Release 2.0.0 + * d24cf19 Explicitly allow more than IOV_MAX buffers to be batched in ntcq_send test driver to match test setup + * 56e102b Fix overload ambiguity creating an ntci::SendCallback with a shared_ptr to a ntci::Strand-deriving class + * e3327dc Remove unused variables in ntcq_send + * 9e9291b Emphasize the user's requirement to explicitly close each timer and socket + * 73a46fa Modernize the ntcf_system usage examples + * 485e2af Remove references to defunct s_ntstst/s_ntctst and a_ntsdbg/a_ntcdbg + * e3ed71d Remove the broken link to the FAQ from README.md + * 612eb32 Fix service name parsing error assertions + * 94a3ae4 Copy buffers from a range of write queue entries to the send buffer in a single system call + * 9c40260 Add NTSU_SOCKETUTIL_DEBUG_RECVMSG + * 58e0586 Remove artificial limit on the number of buffers to supply to sendmsg + * 7feb58c Apply the desire to gain/lose interest in readability/writability before announcing that it is done + * 04a19ba Fix a typo causing a timestamping test in the ntsu_socketutil test driver to fail + * 6c933e2 Parse port numbers using bdlb::NumericParseUtil::parseUint + * 59eff7f Return false from ntsa::IpAddress::parse() for empty string arguments + * c9dee84 Do not set _FORTIFY_SOURCE level in the build system, but include the CFLAGS and CXXFLAGS environment variables + * c84cbbf Remove obsolete *.txt documentation files from the repo + * a86c53b Reject string literals containing port numbers out-of-range when resolving service names + * 3949df7 Support Windows/arm64 (#2) + * 6ed01d8 Initial open source release + + -- Matt Millett Wed, 26 Apr 2023 13:33:56 -0400 diff --git a/debian/cmakedpkgconfig b/debian/cmakedpkgconfig new file mode 100644 index 00000000..315d4001 --- /dev/null +++ b/debian/cmakedpkgconfig @@ -0,0 +1,191 @@ +{ +"platforms": { + "amd64": [ + { + "ufids": [ "opt_exc_mt"], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks", + "ntc-headers", "ntc-meta", + "ntc-release-symlink", "ntc-pkgconfig" ], + "libnts-dev": [ "nts", "nts-symlinks", + "nts-headers", "nts-meta", + "nts-release-symlink", "nts-pkgconfig" ] + } + }, + { + "ufids": [ "opt_exc_mt_64_pic" ], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks", + "ntc-release-symlink", "ntc-pkgconfig", + "ntc-pic-symlink-hack" ], + "libnts-dev": [ "nts", "nts-symlinks", + "nts-release-symlink", "nts-pkgconfig", + "nts-pic-symlink-hack" ] + } + }, + { + "ufids": [ "opt_dbg_exc_mt", "dbg_exc_mt" ], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks" ], + "libnts-dev": [ "nts", "nts-symlinks" ] + } + }, + { + "ufids": [ "opt_dbg_exc_mt_64_pic", "dbg_exc_mt_64_pic" ], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks", + "ntc-pic-symlink-hack" ], + "libnts-dev": [ "nts", "nts-symlinks", + "nts-pic-symlink-hack" ] + } + }, + { + "ufids": [ "opt_exc_mt_pic", "opt_dbg_exc_mt_pic", "dbg_exc_mt_safe" ], + "targets": [ "all" ], + "install": { + "libntc-dev-extra": [ "ntc", "ntc-symlinks" ], + "libnts-dev-extra": [ "nts", "nts-symlinks" ] + } + }, + { + "ufids": [ "dbg_exc_mt_64_safe_pic" ], + "targets": [ "all" ], + "install": { + "libntc-dev-extra": [ "ntc", "ntc-symlinks", + "ntc-pic-symlink-hack" ], + "libnts-dev-extra": [ "nts", "nts-symlinks", + "nts-pic-symlink-hack" ] + } + } + ], + "aix6_powerpc": [ + { + "ufids": [ "opt_exc_mt"], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks", + "ntc-headers", "ntc-meta", + "ntc-release-symlink", "ntc-pkgconfig" ], + "libnts-dev": [ "nts", "nts-symlinks", + "nts-headers", "nts-meta", + "nts-release-symlink", "nts-pkgconfig" ] + } + }, + { + "ufids": [ "opt_exc_mt_64_pic" ], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks", + "ntc-release-symlink", "ntc-pkgconfig", + "ntc-pic-symlink-hack" ], + "libnts-dev": [ "nts", "nts-symlinks", + "nts-release-symlink", "nts-pkgconfig", + "nts-pic-symlink-hack" ] + } + }, + { + "ufids": [ "opt_dbg_exc_mt", "dbg_exc_mt" ], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks" ], + "libnts-dev": [ "nts", "nts-symlinks" ] + } + }, + { + "ufids": [ "opt_dbg_exc_mt_64_pic", "dbg_exc_mt_64_pic" ], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks", + "ntc-pic-symlink-hack" ], + "libnts-dev": [ "nts", "nts-symlinks", + "nts-pic-symlink-hack" ] + } + }, + { + "ufids": [ "opt_exc_mt_pic", "opt_dbg_exc_mt_pic", "dbg_exc_mt_safe" ], + "targets": [ "all" ], + "install": { + "libntc-dev-extra": [ "ntc", "ntc-symlinks" ], + "libnts-dev-extra": [ "nts", "nts-symlinks" ] + } + }, + { + "ufids": [ "dbg_exc_mt_64_safe_pic" ], + "targets": [ "all" ], + "install": { + "libntc-dev-extra": [ "ntc", "ntc-symlinks", + "ntc-pic-symlink-hack" ], + "libnts-dev-extra": [ "nts", "nts-symlinks", + "nts-pic-symlink-hack" ] + } + } + ], + "solaris10_sparc": [ + { + "ufids": [ "opt_exc_mt"], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks", + "ntc-headers", "ntc-meta", + "ntc-release-symlink", "ntc-pkgconfig" ], + "libnts-dev": [ "nts", "nts-symlinks", + "nts-headers", "nts-meta", + "nts-release-symlink", "nts-pkgconfig" ] + } + }, + { + "ufids": [ "opt_exc_mt_64_pic" ], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks", + "ntc-release-symlink", "ntc-pkgconfig", + "ntc-pic-symlink-hack" ], + "libnts-dev": [ "nts", "nts-symlinks", + "nts-release-symlink", "nts-pkgconfig", + "nts-pic-symlink-hack" ] + } + }, + { + "ufids": [ "opt_dbg_exc_mt", "dbg_exc_mt" ], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks" ], + "libnts-dev": [ "nts", "nts-symlinks" ] + } + }, + { + "ufids": [ "opt_dbg_exc_mt_64_pic", "dbg_exc_mt_64_pic" ], + "targets": [ "all" ], + "install": { + "libntc-dev": [ "ntc", "ntc-symlinks", + "ntc-pic-symlink-hack" ], + "libnts-dev": [ "nts", "nts-symlinks", + "nts-pic-symlink-hack" ] + } + }, + { + "ufids": [ "opt_exc_mt_pic", "opt_dbg_exc_mt_pic", "dbg_exc_mt_safe" ], + "targets": [ "all" ], + "install": { + "libntc-dev-extra": [ "ntc", "ntc-symlinks" ], + "libnts-dev-extra": [ "nts", "nts-symlinks" ] + } + }, + { + "ufids": [ "dbg_exc_mt_64_safe_pic" ], + "targets": [ "all" ], + "install": { + "libntc-dev-extra": [ "ntc", "ntc-symlinks", + "ntc-pic-symlink-hack" ], + "libnts-dev-extra": [ "nts", "nts-symlinks", + "nts-pic-symlink-hack" ] + } + } + ] + } +} + diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..9d87c163 --- /dev/null +++ b/debian/control @@ -0,0 +1,34 @@ +Source: ntf-core +Section: unknown +Priority: extra +Maintainer: Matt Millett +Build-Depends: + bde-internal-tools, + dpkg, + libbal-dev-extra, + libbal-dev, + libbdl-dev-extra, + libbdl-dev, + libbsl-dev-extra, + libbsl-dev +Standards-Version: 3.8.4 + +Package: libnts-dev +Depends: libbal-dev, libbdl-dev, libbsl-dev +Architecture: any +Description: Blocking and non-blocking sockets for network programming + +Package: libnts-dev-extra +Depends: libnts-dev, libbal-dev-extra, libbdl-dev-extra, libbsl-dev-extra +Architecture: any +Description: Blocking and non-blocking sockets for network programming (extra build variants) + +Package: libntc-dev +Depends: libnts-dev, libbal-dev, libbdl-dev, libbsl-dev +Architecture: any +Description: Asynchronous sockets, timers, event loops, and thread pools for network programming + +Package: libntc-dev-extra +Depends: libntc-dev, libnts-dev-extra, libbal-dev-extra, libbdl-dev-extra, libbsl-dev-extra +Architecture: any +Description: Asynchronous sockets, timers, event loops, and thread pools for network programming (extra build variants) diff --git a/debian/libntc-dev-extra.lintian-overrides b/debian/libntc-dev-extra.lintian-overrides new file mode 100644 index 00000000..7243d204 --- /dev/null +++ b/debian/libntc-dev-extra.lintian-overrides @@ -0,0 +1 @@ +libntc-dev-extra: blp-bde-metadata-missing diff --git a/debian/libnts-dev-extra.lintian-overrides b/debian/libnts-dev-extra.lintian-overrides new file mode 100644 index 00000000..9ba635ca --- /dev/null +++ b/debian/libnts-dev-extra.lintian-overrides @@ -0,0 +1 @@ +libnts-dev-extra: blp-bde-metadata-missing diff --git a/debian/rules b/debian/rules new file mode 100644 index 00000000..3fe20c21 --- /dev/null +++ b/debian/rules @@ -0,0 +1,20 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +export NTF_CONFIGURE_WITH_MOCKS=0 +export NTF_CONFIGURE_WITH_APPLICATIONS=0 +export NTF_CONFIGURE_WITH_USAGE_EXAMPLES=0 + +export NTF_CONFIGURE_FROM_PACKAGING=1 + +DEBHELPER_PATH=$(DISTRIBUTION_REFROOT)/opt/bb/libexec/bde-internal-tools/share/build +include $(DEBHELPER_PATH)/bbs-debhelper.mk + +debian/bde-build-stamp: debian/lintian-overrides-stamp +debian/lintian-overrides-stamp: + for uor in ntc nts; do \ + mkdir -p debian/lib$${uor}-dev-extra$(PREFIX)/share/lintian/overrides; \ + cp debian/lib$${uor}-dev-extra.lintian-overrides \ + debian/lib$${uor}-dev-extra$(PREFIX)/share/lintian/overrides/lib$${uor}-dev-extra; \ + done + touch $@ diff --git a/extras/.gitignore b/extras/.gitignore new file mode 100644 index 00000000..51ed4d38 --- /dev/null +++ b/extras/.gitignore @@ -0,0 +1,2 @@ +make_target +make_target.cmd diff --git a/extras/ci/jenkins/execute b/extras/ci/jenkins/execute new file mode 100755 index 00000000..c78f8cb0 --- /dev/null +++ b/extras/ci/jenkins/execute @@ -0,0 +1,224 @@ +#!/usr/bin/env bash + +set -o pipefail + +NTF_CONFIGURE_ROOT=$(dirname ${0}) +if [[ -n ${NTF_CONFIGURE_ROOT##/*} ]]; then + NTF_CONFIGURE_ROOT=${PWD}/${NTF_CONFIGURE_ROOT#.} +fi +NTF_CONFIGURE_ROOT=${NTF_CONFIGURE_ROOT%/} + +cd ${NTF_CONFIGURE_ROOT}/../../.. + +NTF_CONFIGURE_REPOSITORY=$(pwd) + +NTF_CONFIGURE_UNAME=$(uname) +if [[ "${NTF_CONFIGURE_UNAME}" == "MINGW32_NT-6.2" ]]; then + NTF_CONFIGURE_UNAME="Windows" +fi + +if [[ -z "${NTF_CONFIGURE_UFID}" ]]; then + NTF_CONFIGURE_UFID="opt_dbg_exc_mt_64" +fi + +if [[ -z "${NTF_CONFIGURE_REFROOT}" ]]; then + if [[ -z "${DISTRIBUTION_REFROOT}" ]]; then + NTF_CONFIGURE_REFROOT="" + else + NTF_CONFIGURE_REFROOT="${DISTRIBUTION_REFROOT}" + fi +fi + +if [[ -z "${NTF_CONFIGURE_PREFIX}" ]]; then + if [[ -z "${PREFIX}" ]]; then + NTF_CONFIGURE_PREFIX="/opt/bb" + else + NTF_CONFIGURE_PREFIX="${PREFIX}" + fi +fi + +if [[ -z "${NTF_CONFIGURE_OUTPUT}" ]]; then + NTF_CONFIGURE_OUTPUT="${NTF_CONFIGURE_REPOSITORY}/build" +fi + +if [[ -z "${NTF_CONFIGURE_DISTRIBUTION}" ]]; then + NTF_CONFIGURE_DISTRIBUTION="unstable" +fi + +NTF_CONFIGURE_VERBOSE=0 + +usage() +{ + echo "usage: execute [--refroot ] [--prefix ] [--output ] [--distribution ] [--debug|release] [--ufid ] [--with- ] [--without- ]" + echo "where: " + echo " --refroot Path to the refroot containing build dependencies [${NTF_CONFIGURE_REFROOT}]" + echo " --prefix Path to the refroot where build artifacts will be installed [${NTF_CONFIGURE_PREFIX}]" + echo " --output Path to the directory where build artifacts will be staged [${NTF_CONFIGURE_OUTPUT}]" + echo " --distribution Name of the distribution [${NTF_CONFIGURE_DISTRIBUTION}]" + echo " --ufid The unified flag identifiers for the build system [${NTF_CONFIGURE_UFID}]" + + echo " --debug Build the default debug UFID" + echo " --release Build the default release UFID" + + echo " --verbose Enable verbose build" + exit 1 +} + +while true ; do + case "$1" in + --help) + usage + ;; + --refroot) + NTF_CONFIGURE_REFROOT=$2 + shift 2 + ;; + --prefix) + NTF_CONFIGURE_PREFIX=$2 + shift 2 + ;; + --output) + NTF_CONFIGURE_OUTPUT=$2 + shift 2 + ;; + --distribution) + NTF_CONFIGURE_DISTRIBUTION=$2 + shift 2 + ;; + --ufid) + NTF_CONFIGURE_UFID=$2 + shift 2 + ;; + --debug) + NTF_CONFIGURE_UFID="dbg_exc_mt_64" + shift + ;; + --release) + NTF_CONFIGURE_UFID="opt_dbg_exc_mt_64" + shift + ;; + --verbose) + NTF_CONFIGURE_VERBOSE=1 + shift + ;; + --*) + echo "Invalid option: ${1}" + usage + ;; + *) + NTF_CONFIGURE_TARGET_LIST=$@ + break + ;; + esac +done + +echo "NTF_CONFIGURE_ROOT: ${NTF_CONFIGURE_ROOT}" +echo "NTF_CONFIGURE_REPOSITORY: ${NTF_CONFIGURE_REPOSITORY}" +echo "NTF_CONFIGURE_REFROOT: ${NTF_CONFIGURE_REFROOT}" +echo "NTF_CONFIGURE_PREFIX: ${NTF_CONFIGURE_PREFIX}" +echo "NTF_CONFIGURE_UFID: ${NTF_CONFIGURE_UFID}" + +ntf_path=${NTF_CONFIGURE_REFROOT}/opt/bb/libexec/bde-tools/bin:${PATH} + +ntf_install_ufid=${NTF_CONFIGURE_UFID} +ntf_install_ufid_canonical="" +ntf_profile="" + +if [[ "${ntf_install_ufid}" == "opt_dbg_exc_mt_64" ]]; then + ntf_install_ufid_canonical="opt_dbg_64" + ntf_profile="BBToolchain64" +elif [[ "${ntf_install_ufid}" == "dbg_exc_mt_64" ]]; then + ntf_install_ufid_canonical="dbg_64" + ntf_profile="BBToolchain64" +elif [[ "${ntf_install_ufid}" == "opt_dbg_exc_mt" ]]; then + ntf_install_ufid_canonical="opt_dbg_32" + ntf_profile="BBToolchain32" +elif [[ "${ntf_install_ufid}" == "dbg_exc_mt" ]]; then + ntf_install_ufid_canonical="dbg_32" + ntf_profile="BBToolchain32" +else + echo "${ntf_install_ufid} is not a recognized UFID" + exit 1 +fi + +ntf_build_dir=${NTF_CONFIGURE_REPOSITORY}/build/${NTF_CONFIGURE_UNAME}/${ntf_install_ufid} +ntf_install_dir=${ntf_build_dir} + +ntf_log_path=${ntf_build_dir}/${NTF_CONFIGURE_UNAME}-${ntf_install_ufid}.log + +echo "ntf_path=${ntf_path}" +echo "ntf_build_dir=${ntf_build_dir}" +echo "ntf_install_dir=${ntf_install_dir}" +echo "ntf_install_ufid=${ntf_install_ufid}" +echo "ntf_install_ufid_canonical=${ntf_install_ufid_canonical}" +echo "ntf_log_path=${ntf_log_path}" + +rm -rf ${ntf_build_dir} + +DISTRIBUTION_REFROOT=${NTF_CONFIGURE_REFROOT} \ +PATH=${ntf_path} \ +bbs_build_env list + +DISTRIBUTION_REFROOT=${NTF_CONFIGURE_REFROOT} \ +PATH=${ntf_path} \ +bbs_build_env --ufid ${ntf_install_ufid_canonical} \ + --profile ${ntf_profile} \ + --build-dir ${ntf_build_dir} \ + --install-dir ${ntf_install_dir} + +eval $(DISTRIBUTION_REFROOT=${NTF_CONFIGURE_REFROOT} PATH=${ntf_path} bbs_build_env --ufid ${ntf_install_ufid_canonical} --profile ${ntf_profile} --build-dir ${ntf_build_dir} --install-dir ${ntf_install_dir}) + +echo "After running bbs_build_env:" +echo "PATH=${PATH}" +echo "DISTRIBUTION_REFROOT=${DISTRIBUTION_REFROOT}" +echo "BBS_ENV_MARKER=${BBS_ENV_MARKER}" +echo "BDE_CMAKE_UPLID=${BDE_CMAKE_UPLID}" +echo "BDE_CMAKE_UFID=${BDE_CMAKE_UFID}" +echo "BDE_CMAKE_BUILD_DIR=${BDE_CMAKE_BUILD_DIR}" +echo "BDE_CMAKE_TOOLCHAIN=${BDE_CMAKE_TOOLCHAIN}" +echo "BDE_CMAKE_INSTALL_DIR=${BDE_CMAKE_INSTALL_DIR}" + +mkdir -p ${ntf_build_dir} +touch ${ntf_log_path} + +DISTRIBUTION_REFROOT=${NTF_CONFIGURE_REFROOT} \ +PATH=${ntf_path} \ +bbs_build configure 2>&1 | tee -a ${ntf_log_path} +if [ ${?} -ne 0 ]; then + echo "Failed to configure" + exit 1 +fi + +DISTRIBUTION_REFROOT=${NTF_CONFIGURE_REFROOT} \ +PATH=${ntf_path} \ +bbs_build build -j 8 2>&1 | tee -a ${ntf_log_path} +if [ ${?} -ne 0 ]; then + echo "Failed to build components" + exit 1 +fi + +DISTRIBUTION_REFROOT=${NTF_CONFIGURE_REFROOT} \ +PATH=${ntf_path} \ +bbs_build build -j 8 --target all.t 2>&1 | tee -a ${ntf_log_path} +if [ ${?} -ne 0 ]; then + echo "Failed to build test drivers" + exit 1 +fi + +DISTRIBUTION_REFROOT=${NTF_CONFIGURE_REFROOT} \ +PATH=${ntf_path} \ +bbs_build build -j 1 --tests run 2>&1 | tee -a ${ntf_log_path} +if [ ${?} -ne 0 ]; then + echo "Failed to execute test drivers" + exit 1 +fi + +DISTRIBUTION_REFROOT=${NTF_CONFIGURE_REFROOT} \ +PATH=${ntf_path} \ +bbs_build install 2>&1 | tee -a ${ntf_log_path} +if [ ${?} -ne 0 ]; then + echo "Failed to install" + return 1 +fi + +echo "OK" diff --git a/extras/make_release b/extras/make_release new file mode 100755 index 00000000..2f597d4b --- /dev/null +++ b/extras/make_release @@ -0,0 +1,209 @@ +#!/usr/bin/env bash + +MAKE_RELEASE_EXE=$(basename $0) +MAKE_RELEASE_DIR=$(dirname $0) +[[ -n ${MAKE_RELEASE_DIR##/*} ]] && MAKE_RELEASE_DIR=$PWD/${MAKE_RELEASE_DIR#.} + +cd ${MAKE_RELEASE_DIR}/.. +MAKE_RELEASE_REPOSITORY=$(pwd) + +MAKE_RELEASE_MODE_MAJOR=1 +MAKE_RELEASE_MODE_MINOR=2 +MAKE_RELEASE_MODE_PATCH=3 + +MAKE_RELEASE_MODE=${MAKE_RELEASE_MODE_PATCH} + +usage() +{ + echo "usage: ${MAKE_RELEASE_EXE} [--major] [--minor] [--patch]" + echo "where: " + echo " --major Perform a major version release" + echo " --minor Perform a minor version release" + echo " --patch Perform a patch version release" + exit 1 +} + +while true ; do + case "$1" in + --help) + usage ;; + --major) + MAKE_RELEASE_MODE=${MAKE_RELEASE_MODE_MAJOR} + shift ;; + --minor) + MAKE_RELEASE_MODE=${MAKE_RELEASE_MODE_MINOR} + shift ;; + --patch) + MAKE_RELEASE_MODE=${MAKE_RELEASE_MODE_PATCH} + shift ;; + --*) + usage ;; + *) + break ;; + esac +done + +MAKE_RELEASE_UNAME=$(uname) +if [[ ${MAKE_RELEASE_UNAME} != "Linux" ]]; then + echo "Must be run on a Linux machine" + exit 0 +fi + +NTSSCM_VERSIONTAG_H=$(cat ${MAKE_RELEASE_REPOSITORY}/groups/nts/ntsscm/ntsscm_versiontag.h) + +NTSSCM_VERSIONTAG_H_REGEX_MAJOR='#define NTS_VERSION_MAJOR ([0-9]+)' +NTSSCM_VERSIONTAG_H_REGEX_MINOR='#define NTS_VERSION_MINOR ([0-9]+)' +NTSSCM_VERSIONTAG_H_REGEX_PATCH='#define NTS_VERSION_PATCH ([0-9]+)' + +[[ "${NTSSCM_VERSIONTAG_H}" =~ ${NTSSCM_VERSIONTAG_H_REGEX_MAJOR} ]] +if [ ${?} -ne 0 ]; then + echo "Failed to find major version" + exit 1 +fi + +NTSSCM_VERSION_MAJOR=${BASH_REMATCH[1]} + +[[ "${NTSSCM_VERSIONTAG_H}" =~ ${NTSSCM_VERSIONTAG_H_REGEX_MINOR} ]] +if [ ${?} -ne 0 ]; then + echo "Failed to find minor version" + exit 1 +fi + +NTSSCM_VERSION_MINOR=${BASH_REMATCH[1]} + +[[ "${NTSSCM_VERSIONTAG_H}" =~ ${NTSSCM_VERSIONTAG_H_REGEX_PATCH} ]] +if [ ${?} -ne 0 ]; then + echo "Failed to find patch version" + exit 1 +fi + +NTSSCM_VERSION_PATCH=${BASH_REMATCH[1]} + +echo "Current ${NTSSCM_VERSION_MAJOR}.${NTSSCM_VERSION_MINOR}.${NTSSCM_VERSION_PATCH}" + +NTSSCM_VERSION_MAJOR_ORIGINAL=${NTSSCM_VERSION_MAJOR} +NTSSCM_VERSION_MINOR_ORIGINAL=${NTSSCM_VERSION_MINOR} +NTSSCM_VERSION_PATCH_ORIGINAL=${NTSSCM_VERSION_PATCH} + +if [ ${MAKE_RELEASE_MODE} -eq ${MAKE_RELEASE_MODE_MAJOR} ]; then + NTSSCM_VERSION_MAJOR=$((NTSSCM_VERSION_MAJOR+1)) + NTSSCM_VERSION_MINOR=0 + NTSSCM_VERSION_PATCH=0 +elif [ ${MAKE_RELEASE_MODE} -eq ${MAKE_RELEASE_MODE_MINOR} ]; then + NTSSCM_VERSION_MINOR=$((NTSSCM_VERSION_MINOR+1)) + NTSSCM_VERSION_PATCH=0 +elif [ ${MAKE_RELEASE_MODE} -eq ${MAKE_RELEASE_MODE_PATCH} ]; then + NTSSCM_VERSION_PATCH=$((NTSSCM_VERSION_PATCH+1)) +else + echo "Unexpected release mode" + exit 1 +fi + +echo "Release ${NTSSCM_VERSION_MAJOR}.${NTSSCM_VERSION_MINOR}.${NTSSCM_VERSION_PATCH}" + +MAKE_RELEASE_BRANCH=$(git branch --show-current) +if [ ${?} -ne 0 ]; then + echo "Failed to get the current branch" + exit 1 +fi + +if [[ -z "${MAKE_RELEASE_BRANCH}" ]]; then + echo "Failed to get the current branch" + exit 1 +fi + +MAKE_RELEASE_REMOTE=$(git remote -v | grep "ntf/ntf-classic (push)" | cut -f 1) +if [[ -z "${MAKE_RELEASE_REMOTE}" ]]; then + echo "Failed to get the remote name for ntf/ntf-classic" + exit 1 +fi + +# MAKE_RELEASE_BRANCH_REQUIRED="releases/${NTSSCM_VERSION_MAJOR}.${NTSSCM_VERSION_MINOR}.x" +# if [[ "${MAKE_RELEASE_BRANCH}" != "${MAKE_RELEASE_BRANCH_REQUIRED}" ]]; then +# echo "Current branch must be ${MAKE_RELEASE_BRANCH_REQUIRED}" +# exit 1 +# fi + +sed -i "s/#define NTS_VERSION_MAJOR ${NTSSCM_VERSION_MAJOR_ORIGINAL}/#define NTS_VERSION_MAJOR ${NTSSCM_VERSION_MAJOR}/g" ${MAKE_RELEASE_REPOSITORY}/groups/nts/ntsscm/ntsscm_versiontag.h +sed -i "s/#define NTS_VERSION_MINOR ${NTSSCM_VERSION_MINOR_ORIGINAL}/#define NTS_VERSION_MINOR ${NTSSCM_VERSION_MINOR}/g" ${MAKE_RELEASE_REPOSITORY}/groups/nts/ntsscm/ntsscm_versiontag.h +sed -i "s/#define NTS_VERSION_PATCH ${NTSSCM_VERSION_PATCH_ORIGINAL}/#define NTS_VERSION_PATCH ${NTSSCM_VERSION_PATCH}/g" ${MAKE_RELEASE_REPOSITORY}/groups/nts/ntsscm/ntsscm_versiontag.h + +dpkg-debchange --version=${NTSSCM_VERSION_MAJOR}.${NTSSCM_VERSION_MINOR}.${NTSSCM_VERSION_PATCH} --from-branch=refs/heads/${MAKE_RELEASE_BRANCH} +if [ ${?} -ne 0 ]; then + echo "Failed to update debian/changelog" + exit 1 +fi + +git add ${MAKE_RELEASE_REPOSITORY}/debian/changelog +if [ ${?} -ne 0 ]; then + echo "Failed to add debian/changelog to the index" + exit 1 +fi + +git add ${MAKE_RELEASE_REPOSITORY}/groups/nts/ntsscm/ntsscm_versiontag.h +if [ ${?} -ne 0 ]; then + echo "Failed to add ${MAKE_RELEASE_REPOSITORY}/groups/nts/ntsscm/ntsscm_versiontag.h to the index" + exit 1 +fi + +git commit -m "Release ${NTSSCM_VERSION_MAJOR}.${NTSSCM_VERSION_MINOR}.${NTSSCM_VERSION_PATCH}" +if [ ${?} -ne 0 ]; then + echo "Failed to commit changes to the index" + exit 1 +fi + +git push ${MAKE_RELEASE_REMOTE} ${MAKE_RELEASE_BRANCH} +if [ ${?} -ne 0 ]; then + echo "Failed to push changes to the index" + exit 1 +fi + +git tag ${NTSSCM_VERSION_MAJOR}.${NTSSCM_VERSION_MINOR}.${NTSSCM_VERSION_PATCH} +if [ ${?} -ne 0 ]; then + echo "Failed to create tag" + exit 1 +fi + +git push ${MAKE_RELEASE_REMOTE} ${NTSSCM_VERSION_MAJOR}.${NTSSCM_VERSION_MINOR}.${NTSSCM_VERSION_PATCH} +if [ ${?} -ne 0 ]; then + echo "Failed to push tags" + exit 1 +fi + +git tag -d latest +if [ ${?} -ne 0 ]; then + echo "Failed to delete tag 'latest' locally" + exit 1 +fi + +git push origin :refs/tags/latest +if [ ${?} -ne 0 ]; then + echo "Failed to delete tag 'latest' remotely" + exit 1 +fi + +git tag latest +if [ ${?} -ne 0 ]; then + echo "Failed to create tag 'latest'" + exit 1 +fi + +git push origin latest +if [ ${?} -ne 0 ]; then + echo "Failed to push tag 'latest'" + exit 1 +fi + + +dpkg-publish +if [ ${?} -ne 0 ]; then + echo "Failed to publish" + exit 1 +fi + +dpkg-promote --distribution=infrastructure-unstable --source-package=ntf-core --source-version=${NTSSCM_VERSION_MAJOR}.${NTSSCM_VERSION_MINOR}.${NTSSCM_VERSION_PATCH} +if [ ${?} -ne 0 ]; then + echo "Failed to promote" + exit 1 +fi + diff --git a/groups/nts/ntsa/ntsa_ipv4address.cpp b/groups/nts/ntsa/ntsa_ipv4address.cpp index 87c5172c..c8aa2a7d 100644 --- a/groups/nts/ntsa/ntsa_ipv4address.cpp +++ b/groups/nts/ntsa/ntsa_ipv4address.cpp @@ -20,9 +20,12 @@ BSLS_IDENT_RCSID(ntsa_ipv4address_cpp, "$Id$ $CSID$") #include #include +#include #include +#include #include + namespace BloombergLP { namespace ntsa { @@ -90,22 +93,25 @@ bool Ipv4Address::parse(const bslstl::StringRef& text) NTSCFG_NOEXCEPT Representation newValue; newValue.d_asDword = 0; - bsl::uint32_t byteAtIndex = 0; + bsl::uint64_t numAtIndex = 0; while (current != end) { const char ch = *current; if (NTSCFG_LIKELY(ch >= '0' && ch <= '9')) { - byteAtIndex *= 10; - byteAtIndex += ch - '0'; + numAtIndex *= 10; + numAtIndex += ch - '0'; + if (numAtIndex > bsl::numeric_limits::max()) { + return false; + } } else { if (ch == '.') { - if (byteAtIndex > 255) { + if (numAtIndex > 255) { return false; } newValue.d_asBytes[index] = - NTSCFG_WARNING_NARROW(bsl::uint8_t, byteAtIndex); - byteAtIndex = 0; + NTSCFG_WARNING_NARROW(bsl::uint8_t, numAtIndex); + numAtIndex = 0; ++index; if (index > 3) { return false; @@ -119,17 +125,18 @@ bool Ipv4Address::parse(const bslstl::StringRef& text) NTSCFG_NOEXCEPT ++current; } - if (index != 3) { + bsl::uint64_t numOctetsLeft = 4 - index; + if (numAtIndex >= bsl::pow(256,numOctetsLeft)) { return false; } - if (byteAtIndex > 255) { - return false; + for (size_t oct = 0; oct < numOctetsLeft; ++oct) { + bsl::uint8_t octet = NTSCFG_WARNING_NARROW(bsl::uint8_t, + numAtIndex % 256); + newValue.d_asBytes[3 - oct] = octet; + numAtIndex /= 256; } - newValue.d_asBytes[index] = - NTSCFG_WARNING_NARROW(bsl::uint8_t, byteAtIndex); - d_value.d_asDword = newValue.d_asDword; return true; diff --git a/groups/nts/ntsa/ntsa_ipv4address.t.cpp b/groups/nts/ntsa/ntsa_ipv4address.t.cpp index e028ceb1..32f494b3 100644 --- a/groups/nts/ntsa/ntsa_ipv4address.t.cpp +++ b/groups/nts/ntsa/ntsa_ipv4address.t.cpp @@ -291,6 +291,20 @@ void Ipv4AddressTest::verifyParsing() { "x.2.3.4.5", {0x00, 0x00, 0x00, 0x00}, false}, { "256.256.256.256", {0x00, 0x00, 0x00, 0x00}, false}, {"9999.9999.9999.9999", {0x00, 0x00, 0x00, 0x00}, false}, + + { "127.1", {0x7F, 0x00, 0x00, 0x01}, true}, + { "127.168.257", {0x7F, 0xA8, 0x01, 0x01}, true}, + { "127.2.1", {0x7F, 0x02, 0x00, 0x01}, true}, + { "199.11315476", {0xC7, 0xAC, 0xA9, 0x14}, true}, + { "255.16777215", {0xFF, 0xFF, 0xFF, 0xFF}, true}, + { "255.255.65535", {0xFF, 0xFF, 0xFF, 0xFF}, true}, + { "1", {0x00, 0x00, 0x00, 0x01}, true}, + { "4294967295", {0xFF, 0xFF, 0xFF, 0xFF}, true}, + { "4294967296", {0x00, 0x00, 0x00, 0x00}, false}, + { "256.1", {0x00, 0x00, 0x00, 0x00}, false}, + { "255.16777216", {0x00, 0x00, 0x00, 0x00}, false}, + { "255.255.65536", {0xFF, 0xFF, 0xFF, 0xFF}, false}, + { "99999999999999999", {0x00, 0x00, 0x00, 0x00}, false}, }; enum { NUM_DATA = sizeof(DATA) / sizeof(DATA[0]) };