Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PoC, nomerge] PCP IPv4 portmap+IPv6 pinhole test #30005

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,15 @@ bitcoind_CXXFLAGS = $(bitcoin_bin_cxxflags)
bitcoind_LDFLAGS = $(bitcoin_bin_ldflags)
bitcoind_LDADD = $(LIBBITCOIN_NODE) $(bitcoin_bin_ldadd)

#################################################################
bin_PROGRAMS += pcp-test
pcp_test_SOURCES = pcp-test.cpp
pcp_test_CPPFLAGS = $(bitcoin_bin_cppflags)
pcp_test_CXXFLAGS = $(bitcoin_bin_cxxflags)
pcp_test_LDFLAGS = $(bitcoin_bin_ldflags)
pcp_test_LDADD = $(LIBBITCOIN_NODE) $(bitcoin_bin_ldadd)
#################################################################

bitcoin_node_SOURCES = $(bitcoin_daemon_sources) init/bitcoin-node.cpp
bitcoin_node_CPPFLAGS = $(bitcoin_bin_cppflags)
bitcoin_node_CXXFLAGS = $(bitcoin_bin_cxxflags)
Expand Down
6 changes: 6 additions & 0 deletions src/crypto/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ uint64_t static inline ReadBE64(const unsigned char* ptr)
return be64toh_internal(x);
}

void static inline WriteBE16(unsigned char* ptr, uint16_t x)
{
uint16_t v = htobe16_internal(x);
memcpy(ptr, &v, 2);
}

void static inline WriteBE32(unsigned char* ptr, uint32_t x)
{
uint32_t v = htobe32_internal(x);
Expand Down