summaryrefslogtreecommitdiff
path: root/ecp/src
diff options
context:
space:
mode:
Diffstat (limited to 'ecp/src')
-rw-r--r--ecp/src/ecp/LICENSE (renamed from ecp/src/LICENSE)0
-rw-r--r--ecp/src/ecp/Makefile (renamed from ecp/src/Makefile)0
-rw-r--r--ecp/src/ecp/TODO (renamed from ecp/src/TODO)0
-rw-r--r--ecp/src/ecp/common.mk (renamed from ecp/src/common.mk)0
-rw-r--r--ecp/src/ecp/core.c (renamed from ecp/src/core.c)0
-rw-r--r--ecp/src/ecp/core.h (renamed from ecp/src/core.h)0
-rw-r--r--ecp/src/ecp/cr.h (renamed from ecp/src/cr.h)0
-rw-r--r--ecp/src/ecp/crypto/Makefile (renamed from ecp/src/crypto/Makefile)0
-rwxr-xr-xecp/src/ecp/crypto/arc4random/Makefile (renamed from ecp/src/crypto/arc4random/Makefile)0
-rwxr-xr-xecp/src/ecp/crypto/arc4random/arc4random.c (renamed from ecp/src/crypto/arc4random/arc4random.c)0
-rwxr-xr-xecp/src/ecp/crypto/arc4random/arc4random.h (renamed from ecp/src/crypto/arc4random/arc4random.h)0
-rwxr-xr-xecp/src/ecp/crypto/arc4random/chacha_private.h (renamed from ecp/src/crypto/arc4random/chacha_private.h)0
-rw-r--r--ecp/src/ecp/crypto/chacha/Makefile (renamed from ecp/src/crypto/chacha/Makefile)0
-rw-r--r--ecp/src/ecp/crypto/chacha/chacha-merged.c (renamed from ecp/src/crypto/chacha/chacha-merged.c)0
-rw-r--r--ecp/src/ecp/crypto/chacha/chacha.c (renamed from ecp/src/crypto/chacha/chacha.c)0
-rw-r--r--ecp/src/ecp/crypto/compat/Makefile (renamed from ecp/src/crypto/compat/Makefile)0
-rw-r--r--ecp/src/ecp/crypto/compat/explicit_bzero.c (renamed from ecp/src/crypto/compat/explicit_bzero.c)0
-rw-r--r--ecp/src/ecp/crypto/compat/timingsafe_bcmp.c (renamed from ecp/src/crypto/compat/timingsafe_bcmp.c)0
-rw-r--r--ecp/src/ecp/crypto/compat/timingsafe_memcmp.c (renamed from ecp/src/crypto/compat/timingsafe_memcmp.c)0
-rw-r--r--ecp/src/ecp/crypto/crypto.c (renamed from ecp/src/crypto/crypto.c)0
-rw-r--r--ecp/src/ecp/crypto/crypto.h (renamed from ecp/src/crypto/crypto.h)0
-rw-r--r--ecp/src/ecp/crypto/curve25519/Makefile (renamed from ecp/src/crypto/curve25519/Makefile)0
-rw-r--r--ecp/src/ecp/crypto/curve25519/curve25519-generic.c (renamed from ecp/src/crypto/curve25519/curve25519-generic.c)0
-rw-r--r--ecp/src/ecp/crypto/curve25519/curve25519.c (renamed from ecp/src/crypto/curve25519/curve25519.c)0
-rw-r--r--ecp/src/ecp/crypto/curve25519/curve25519_internal.h (renamed from ecp/src/crypto/curve25519/curve25519_internal.h)0
-rw-r--r--ecp/src/ecp/crypto/e_chacha20poly1305.c (renamed from ecp/src/crypto/e_chacha20poly1305.c)0
-rw-r--r--ecp/src/ecp/crypto/include/chacha.h (renamed from ecp/src/crypto/include/chacha.h)0
-rw-r--r--ecp/src/ecp/crypto/include/compat.h (renamed from ecp/src/crypto/include/compat.h)0
-rw-r--r--ecp/src/ecp/crypto/include/curve25519.h (renamed from ecp/src/crypto/include/curve25519.h)0
-rw-r--r--ecp/src/ecp/crypto/include/machine/endian.h (renamed from ecp/src/crypto/include/machine/endian.h)0
-rw-r--r--ecp/src/ecp/crypto/include/md32_common.h (renamed from ecp/src/crypto/include/md32_common.h)0
-rw-r--r--ecp/src/ecp/crypto/include/poly1305.h (renamed from ecp/src/crypto/include/poly1305.h)0
-rw-r--r--ecp/src/ecp/crypto/include/sha.h (renamed from ecp/src/crypto/include/sha.h)0
-rw-r--r--ecp/src/ecp/crypto/poly1305/Makefile (renamed from ecp/src/crypto/poly1305/Makefile)0
-rw-r--r--ecp/src/ecp/crypto/poly1305/poly1305-donna.c (renamed from ecp/src/crypto/poly1305/poly1305-donna.c)0
-rw-r--r--ecp/src/ecp/crypto/poly1305/poly1305.c (renamed from ecp/src/crypto/poly1305/poly1305.c)0
-rw-r--r--ecp/src/ecp/crypto/sha/Makefile (renamed from ecp/src/crypto/sha/Makefile)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha1-elf-x86_64.S (renamed from ecp/src/crypto/sha/sha1-elf-x86_64.S)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha1-macosx-x86_64.S (renamed from ecp/src/crypto/sha/sha1-macosx-x86_64.S)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha1_one.c (renamed from ecp/src/crypto/sha/sha1_one.c)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha1dgst.c (renamed from ecp/src/crypto/sha/sha1dgst.c)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha256-elf-x86_64.S (renamed from ecp/src/crypto/sha/sha256-elf-x86_64.S)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha256-macosx-x86_64.S (renamed from ecp/src/crypto/sha/sha256-macosx-x86_64.S)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha256.c (renamed from ecp/src/crypto/sha/sha256.c)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha512-elf-x86_64.S (renamed from ecp/src/crypto/sha/sha512-elf-x86_64.S)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha512-macosx-x86_64.S (renamed from ecp/src/crypto/sha/sha512-macosx-x86_64.S)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha512.c (renamed from ecp/src/crypto/sha/sha512.c)0
-rw-r--r--ecp/src/ecp/crypto/sha/sha_locl.h (renamed from ecp/src/crypto/sha/sha_locl.h)0
-rw-r--r--ecp/src/ecp/crypto/test/Makefile (renamed from ecp/src/crypto/test/Makefile)0
-rw-r--r--ecp/src/ecp/crypto/test/aead.c (renamed from ecp/src/crypto/test/aead.c)0
-rw-r--r--ecp/src/ecp/crypto/test/aead_dec.c (renamed from ecp/src/crypto/test/aead_dec.c)0
-rw-r--r--ecp/src/ecp/crypto/test/aead_enc.c (renamed from ecp/src/crypto/test/aead_enc.c)0
-rw-r--r--ecp/src/ecp/crypto/test/ed25519.c (renamed from ecp/src/crypto/test/ed25519.c)0
-rw-r--r--ecp/src/ecp/crypto/test/ed25519_open.c (renamed from ecp/src/crypto/test/ed25519_open.c)0
-rw-r--r--ecp/src/ecp/crypto/test/ed25519_sign.c (renamed from ecp/src/crypto/test/ed25519_sign.c)0
-rw-r--r--ecp/src/ecp/dir.c (renamed from ecp/src/dir.c)0
-rw-r--r--ecp/src/ecp/dir.h (renamed from ecp/src/dir.h)0
-rw-r--r--ecp/src/ecp/dir_srv.c (renamed from ecp/src/dir_srv.c)0
-rw-r--r--ecp/src/ecp/dir_srv.h (renamed from ecp/src/dir_srv.h)0
-rw-r--r--ecp/src/ecp/ht.h (renamed from ecp/src/ht.h)0
-rw-r--r--ecp/src/ecp/htable/Makefile (renamed from ecp/src/htable/Makefile)0
-rwxr-xr-xecp/src/ecp/htable/hashtable.c (renamed from ecp/src/htable/hashtable.c)0
-rwxr-xr-xecp/src/ecp/htable/hashtable.h (renamed from ecp/src/htable/hashtable.h)0
-rwxr-xr-xecp/src/ecp/htable/hashtable_itr.c (renamed from ecp/src/htable/hashtable_itr.c)0
-rwxr-xr-xecp/src/ecp/htable/hashtable_itr.h (renamed from ecp/src/htable/hashtable_itr.h)0
-rwxr-xr-xecp/src/ecp/htable/hashtable_private.h (renamed from ecp/src/htable/hashtable_private.h)0
-rw-r--r--ecp/src/ecp/htable/htable.c (renamed from ecp/src/htable/htable.c)0
-rw-r--r--ecp/src/ecp/msgq.c (renamed from ecp/src/msgq.c)0
-rw-r--r--ecp/src/ecp/msgq.h (renamed from ecp/src/msgq.h)0
-rw-r--r--ecp/src/ecp/rbuf.c (renamed from ecp/src/rbuf.c)0
-rw-r--r--ecp/src/ecp/rbuf.h (renamed from ecp/src/rbuf.h)0
-rw-r--r--ecp/src/ecp/rbuf_recv.c (renamed from ecp/src/rbuf_recv.c)0
-rw-r--r--ecp/src/ecp/rbuf_send.c (renamed from ecp/src/rbuf_send.c)0
-rw-r--r--ecp/src/ecp/timer.c (renamed from ecp/src/timer.c)0
-rw-r--r--ecp/src/ecp/timer.h (renamed from ecp/src/timer.h)0
-rw-r--r--ecp/src/ecp/tm.h (renamed from ecp/src/tm.h)0
-rw-r--r--ecp/src/ecp/tr.h (renamed from ecp/src/tr.h)0
-rw-r--r--ecp/src/ecp/vconn/Makefile (renamed from ecp/src/vconn/Makefile)0
-rw-r--r--ecp/src/ecp/vconn/vconn.c (renamed from ecp/src/vconn/vconn.c)0
-rw-r--r--ecp/src/ecp/vconn/vconn.h (renamed from ecp/src/vconn/vconn.h)0
-rw-r--r--ecp/src/platform/common.mk3
-rw-r--r--ecp/src/platform/fe310/Makefile19
-rw-r--r--ecp/src/platform/fe310/platform.mk3
-rw-r--r--ecp/src/platform/fe310/platform_obj.mk1
-rw-r--r--ecp/src/platform/fe310/time.c35
-rw-r--r--ecp/src/platform/fe310/transport.c116
-rw-r--r--ecp/src/platform/fe310/transport.h7
-rw-r--r--ecp/src/platform/posix/Makefile19
-rw-r--r--ecp/src/platform/posix/platform.mk2
-rw-r--r--ecp/src/platform/posix/platform_obj.mk2
-rw-r--r--ecp/src/platform/posix/time.c24
-rw-r--r--ecp/src/platform/posix/transport.c113
-rw-r--r--ecp/src/platform/posix/transport.h7
93 files changed, 351 insertions, 0 deletions
diff --git a/ecp/src/LICENSE b/ecp/src/ecp/LICENSE
index d159169..d159169 100644
--- a/ecp/src/LICENSE
+++ b/ecp/src/ecp/LICENSE
diff --git a/ecp/src/Makefile b/ecp/src/ecp/Makefile
index 5fed12a..5fed12a 100644
--- a/ecp/src/Makefile
+++ b/ecp/src/ecp/Makefile
diff --git a/ecp/src/TODO b/ecp/src/ecp/TODO
index 01c2a28..01c2a28 100644
--- a/ecp/src/TODO
+++ b/ecp/src/ecp/TODO
diff --git a/ecp/src/common.mk b/ecp/src/ecp/common.mk
index a2f8663..a2f8663 100644
--- a/ecp/src/common.mk
+++ b/ecp/src/ecp/common.mk
diff --git a/ecp/src/core.c b/ecp/src/ecp/core.c
index 90ee925..90ee925 100644
--- a/ecp/src/core.c
+++ b/ecp/src/ecp/core.c
diff --git a/ecp/src/core.h b/ecp/src/ecp/core.h
index b126430..b126430 100644
--- a/ecp/src/core.h
+++ b/ecp/src/ecp/core.h
diff --git a/ecp/src/cr.h b/ecp/src/ecp/cr.h
index a8d0dea..a8d0dea 100644
--- a/ecp/src/cr.h
+++ b/ecp/src/ecp/cr.h
diff --git a/ecp/src/crypto/Makefile b/ecp/src/ecp/crypto/Makefile
index b1d2996..b1d2996 100644
--- a/ecp/src/crypto/Makefile
+++ b/ecp/src/ecp/crypto/Makefile
diff --git a/ecp/src/crypto/arc4random/Makefile b/ecp/src/ecp/crypto/arc4random/Makefile
index 387bca1..387bca1 100755
--- a/ecp/src/crypto/arc4random/Makefile
+++ b/ecp/src/ecp/crypto/arc4random/Makefile
diff --git a/ecp/src/crypto/arc4random/arc4random.c b/ecp/src/ecp/crypto/arc4random/arc4random.c
index 23ce9b7..23ce9b7 100755
--- a/ecp/src/crypto/arc4random/arc4random.c
+++ b/ecp/src/ecp/crypto/arc4random/arc4random.c
diff --git a/ecp/src/crypto/arc4random/arc4random.h b/ecp/src/ecp/crypto/arc4random/arc4random.h
index e281a89..e281a89 100755
--- a/ecp/src/crypto/arc4random/arc4random.h
+++ b/ecp/src/ecp/crypto/arc4random/arc4random.h
diff --git a/ecp/src/crypto/arc4random/chacha_private.h b/ecp/src/ecp/crypto/arc4random/chacha_private.h
index 05ce200..05ce200 100755
--- a/ecp/src/crypto/arc4random/chacha_private.h
+++ b/ecp/src/ecp/crypto/arc4random/chacha_private.h
diff --git a/ecp/src/crypto/chacha/Makefile b/ecp/src/ecp/crypto/chacha/Makefile
index bd747e5..bd747e5 100644
--- a/ecp/src/crypto/chacha/Makefile
+++ b/ecp/src/ecp/crypto/chacha/Makefile
diff --git a/ecp/src/crypto/chacha/chacha-merged.c b/ecp/src/ecp/crypto/chacha/chacha-merged.c
index 557dfd5..557dfd5 100644
--- a/ecp/src/crypto/chacha/chacha-merged.c
+++ b/ecp/src/ecp/crypto/chacha/chacha-merged.c
diff --git a/ecp/src/crypto/chacha/chacha.c b/ecp/src/ecp/crypto/chacha/chacha.c
index fba03c9..fba03c9 100644
--- a/ecp/src/crypto/chacha/chacha.c
+++ b/ecp/src/ecp/crypto/chacha/chacha.c
diff --git a/ecp/src/crypto/compat/Makefile b/ecp/src/ecp/crypto/compat/Makefile
index 1a8c2ee..1a8c2ee 100644
--- a/ecp/src/crypto/compat/Makefile
+++ b/ecp/src/ecp/crypto/compat/Makefile
diff --git a/ecp/src/crypto/compat/explicit_bzero.c b/ecp/src/ecp/crypto/compat/explicit_bzero.c
index 5dd0103..5dd0103 100644
--- a/ecp/src/crypto/compat/explicit_bzero.c
+++ b/ecp/src/ecp/crypto/compat/explicit_bzero.c
diff --git a/ecp/src/crypto/compat/timingsafe_bcmp.c b/ecp/src/ecp/crypto/compat/timingsafe_bcmp.c
index 552e844..552e844 100644
--- a/ecp/src/crypto/compat/timingsafe_bcmp.c
+++ b/ecp/src/ecp/crypto/compat/timingsafe_bcmp.c
diff --git a/ecp/src/crypto/compat/timingsafe_memcmp.c b/ecp/src/ecp/crypto/compat/timingsafe_memcmp.c
index bb210a3..bb210a3 100644
--- a/ecp/src/crypto/compat/timingsafe_memcmp.c
+++ b/ecp/src/ecp/crypto/compat/timingsafe_memcmp.c
diff --git a/ecp/src/crypto/crypto.c b/ecp/src/ecp/crypto/crypto.c
index e1d06b3..e1d06b3 100644
--- a/ecp/src/crypto/crypto.c
+++ b/ecp/src/ecp/crypto/crypto.c
diff --git a/ecp/src/crypto/crypto.h b/ecp/src/ecp/crypto/crypto.h
index 378500c..378500c 100644
--- a/ecp/src/crypto/crypto.h
+++ b/ecp/src/ecp/crypto/crypto.h
diff --git a/ecp/src/crypto/curve25519/Makefile b/ecp/src/ecp/crypto/curve25519/Makefile
index 85839bb..85839bb 100644
--- a/ecp/src/crypto/curve25519/Makefile
+++ b/ecp/src/ecp/crypto/curve25519/Makefile
diff --git a/ecp/src/crypto/curve25519/curve25519-generic.c b/ecp/src/ecp/crypto/curve25519/curve25519-generic.c
index e7373d2..e7373d2 100644
--- a/ecp/src/crypto/curve25519/curve25519-generic.c
+++ b/ecp/src/ecp/crypto/curve25519/curve25519-generic.c
diff --git a/ecp/src/crypto/curve25519/curve25519.c b/ecp/src/ecp/crypto/curve25519/curve25519.c
index f5f57e6..f5f57e6 100644
--- a/ecp/src/crypto/curve25519/curve25519.c
+++ b/ecp/src/ecp/crypto/curve25519/curve25519.c
diff --git a/ecp/src/crypto/curve25519/curve25519_internal.h b/ecp/src/ecp/crypto/curve25519/curve25519_internal.h
index f80424a..f80424a 100644
--- a/ecp/src/crypto/curve25519/curve25519_internal.h
+++ b/ecp/src/ecp/crypto/curve25519/curve25519_internal.h
diff --git a/ecp/src/crypto/e_chacha20poly1305.c b/ecp/src/ecp/crypto/e_chacha20poly1305.c
index 17fcab8..17fcab8 100644
--- a/ecp/src/crypto/e_chacha20poly1305.c
+++ b/ecp/src/ecp/crypto/e_chacha20poly1305.c
diff --git a/ecp/src/crypto/include/chacha.h b/ecp/src/ecp/crypto/include/chacha.h
index 25a3ef3..25a3ef3 100644
--- a/ecp/src/crypto/include/chacha.h
+++ b/ecp/src/ecp/crypto/include/chacha.h
diff --git a/ecp/src/crypto/include/compat.h b/ecp/src/ecp/crypto/include/compat.h
index 12fb3f4..12fb3f4 100644
--- a/ecp/src/crypto/include/compat.h
+++ b/ecp/src/ecp/crypto/include/compat.h
diff --git a/ecp/src/crypto/include/curve25519.h b/ecp/src/ecp/crypto/include/curve25519.h
index a7092cb..a7092cb 100644
--- a/ecp/src/crypto/include/curve25519.h
+++ b/ecp/src/ecp/crypto/include/curve25519.h
diff --git a/ecp/src/crypto/include/machine/endian.h b/ecp/src/ecp/crypto/include/machine/endian.h
index 5ec39af..5ec39af 100644
--- a/ecp/src/crypto/include/machine/endian.h
+++ b/ecp/src/ecp/crypto/include/machine/endian.h
diff --git a/ecp/src/crypto/include/md32_common.h b/ecp/src/ecp/crypto/include/md32_common.h
index 7a6e893..7a6e893 100644
--- a/ecp/src/crypto/include/md32_common.h
+++ b/ecp/src/ecp/crypto/include/md32_common.h
diff --git a/ecp/src/crypto/include/poly1305.h b/ecp/src/ecp/crypto/include/poly1305.h
index d7af3df..d7af3df 100644
--- a/ecp/src/crypto/include/poly1305.h
+++ b/ecp/src/ecp/crypto/include/poly1305.h
diff --git a/ecp/src/crypto/include/sha.h b/ecp/src/ecp/crypto/include/sha.h
index 93af5d9..93af5d9 100644
--- a/ecp/src/crypto/include/sha.h
+++ b/ecp/src/ecp/crypto/include/sha.h
diff --git a/ecp/src/crypto/poly1305/Makefile b/ecp/src/ecp/crypto/poly1305/Makefile
index 7645ca4..7645ca4 100644
--- a/ecp/src/crypto/poly1305/Makefile
+++ b/ecp/src/ecp/crypto/poly1305/Makefile
diff --git a/ecp/src/crypto/poly1305/poly1305-donna.c b/ecp/src/ecp/crypto/poly1305/poly1305-donna.c
index 773ea4e..773ea4e 100644
--- a/ecp/src/crypto/poly1305/poly1305-donna.c
+++ b/ecp/src/ecp/crypto/poly1305/poly1305-donna.c
diff --git a/ecp/src/crypto/poly1305/poly1305.c b/ecp/src/ecp/crypto/poly1305/poly1305.c
index 5f3f111..5f3f111 100644
--- a/ecp/src/crypto/poly1305/poly1305.c
+++ b/ecp/src/ecp/crypto/poly1305/poly1305.c
diff --git a/ecp/src/crypto/sha/Makefile b/ecp/src/ecp/crypto/sha/Makefile
index 1fc67da..1fc67da 100644
--- a/ecp/src/crypto/sha/Makefile
+++ b/ecp/src/ecp/crypto/sha/Makefile
diff --git a/ecp/src/crypto/sha/sha1-elf-x86_64.S b/ecp/src/ecp/crypto/sha/sha1-elf-x86_64.S
index d7ef2bf..d7ef2bf 100644
--- a/ecp/src/crypto/sha/sha1-elf-x86_64.S
+++ b/ecp/src/ecp/crypto/sha/sha1-elf-x86_64.S
diff --git a/ecp/src/crypto/sha/sha1-macosx-x86_64.S b/ecp/src/ecp/crypto/sha/sha1-macosx-x86_64.S
index f5c2c36..f5c2c36 100644
--- a/ecp/src/crypto/sha/sha1-macosx-x86_64.S
+++ b/ecp/src/ecp/crypto/sha/sha1-macosx-x86_64.S
diff --git a/ecp/src/crypto/sha/sha1_one.c b/ecp/src/ecp/crypto/sha/sha1_one.c
index 080ea4d..080ea4d 100644
--- a/ecp/src/crypto/sha/sha1_one.c
+++ b/ecp/src/ecp/crypto/sha/sha1_one.c
diff --git a/ecp/src/crypto/sha/sha1dgst.c b/ecp/src/ecp/crypto/sha/sha1dgst.c
index acc576c..acc576c 100644
--- a/ecp/src/crypto/sha/sha1dgst.c
+++ b/ecp/src/ecp/crypto/sha/sha1dgst.c
diff --git a/ecp/src/crypto/sha/sha256-elf-x86_64.S b/ecp/src/ecp/crypto/sha/sha256-elf-x86_64.S
index 599a5cb..599a5cb 100644
--- a/ecp/src/crypto/sha/sha256-elf-x86_64.S
+++ b/ecp/src/ecp/crypto/sha/sha256-elf-x86_64.S
diff --git a/ecp/src/crypto/sha/sha256-macosx-x86_64.S b/ecp/src/ecp/crypto/sha/sha256-macosx-x86_64.S
index 3ecafca..3ecafca 100644
--- a/ecp/src/crypto/sha/sha256-macosx-x86_64.S
+++ b/ecp/src/ecp/crypto/sha/sha256-macosx-x86_64.S
diff --git a/ecp/src/crypto/sha/sha256.c b/ecp/src/ecp/crypto/sha/sha256.c
index ee22321..ee22321 100644
--- a/ecp/src/crypto/sha/sha256.c
+++ b/ecp/src/ecp/crypto/sha/sha256.c
diff --git a/ecp/src/crypto/sha/sha512-elf-x86_64.S b/ecp/src/ecp/crypto/sha/sha512-elf-x86_64.S
index d218304..d218304 100644
--- a/ecp/src/crypto/sha/sha512-elf-x86_64.S
+++ b/ecp/src/ecp/crypto/sha/sha512-elf-x86_64.S
diff --git a/ecp/src/crypto/sha/sha512-macosx-x86_64.S b/ecp/src/ecp/crypto/sha/sha512-macosx-x86_64.S
index 4a51d14..4a51d14 100644
--- a/ecp/src/crypto/sha/sha512-macosx-x86_64.S
+++ b/ecp/src/ecp/crypto/sha/sha512-macosx-x86_64.S
diff --git a/ecp/src/crypto/sha/sha512.c b/ecp/src/ecp/crypto/sha/sha512.c
index 364c85c..364c85c 100644
--- a/ecp/src/crypto/sha/sha512.c
+++ b/ecp/src/ecp/crypto/sha/sha512.c
diff --git a/ecp/src/crypto/sha/sha_locl.h b/ecp/src/ecp/crypto/sha/sha_locl.h
index f6d305d..f6d305d 100644
--- a/ecp/src/crypto/sha/sha_locl.h
+++ b/ecp/src/ecp/crypto/sha/sha_locl.h
diff --git a/ecp/src/crypto/test/Makefile b/ecp/src/ecp/crypto/test/Makefile
index 0b5013f..0b5013f 100644
--- a/ecp/src/crypto/test/Makefile
+++ b/ecp/src/ecp/crypto/test/Makefile
diff --git a/ecp/src/crypto/test/aead.c b/ecp/src/ecp/crypto/test/aead.c
index a2e0da7..a2e0da7 100644
--- a/ecp/src/crypto/test/aead.c
+++ b/ecp/src/ecp/crypto/test/aead.c
diff --git a/ecp/src/crypto/test/aead_dec.c b/ecp/src/ecp/crypto/test/aead_dec.c
index 7deb587..7deb587 100644
--- a/ecp/src/crypto/test/aead_dec.c
+++ b/ecp/src/ecp/crypto/test/aead_dec.c
diff --git a/ecp/src/crypto/test/aead_enc.c b/ecp/src/ecp/crypto/test/aead_enc.c
index a103490..a103490 100644
--- a/ecp/src/crypto/test/aead_enc.c
+++ b/ecp/src/ecp/crypto/test/aead_enc.c
diff --git a/ecp/src/crypto/test/ed25519.c b/ecp/src/ecp/crypto/test/ed25519.c
index 21334cb..21334cb 100644
--- a/ecp/src/crypto/test/ed25519.c
+++ b/ecp/src/ecp/crypto/test/ed25519.c
diff --git a/ecp/src/crypto/test/ed25519_open.c b/ecp/src/ecp/crypto/test/ed25519_open.c
index 66f32f5..66f32f5 100644
--- a/ecp/src/crypto/test/ed25519_open.c
+++ b/ecp/src/ecp/crypto/test/ed25519_open.c
diff --git a/ecp/src/crypto/test/ed25519_sign.c b/ecp/src/ecp/crypto/test/ed25519_sign.c
index da098bd..da098bd 100644
--- a/ecp/src/crypto/test/ed25519_sign.c
+++ b/ecp/src/ecp/crypto/test/ed25519_sign.c
diff --git a/ecp/src/dir.c b/ecp/src/ecp/dir.c
index 46d152e..46d152e 100644
--- a/ecp/src/dir.c
+++ b/ecp/src/ecp/dir.c
diff --git a/ecp/src/dir.h b/ecp/src/ecp/dir.h
index 2fcc50f..2fcc50f 100644
--- a/ecp/src/dir.h
+++ b/ecp/src/ecp/dir.h
diff --git a/ecp/src/dir_srv.c b/ecp/src/ecp/dir_srv.c
index 563326d..563326d 100644
--- a/ecp/src/dir_srv.c
+++ b/ecp/src/ecp/dir_srv.c
diff --git a/ecp/src/dir_srv.h b/ecp/src/ecp/dir_srv.h
index 3fc14ee..3fc14ee 100644
--- a/ecp/src/dir_srv.h
+++ b/ecp/src/ecp/dir_srv.h
diff --git a/ecp/src/ht.h b/ecp/src/ecp/ht.h
index 13bf1d7..13bf1d7 100644
--- a/ecp/src/ht.h
+++ b/ecp/src/ecp/ht.h
diff --git a/ecp/src/htable/Makefile b/ecp/src/ecp/htable/Makefile
index 854af5e..854af5e 100644
--- a/ecp/src/htable/Makefile
+++ b/ecp/src/ecp/htable/Makefile
diff --git a/ecp/src/htable/hashtable.c b/ecp/src/ecp/htable/hashtable.c
index 36c8a6d..36c8a6d 100755
--- a/ecp/src/htable/hashtable.c
+++ b/ecp/src/ecp/htable/hashtable.c
diff --git a/ecp/src/htable/hashtable.h b/ecp/src/ecp/htable/hashtable.h
index a0b1949..a0b1949 100755
--- a/ecp/src/htable/hashtable.h
+++ b/ecp/src/ecp/htable/hashtable.h
diff --git a/ecp/src/htable/hashtable_itr.c b/ecp/src/ecp/htable/hashtable_itr.c
index e77bbb0..e77bbb0 100755
--- a/ecp/src/htable/hashtable_itr.c
+++ b/ecp/src/ecp/htable/hashtable_itr.c
diff --git a/ecp/src/htable/hashtable_itr.h b/ecp/src/ecp/htable/hashtable_itr.h
index 47b29cc..47b29cc 100755
--- a/ecp/src/htable/hashtable_itr.h
+++ b/ecp/src/ecp/htable/hashtable_itr.h
diff --git a/ecp/src/htable/hashtable_private.h b/ecp/src/ecp/htable/hashtable_private.h
index bdddfc7..bdddfc7 100755
--- a/ecp/src/htable/hashtable_private.h
+++ b/ecp/src/ecp/htable/hashtable_private.h
diff --git a/ecp/src/htable/htable.c b/ecp/src/ecp/htable/htable.c
index 104d2aa..104d2aa 100644
--- a/ecp/src/htable/htable.c
+++ b/ecp/src/ecp/htable/htable.c
diff --git a/ecp/src/msgq.c b/ecp/src/ecp/msgq.c
index 8f81d8a..8f81d8a 100644
--- a/ecp/src/msgq.c
+++ b/ecp/src/ecp/msgq.c
diff --git a/ecp/src/msgq.h b/ecp/src/ecp/msgq.h
index 394209f..394209f 100644
--- a/ecp/src/msgq.h
+++ b/ecp/src/ecp/msgq.h
diff --git a/ecp/src/rbuf.c b/ecp/src/ecp/rbuf.c
index be8e9f3..be8e9f3 100644
--- a/ecp/src/rbuf.c
+++ b/ecp/src/ecp/rbuf.c
diff --git a/ecp/src/rbuf.h b/ecp/src/ecp/rbuf.h
index 31aeb39..31aeb39 100644
--- a/ecp/src/rbuf.h
+++ b/ecp/src/ecp/rbuf.h
diff --git a/ecp/src/rbuf_recv.c b/ecp/src/ecp/rbuf_recv.c
index a3f2345..a3f2345 100644
--- a/ecp/src/rbuf_recv.c
+++ b/ecp/src/ecp/rbuf_recv.c
diff --git a/ecp/src/rbuf_send.c b/ecp/src/ecp/rbuf_send.c
index 9f29010..9f29010 100644
--- a/ecp/src/rbuf_send.c
+++ b/ecp/src/ecp/rbuf_send.c
diff --git a/ecp/src/timer.c b/ecp/src/ecp/timer.c
index 28d4cb1..28d4cb1 100644
--- a/ecp/src/timer.c
+++ b/ecp/src/ecp/timer.c
diff --git a/ecp/src/timer.h b/ecp/src/ecp/timer.h
index 5bccff1..5bccff1 100644
--- a/ecp/src/timer.h
+++ b/ecp/src/ecp/timer.h
diff --git a/ecp/src/tm.h b/ecp/src/ecp/tm.h
index 00c6fad..00c6fad 100644
--- a/ecp/src/tm.h
+++ b/ecp/src/ecp/tm.h
diff --git a/ecp/src/tr.h b/ecp/src/ecp/tr.h
index 116590b..116590b 100644
--- a/ecp/src/tr.h
+++ b/ecp/src/ecp/tr.h
diff --git a/ecp/src/vconn/Makefile b/ecp/src/ecp/vconn/Makefile
index 17962c4..17962c4 100644
--- a/ecp/src/vconn/Makefile
+++ b/ecp/src/ecp/vconn/Makefile
diff --git a/ecp/src/vconn/vconn.c b/ecp/src/ecp/vconn/vconn.c
index d3eec44..d3eec44 100644
--- a/ecp/src/vconn/vconn.c
+++ b/ecp/src/ecp/vconn/vconn.c
diff --git a/ecp/src/vconn/vconn.h b/ecp/src/ecp/vconn/vconn.h
index 73d9fd6..73d9fd6 100644
--- a/ecp/src/vconn/vconn.h
+++ b/ecp/src/ecp/vconn/vconn.h
diff --git a/ecp/src/platform/common.mk b/ecp/src/platform/common.mk
new file mode 100644
index 0000000..d49792b
--- /dev/null
+++ b/ecp/src/platform/common.mk
@@ -0,0 +1,3 @@
+platform ?= posix
+src_dir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../src)
+include $(src_dir)/common.mk
diff --git a/ecp/src/platform/fe310/Makefile b/ecp/src/platform/fe310/Makefile
new file mode 100644
index 0000000..1a3502a
--- /dev/null
+++ b/ecp/src/platform/fe310/Makefile
@@ -0,0 +1,19 @@
+include ../common.mk
+
+obj_tr = transport.o
+obj_tm = time.o
+
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c $<
+
+all: libecptr.a libecptm.a
+
+libecptr.a: $(obj_tr)
+ $(AR) rcs libecptr.a $(obj_tr)
+
+libecptm.a: $(obj_tm)
+ $(AR) rcs libecptm.a $(obj_tm)
+
+clean:
+ rm -f *.o *.a
diff --git a/ecp/src/platform/fe310/platform.mk b/ecp/src/platform/fe310/platform.mk
new file mode 100644
index 0000000..0230f29
--- /dev/null
+++ b/ecp/src/platform/fe310/platform.mk
@@ -0,0 +1,3 @@
+fe310_dir = $(abspath $(src_dir)/../../fw/fe310)
+include $(fe310_dir)/platform.mk
+CFLAGS += -I$(fe310_dir) -DECP_WITH_VCONN=1 -DECP_DEBUG=1 -D__FE310__
diff --git a/ecp/src/platform/fe310/platform_obj.mk b/ecp/src/platform/fe310/platform_obj.mk
new file mode 100644
index 0000000..52e4bb1
--- /dev/null
+++ b/ecp/src/platform/fe310/platform_obj.mk
@@ -0,0 +1 @@
+subdirs += vconn
diff --git a/ecp/src/platform/fe310/time.c b/ecp/src/platform/fe310/time.c
new file mode 100644
index 0000000..3c74933
--- /dev/null
+++ b/ecp/src/platform/fe310/time.c
@@ -0,0 +1,35 @@
+#include <core.h>
+#include <tr.h>
+
+#include <eos/eos.h>
+#include <eos/net.h>
+#include <eos/event.h>
+#include <eos/timer.h>
+
+extern ECPSocket *_ecp_tr_sock;
+
+static void timer_handler(unsigned char type) {
+ ecp_cts_t next = ecp_timer_exe(_ecp_tr_sock);
+ if (next) {
+ eos_timer_set(next, EOS_TIMER_ETYPE_ECP);
+ }
+}
+
+int ecp_tm_init(ECPContext *ctx) {
+ eos_timer_set_handler(EOS_TIMER_ETYPE_ECP, timer_handler);
+ eos_net_acquire_for_evt(EOS_EVT_TIMER | EOS_TIMER_ETYPE_ECP, 1);
+ return ECP_OK;
+}
+
+ecp_cts_t ecp_tm_abstime_ms(ecp_cts_t msec) {
+ return eos_time_get_tick() * 1000 / EOS_TIMER_RTC_FREQ + msec;
+}
+
+void ecp_tm_sleep_ms(ecp_cts_t msec) {
+ eos_time_sleep(msec);
+}
+
+void ecp_tm_timer_set(ecp_cts_t next) {
+ uint32_t _next = eos_timer_get(EOS_TIMER_ETYPE_ECP);
+ if ((_next == EOS_TIMER_NONE) || (next < _next)) eos_timer_set(next, EOS_TIMER_ETYPE_ECP);
+}
diff --git a/ecp/src/platform/fe310/transport.c b/ecp/src/platform/fe310/transport.c
new file mode 100644
index 0000000..777a956
--- /dev/null
+++ b/ecp/src/platform/fe310/transport.c
@@ -0,0 +1,116 @@
+#include <stdlib.h>
+
+#include <core.h>
+#include <tr.h>
+
+#include <eos/eos.h>
+#include <eos/net.h>
+
+static unsigned char _flags = 0;
+
+ECPSocket *_ecp_tr_sock = NULL;
+
+static void packet_handler(unsigned char type, unsigned char *buffer, uint16_t len) {
+ ECPNetAddr addr;
+
+ ECP2Buffer bufs;
+ ECPBuffer packet;
+ ECPBuffer payload;
+ unsigned char pld_buf[ECP_MAX_PLD];
+
+ bufs.packet = &packet;
+ bufs.payload = &payload;
+
+ packet.buffer = buffer+EOS_SOCK_SIZE_UDP_HDR;
+ packet.size = ECP_MAX_PKT;
+ payload.buffer = pld_buf;
+ payload.size = ECP_MAX_PLD;
+
+ if ((buffer == NULL) || (len < EOS_SOCK_SIZE_UDP_HDR)) {
+ eos_net_free(buffer, 0);
+ return;
+ }
+
+ eos_sock_getfrom(buffer, &addr);
+ ssize_t rv = ecp_pkt_handle(_ecp_tr_sock, &addr, NULL, &bufs, len-EOS_SOCK_SIZE_UDP_HDR);
+#ifdef ECP_DEBUG
+ if (rv < 0) {
+ char b[16];
+ puts("ERR:");
+ puts(itoa(rv, b, 10));
+ puts("\n");
+ }
+#endif
+ if (bufs.packet->buffer) eos_net_free(buffer, 0);
+ eos_net_release();
+}
+
+int ecp_tr_init(ECPContext *ctx) {
+ return ECP_OK;
+}
+
+int ecp_tr_addr_eq(ECPNetAddr *addr1, ECPNetAddr *addr2) {
+ if (addr1->port != addr2->port) return 0;
+ if (memcmp(addr1->host, addr2->host, sizeof(addr1->host)) != 0) return 0;
+ return 1;
+}
+
+int ecp_tr_addr_set(ECPNetAddr *addr, void *addr_s) {
+ return ECP_ERR;
+}
+
+int ecp_tr_open(ECPSocket *sock, void *addr_s) {
+ sock->sock = eos_sock_open_udp(packet_handler);
+ if (sock->sock < 0) {
+ sock->sock = 0;
+ return ECP_ERR_SEND;
+ }
+ _ecp_tr_sock = sock;
+ return ECP_OK;
+}
+
+void ecp_tr_close(ECPSocket *sock) {
+ eos_sock_close(sock->sock);
+ _ecp_tr_sock = NULL;
+}
+
+ssize_t ecp_tr_send(ECPSocket *sock, ECPBuffer *packet, size_t msg_size, ECPNetAddr *addr, unsigned char flags) {
+ unsigned char *buf = NULL;
+ int rv;
+
+ flags |= _flags;
+ if (packet && packet->buffer) {
+ if (flags & ECP_SEND_FLAG_REPLY) {
+ buf = packet->buffer-EOS_SOCK_SIZE_UDP_HDR;
+ packet->buffer = NULL;
+ } else {
+ buf = eos_net_alloc();
+ memcpy(buf+EOS_SOCK_SIZE_UDP_HDR, packet->buffer, msg_size);
+ }
+ }
+ if (buf == NULL) return ECP_ERR;
+ rv = eos_sock_sendto(sock->sock, buf, msg_size+EOS_SOCK_SIZE_UDP_HDR, flags & ECP_SEND_FLAG_MORE, addr);
+ if (rv) return ECP_ERR_SEND;
+ return msg_size;
+}
+
+ssize_t ecp_tr_recv(ECPSocket *sock, ECPBuffer *packet, ECPNetAddr *addr, int timeout) {
+ return ECP_ERR;
+}
+
+void ecp_tr_release(ECPBuffer *packet, unsigned char more) {
+ if (packet && packet->buffer) {
+ eos_net_free(packet->buffer-EOS_SOCK_SIZE_UDP_HDR, more);
+ packet->buffer = NULL;
+ } else if (!more) {
+ eos_net_release();
+ }
+}
+
+void ecp_tr_flag_set(unsigned char flags) {
+ _flags |= flags;
+}
+
+void ecp_tr_flag_clear(unsigned char flags) {
+ _flags &= ~flags;
+}
diff --git a/ecp/src/platform/fe310/transport.h b/ecp/src/platform/fe310/transport.h
new file mode 100644
index 0000000..47ad482
--- /dev/null
+++ b/ecp/src/platform/fe310/transport.h
@@ -0,0 +1,7 @@
+#include <eos/sock.h>
+
+#define ECP_IPv4_ADDR_SIZE 4
+
+typedef EOSNetAddr ECPNetAddr;
+typedef int ECPNetSock;
+
diff --git a/ecp/src/platform/posix/Makefile b/ecp/src/platform/posix/Makefile
new file mode 100644
index 0000000..1a3502a
--- /dev/null
+++ b/ecp/src/platform/posix/Makefile
@@ -0,0 +1,19 @@
+include ../common.mk
+
+obj_tr = transport.o
+obj_tm = time.o
+
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c $<
+
+all: libecptr.a libecptm.a
+
+libecptr.a: $(obj_tr)
+ $(AR) rcs libecptr.a $(obj_tr)
+
+libecptm.a: $(obj_tm)
+ $(AR) rcs libecptm.a $(obj_tm)
+
+clean:
+ rm -f *.o *.a
diff --git a/ecp/src/platform/posix/platform.mk b/ecp/src/platform/posix/platform.mk
new file mode 100644
index 0000000..0370c58
--- /dev/null
+++ b/ecp/src/platform/posix/platform.mk
@@ -0,0 +1,2 @@
+CFLAGS += -O3 -DECP_WITH_PTHREAD=1 -DECP_WITH_HTABLE=1 -DECP_WITH_RBUF=1 -DECP_WITH_MSGQ=1 -DECP_WITH_VCONN=1 -DECP_WITH_DIRSRV -DECP_DEBUG=1
+LDFLAGS += -lm -pthread
diff --git a/ecp/src/platform/posix/platform_obj.mk b/ecp/src/platform/posix/platform_obj.mk
new file mode 100644
index 0000000..6ca3b8d
--- /dev/null
+++ b/ecp/src/platform/posix/platform_obj.mk
@@ -0,0 +1,2 @@
+obj += rbuf.o rbuf_send.o rbuf_recv.o msgq.o
+subdirs += htable vconn
diff --git a/ecp/src/platform/posix/time.c b/ecp/src/platform/posix/time.c
new file mode 100644
index 0000000..111e598
--- /dev/null
+++ b/ecp/src/platform/posix/time.c
@@ -0,0 +1,24 @@
+#include <unistd.h>
+#include <sys/time.h>
+
+#include <core.h>
+#include <tm.h>
+
+int ecp_tm_init(ECPContext *ctx) {
+ return ECP_OK;
+}
+
+ecp_cts_t ecp_tm_abstime_ms(ecp_cts_t msec) {
+ struct timeval tv;
+ ecp_cts_t ms_now;
+
+ gettimeofday(&tv, NULL);
+ ms_now = tv.tv_sec * 1000 + tv.tv_usec / 1000;
+ return ms_now + msec;
+}
+
+void ecp_tm_sleep_ms(ecp_cts_t msec) {
+ usleep(msec*1000);
+}
+
+void ecp_tm_timer_set(ecp_cts_t next) {} \ No newline at end of file
diff --git a/ecp/src/platform/posix/transport.c b/ecp/src/platform/posix/transport.c
new file mode 100644
index 0000000..2032ce2
--- /dev/null
+++ b/ecp/src/platform/posix/transport.c
@@ -0,0 +1,113 @@
+#include <stdlib.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <poll.h>
+
+#include <core.h>
+#include <tr.h>
+
+#define ADDR_S_MAX 32
+
+int ecp_tr_init(ECPContext *ctx) {
+ return ECP_OK;
+}
+
+int ecp_tr_addr_eq(ECPNetAddr *addr1, ECPNetAddr *addr2) {
+ if (addr1->port != addr2->port) return 0;
+ if (memcmp(addr1->host, addr2->host, sizeof(addr1->host)) != 0) return 0;
+ return 1;
+}
+
+int ecp_tr_addr_set(ECPNetAddr *addr, void *addr_s) {
+ int rv;
+ char addr_c[ADDR_S_MAX];
+ char *colon = NULL;
+ char *endptr = NULL;
+ uint16_t hport;
+
+ memset(addr_c, 0, sizeof(addr_c));
+ strncpy(addr_c, addr_s, ADDR_S_MAX-1);
+ colon = strchr(addr_c, ':');
+ if (colon == NULL) return -1;
+ *colon = '\0';
+ colon++;
+ if (*colon == '\0') return -1;
+ rv = inet_pton(AF_INET, addr_c, addr->host);
+ if (rv != 1) return -1;
+ hport = strtol(colon, &endptr, 10);
+ if (*endptr != '\0') return -1;
+ addr->port = htons(hport);
+
+ return 0;
+}
+
+int ecp_tr_open(ECPSocket *sock, void *addr_s) {
+ struct sockaddr_in _myaddr;
+
+ memset((char *)&_myaddr, 0, sizeof(_myaddr));
+ _myaddr.sin_family = AF_INET;
+ if (addr_s) {
+ ECPNetAddr addr;
+ int rv = ecp_tr_addr_set(&addr, addr_s);
+ if (rv) return rv;
+
+ memcpy((void *)&_myaddr.sin_addr, addr.host, sizeof(addr.host));
+ _myaddr.sin_port = addr.port;
+ } else {
+ _myaddr.sin_addr.s_addr = htonl(INADDR_ANY);
+ _myaddr.sin_port = htons(0);
+ }
+
+ sock->sock = socket(PF_INET, SOCK_DGRAM, 0);
+ if (sock->sock < 0) return sock->sock;
+
+ int rv = bind(sock->sock, (struct sockaddr *)&_myaddr, sizeof(_myaddr));
+ if (rv < 0) {
+ close(sock->sock);
+ return rv;
+ }
+ return ECP_OK;
+}
+
+void ecp_tr_close(ECPSocket *sock) {
+ close(sock->sock);
+}
+
+ssize_t ecp_tr_send(ECPSocket *sock, ECPBuffer *packet, size_t msg_size, ECPNetAddr *addr, unsigned char flags) {
+ struct sockaddr_in servaddr;
+
+ memset((void *)&servaddr, 0, sizeof(servaddr));
+ servaddr.sin_family = AF_INET;
+ servaddr.sin_port = addr->port;
+ memcpy((void *)&servaddr.sin_addr, addr->host, sizeof(addr->host));
+ return sendto(sock->sock, packet->buffer, msg_size, 0, (struct sockaddr *)&servaddr, sizeof(servaddr));
+}
+
+ssize_t ecp_tr_recv(ECPSocket *sock, ECPBuffer *packet, ECPNetAddr *addr, int timeout) {
+ struct sockaddr_in servaddr;
+ socklen_t addrlen = sizeof(servaddr);
+ struct pollfd fds[] = {
+ {sock->sock, POLLIN, 0}
+ };
+
+ int rv = poll(fds, 1, timeout);
+ memset((void *)&servaddr, 0, sizeof(servaddr));
+ if (rv == 1) {
+ ssize_t recvlen = recvfrom(sock->sock, packet->buffer, packet->size, 0, (struct sockaddr *)&servaddr, &addrlen);
+ if (recvlen < 0) return recvlen;
+ if (recvlen < ECP_MIN_PKT) return ECP_ERR_RECV;
+
+ if (addr) {
+ addr->port = servaddr.sin_port;
+ memcpy(addr->host, (void *)&servaddr.sin_addr, sizeof(addr->host));
+ }
+ return recvlen;
+ }
+ return ECP_ERR_TIMEOUT;
+}
+
+void ecp_tr_release(ECPBuffer *packet, unsigned char more) {}
+void ecp_tr_flag_set(unsigned char flags) {}
+void ecp_tr_flag_clear(unsigned char flags) {}
+
diff --git a/ecp/src/platform/posix/transport.h b/ecp/src/platform/posix/transport.h
new file mode 100644
index 0000000..155bd9c
--- /dev/null
+++ b/ecp/src/platform/posix/transport.h
@@ -0,0 +1,7 @@
+#define ECP_IPv4_ADDR_SIZE 4
+
+typedef int ECPNetSock;
+typedef struct ECPNetAddr {
+ unsigned char host[ECP_IPv4_ADDR_SIZE];
+ uint16_t port;
+} ECPNetAddr;