mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-15 17:35:45 +00:00
188 lines
11 KiB
C
188 lines
11 KiB
C
/* Generated by Nim Compiler v1.2.6 */
|
|
/* (c) 2020 Andreas Rumpf */
|
|
/* The generated code is subject to the original license. */
|
|
/* Compiled for: Linux, amd64, gcc */
|
|
/* Command for C compiler:
|
|
gcc -c -w -pthread -I/home/runner/work/nim-waku/nim-waku/vendor/nim-libbacktrace -I/home/runner/work/nim-waku/nim-waku/vendor/nim-libbacktrace/install/usr/include -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper/secp256k1 -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper/secp256k1/src -DHAVE_CONFIG_H -DHAVE_BUILTIN_EXPECT -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/src -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/inc -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/tools -DBR_USE_UNIX_TIME=1 -DBR_USE_URANDOM=1 -DBR_LE_UNALIGNED=1 -DBR_64=1 -DBR_amd64=1 -DBR_INT128=1 -march=native -g3 -Og -O3 -fno-strict-aliasing -fno-ident -I/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib -I/home/runner/work/nim-waku/nim-waku/waku/v1/node -o nimcache/release/start_network/@m..@s..@s..@svendor@snim-eth@seth@sp2p@senode.nim.c.o nimcache/release/start_network/@m..@s..@s..@svendor@snim-eth@seth@sp2p@senode.nim.c */
|
|
#define NIM_INTBITS 64
|
|
|
|
#include "nimbase.h"
|
|
#include <string.h>
|
|
#undef LANGUAGE_C
|
|
#undef MIPSEB
|
|
#undef MIPSEL
|
|
#undef PPC
|
|
#undef R3000
|
|
#undef R4000
|
|
#undef i386
|
|
#undef linux
|
|
#undef mips
|
|
#undef near
|
|
#undef far
|
|
#undef powerpc
|
|
#undef unix
|
|
#define nimfr_(x, y)
|
|
#define nimln_(x, y)
|
|
typedef struct NimStringDesc NimStringDesc;
|
|
typedef struct TGenericSeq TGenericSeq;
|
|
typedef struct tyObject_ENode__bNRDNKJGQnqT2sH89bsDhBw tyObject_ENode__bNRDNKJGQnqT2sH89bsDhBw;
|
|
typedef struct tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA;
|
|
typedef struct tyObject_secp256k1_pubkey__GYc9aFo1e2qOLdmAqUvIikQ tyObject_secp256k1_pubkey__GYc9aFo1e2qOLdmAqUvIikQ;
|
|
typedef struct tyObject_Address__x5U8qnsjGWstAJoOadUZ9aA tyObject_Address__x5U8qnsjGWstAJoOadUZ9aA;
|
|
typedef struct tyObject_IpAddress__t0yd6ha54oWXm7nwZ4QqfA tyObject_IpAddress__t0yd6ha54oWXm7nwZ4QqfA;
|
|
struct TGenericSeq {NI len;
|
|
NI reserved;
|
|
};
|
|
struct NimStringDesc { TGenericSeq Sup;NIM_CHAR data[SEQ_DECL_SIZE];
|
|
};
|
|
typedef NU8 tyArray__w5VB8h5K8DB3oWrO5U2wqg[64];
|
|
struct tyObject_secp256k1_pubkey__GYc9aFo1e2qOLdmAqUvIikQ {tyArray__w5VB8h5K8DB3oWrO5U2wqg data;
|
|
};
|
|
struct tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA {tyObject_secp256k1_pubkey__GYc9aFo1e2qOLdmAqUvIikQ data;
|
|
};
|
|
typedef NU8 tyEnum_IpAddressFamily__iqqacz9cr9bcNjYY74E10wPA;
|
|
typedef NU8 tyArray__qtqsWM5aXmcpMIVmvq3kAA[16];
|
|
typedef NU8 tyArray__H8qf9bpC2ziYA2earmO8m7w[4];
|
|
struct tyObject_IpAddress__t0yd6ha54oWXm7nwZ4QqfA {tyEnum_IpAddressFamily__iqqacz9cr9bcNjYY74E10wPA family;
|
|
union{
|
|
struct {tyArray__qtqsWM5aXmcpMIVmvq3kAA address_v6;
|
|
} _family_1;
|
|
struct {tyArray__H8qf9bpC2ziYA2earmO8m7w address_v4;
|
|
} _family_2;
|
|
};
|
|
};
|
|
struct tyObject_Address__x5U8qnsjGWstAJoOadUZ9aA {tyObject_IpAddress__t0yd6ha54oWXm7nwZ4QqfA ip;
|
|
NU16 udpPort;
|
|
NU16 tcpPort;
|
|
};
|
|
struct tyObject_ENode__bNRDNKJGQnqT2sH89bsDhBw {tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA pubkey;
|
|
tyObject_Address__x5U8qnsjGWstAJoOadUZ9aA address;
|
|
};
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___cbhSLBlQm0h9cO9cfQ8lXDaw)(tyObject_IpAddress__t0yd6ha54oWXm7nwZ4QqfA address);
|
|
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
|
|
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size);
|
|
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
|
|
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___sCk67mWMaXubq9aFhJ4e9cXw)(tyObject_SkPublicKey__YxxaGK7KOKaWCOaZ44rHMA* pubkey);
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
|
|
STRING_LITERAL(TM__5p3rEJPVDvOAs69bkZMfUjw_2, "[", 1);
|
|
STRING_LITERAL(TM__5p3rEJPVDvOAs69bkZMfUjw_3, "]", 1);
|
|
STRING_LITERAL(TM__5p3rEJPVDvOAs69bkZMfUjw_4, "enode://", 8);
|
|
STRING_LITERAL(TM__5p3rEJPVDvOAs69bkZMfUjw_5, "@", 1);
|
|
STRING_LITERAL(TM__5p3rEJPVDvOAs69bkZMfUjw_6, ":", 1);
|
|
STRING_LITERAL(TM__5p3rEJPVDvOAs69bkZMfUjw_7, "\?", 1);
|
|
STRING_LITERAL(TM__5p3rEJPVDvOAs69bkZMfUjw_8, "discport=", 9);
|
|
|
|
#line 11 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) { void* T1_;
|
|
#line 13 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
|
|
#line 13 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
T1_ = (void*)0; T1_ = memcpy(dest, source, ((size_t) (size)));}
|
|
|
|
#line 2112 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) {
|
|
#line 2113 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
|
|
#line 2113 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
nimCopyMem(dest, source, size);
|
|
}
|
|
|
|
#line 217 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
|
|
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
|
|
#line 218 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
|
|
{
|
|
#line 218 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
|
|
|
|
#line 218 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
|
|
if (!!((src == NIM_NIL))) goto LA3_;
|
|
|
|
#line 219 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
|
|
|
|
#line 219 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
|
|
|
|
#line 219 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
|
|
copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
|
|
|
|
#line 220 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/sysstr.nim"
|
|
(*dest).Sup.len += (*src).Sup.len; }
|
|
LA3_: ;
|
|
}
|
|
|
|
#line 111 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___p1bJHljb0IASfa1yPunfKA)(tyObject_ENode__bNRDNKJGQnqT2sH89bsDhBw* n_0) { NimStringDesc* result; NimStringDesc* ipaddr; NimStringDesc* T8_; result = (NimStringDesc*)0; ipaddr = (NimStringDesc*)0;
|
|
#line 114 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
{
|
|
#line 114 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
if (!((*n_0).address.ip.family == ((tyEnum_IpAddressFamily__iqqacz9cr9bcNjYY74E10wPA) 1))) goto LA3_;
|
|
|
|
#line 115 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 115 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
ipaddr = dollar___cbhSLBlQm0h9cO9cfQ8lXDaw((*n_0).address.ip); }
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{ NimStringDesc* T6_; NimStringDesc* T7_;
|
|
#line 117 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 117 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
T6_ = (NimStringDesc*)0;
|
|
#line 117 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 117 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
T7_ = (NimStringDesc*)0; T7_ = dollar___cbhSLBlQm0h9cO9cfQ8lXDaw((*n_0).address.ip); T6_ = rawNewString((T7_ ? T7_->Sup.len : 0) + 2);appendString(T6_, ((NimStringDesc*) &TM__5p3rEJPVDvOAs69bkZMfUjw_2));appendString(T6_, T7_);appendString(T6_, ((NimStringDesc*) &TM__5p3rEJPVDvOAs69bkZMfUjw_3)); ipaddr = T6_; }
|
|
LA1_: ;
|
|
|
|
#line 118 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 118 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 118 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
result = mnewString(((NI) 0));
|
|
#line 119 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
result = resizeString(result, 8);appendString(result, ((NimStringDesc*) &TM__5p3rEJPVDvOAs69bkZMfUjw_4));
|
|
#line 120 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 120 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 120 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
T8_ = (NimStringDesc*)0; T8_ = dollar___sCk67mWMaXubq9aFhJ4e9cXw((&(*n_0).pubkey)); result = resizeString(result, (T8_ ? T8_->Sup.len : 0) + 0);appendString(result, T8_);
|
|
#line 121 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
result = resizeString(result, 1);appendString(result, ((NimStringDesc*) &TM__5p3rEJPVDvOAs69bkZMfUjw_5));
|
|
#line 122 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
result = resizeString(result, (ipaddr ? ipaddr->Sup.len : 0) + 0);appendString(result, ipaddr);
|
|
#line 123 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
{ NimStringDesc* T13_;
|
|
#line 123 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 123 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
if (!!(((*n_0).address.tcpPort == ((NU16) 0)))) goto LA11_;
|
|
|
|
#line 124 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
result = resizeString(result, 1);appendString(result, ((NimStringDesc*) &TM__5p3rEJPVDvOAs69bkZMfUjw_6));
|
|
#line 125 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 125 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
T13_ = (NimStringDesc*)0; T13_ = nimIntToStr(((NI) ((*n_0).address.tcpPort))); result = resizeString(result, (T13_ ? T13_->Sup.len : 0) + 0);appendString(result, T13_); }
|
|
LA11_: ;
|
|
|
|
#line 126 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
{ NimStringDesc* T18_;
|
|
#line 126 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 126 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
if (!!(((*n_0).address.udpPort == (*n_0).address.tcpPort))) goto LA16_;
|
|
|
|
#line 127 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
result = resizeString(result, 1);appendString(result, ((NimStringDesc*) &TM__5p3rEJPVDvOAs69bkZMfUjw_7));
|
|
#line 128 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
result = resizeString(result, 9);appendString(result, ((NimStringDesc*) &TM__5p3rEJPVDvOAs69bkZMfUjw_8));
|
|
#line 129 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
|
|
#line 129 "/home/runner/work/nim-waku/nim-waku/vendor/nim-eth/eth/p2p/enode.nim"
|
|
T18_ = (NimStringDesc*)0; T18_ = nimIntToStr(((NI) ((*n_0).address.udpPort))); result = resizeString(result, (T18_ ? T18_->Sup.len : 0) + 0);appendString(result, T18_); }
|
|
LA16_: ;
|
|
return result;}
|