Build Status

A C library for the SAM v3 API.

Development Status

Maintained by idk, PRs are accepted on I2P gitlab/I2P gitlab, and on github at the official mirror repository: i2p/libsam3.


Copy the two files from one of the following locations into your codebase:

See examples/ for how to use various parts of the API.

Cross-Compiling for Windows from debian:

Set your cross-compiler up:

export CC=x86_64-w64-mingw32-gcc
export CFLAGS='-Wall -O2 '
export LDFLAGS='-lmingw32 -lws2_32 -lwsock32 -mwindows'

and run make build. Only libsam3 is available for Windows, libsam3a will be made available at a later date. `


When building for Windows remember to set the flags to link to the Winsock and Windows libraries.

-lmingw32 -lws2_32 -lwsock32 -mwindows

This may apply when cross-compiling or compiling from Windows with mingw.

Cool Projects using libsam3

Are you using libsam3 to provide an a cool I2P based feature to your project? Let us know about it(and how it uses libsam3) and we’ll think about adding it here*!

  1. Retroshare

*Projects which are listed here must be actively maintained. Those which intentionally violate the law or the rights of a person or persons directly won’t be considered. Neither will obvious trolling. The maintainer will make the final decision.

git repository: ./libsam3

Git Summary

 project  : libsam3
 repo age : vor 9 Jahren
 active   : 23 days
 commits  : 87
 files    : 29
 authors  : 
ebf7d0b 2020-12-13 Merge pull request #16 from i2p/generateKeys
b410da5 2020-12-13 add new examples/tests
1b7b8cf 2020-12-13 add new examples/tests
9ca783a 2020-12-13 fix public key out put in generateKeys
8623304 2020-11-24 FORWARD is different from CONNECT and ACCEPT (#14)
3f14a30 2020-11-24 clang-fmt
ce0d1bf 2020-11-24 FORWARD is different from CONNECT and ACCEPT
749519a 2020-11-24 Merge pull request #13 from i2p/remember-c
a04bb55 2020-11-24 don't check for a correct reply
4bcaa17 2020-11-24 Merge pull request #12 from i2p/remember-c
ca20286 2020-11-24 do the checkIsSilent better
0aebf5a 2020-11-23 Merge pull request #11 from i2p/remember-c
baf1b3e 2020-11-23 clang-fmt
e6b8f5e 2020-11-23 No, it needs to me a regular array not a string literal
b324eb1 2020-11-23 add examples to test silent sessions
610e6c1 2020-11-23 Fix initialization of 'silent' *char
03ccfe2 2020-11-20 Merge pull request #9 from i2p/windows-libsam3
2071927 2020-11-20 One last fix for the ssize_t define on Unixes
f452e27 2020-11-20 Add some notes about the linker and our library users to the
92a33c8 2020-11-20 Adjust how we define SOCK_CLOEXEC and SOCK_NONBLOCK on Windows
4bf14d3 2020-11-20 Make libsam3a compile on Windows, but seek clarity about if this is the correct approach tomorrow
7f8e2b1 2020-11-18 fmt, add cross-compilind docs
f1a0559 2020-11-18 fmt, add cross-compilind docs
af7803c 2020-11-18 define ssize_t on Windows ourselves
e37c273 2020-11-18 define ssize_t on Windows ourselves
c635aa4 2020-11-18 define ssize_t on Windows ourselves
49286ea 2020-11-18 This should add Windows support to libsam3, but **NOT** libsam3a
4ed9b48 2020-11-18 Merge branch 'master' of
8386676 2020-11-17 Merge pull request #8 from eyedeekay/certfix
c5a0504 2020-11-17 Merge pull request #4 from eyedeekay/certfix
d88d7a1 2020-11-17 Merge pull request #3 from eyedeekay/silent
3c5e640 2020-11-17 Merge branch 'certfix' into silent
4436a53 2020-11-17 Merge pull request #2 from sehraf/certfix
796133e 2020-11-17 Add a function to start a silent session instead of a regular session
42ded33 2020-10-26 add SILENT=true to FORWARD
eee8271 2020-04-30 fix usage of SAM3_PRIVKEY_MIN_SIZE
f61607e 2019-02-13 Merge branch 'master' of into certfix
b3a700e 2019-02-13 Remove that clunky function and replace it
5aebfd9 2019-02-13 Use connection
9337547 2019-02-11 Enable destination signatures
cbcefc7 2019-02-11 corrected the sample code and made them easier to build
fbacbf4 2018-03-20 Merge pull request #6 from majestrate/master
c15b28b 2018-02-25 more docs
f155dfc 2018-02-25 docs
57617a7 2018-01-01 more docs
a8a9ac8 2017-12-28 update examples
4556c0a 2017-12-28 build libsam3.a
8d96153 2017-12-28 update tests
e20c99b 2017-12-28 do bounds checks and use size_t
9307c86 2017-12-28 fix compile warnings
13c0e34 2017-04-02 Update development status
03ce9c4 2016-12-18 Add Travis CI badge
6a32575 2016-12-18 Merge pull request #4 from i2p/tests
aa788a0 2016-12-18 Add Travis CI config
a7b99ba 2016-12-18 Add ignores
21a64fd 2016-12-18 Add Makefile
d2d5aca 2016-12-18 Turn B32 test into a tinytest
b1357f5 2016-12-18 Add tinytest source files
86f9ecf 2016-12-17 Usage info
4db0137 2016-12-17 Basic README
bb4332e 2016-12-17 Separate source from examples
b6e62bc 2015-07-06 Don't make STREAM FORWARD silent
8c7c164 2015-07-04 Add STREAM FORWARD support
71c866a 2012-12-06 libsam3a: added stream server sample
934e96c 2012-12-06 libsam3a: we can accept connections now
a61efe2 2012-12-06 added some samples for libsam3a
988a62b 2012-12-06 libsam3a: stream data sending
0130ae5 2012-12-06 libsam3a: sam3aStreamConnect()
c8ef5ba 2012-12-06 libsam3a: connections can't be created, but can be cleared ;-)
e6a56f4 2012-12-06 libsam3a: keypair generator and name resolver
b852102 2012-12-06 started libsam3a: non-blocking SAMv3 library based on callbacks
03a1d69 2012-12-06 libsam3 and samples: fixed some naming
df99668 2012-12-05 libsam3 samples moved to separate dir
b9b710d 2012-12-05 libsam3: fixed bug in sam3CloseConnection()
b2dc7fd 2012-12-05 samples adapted to the new interface
f50081c 2012-12-05 libsam3: one STREAM session now can be used for multiple connects/accepts
7d7cede 2012-12-05 added base32 encoder
88db757 2012-11-29 added 'name lookup' sample
97f72e0 2012-11-29 libsam3.h: removed unnecessary empty line
e6e2db0 2012-11-29 libsam3.h: added hrefs to session options documentation
608c0c2 2012-11-29 libsam3: cosmetic changes in error setting code
5df6898 2012-11-29 libsam3: samNameLookup()
81e0049 2012-11-29 added I2P-Bote contact address
e2e3b0e 2012-11-29 libsam3: channel nick generator seed changed a little
8cbd603 2012-11-29 samCreateSession() now allows to set session options thru 'params' arg
ca4bc8d 2012-11-27 libsam3 and samples: completely rewritten
b145f8b 2012-11-27 initial commit: tcp i/o, SAM requests and reply parsing```

## Files

.gitignore .travis.yml Makefile examples/libsam3 examples/sam3/Makefile examples/sam3/ examples/sam3/dgramc.c examples/sam3/dgrams.c examples/sam3/keys.c examples/sam3/ examples/sam3/namelookup.c examples/sam3/samtest.c examples/sam3/streamc.c examples/sam3/streamcs.c examples/sam3/streams.c examples/sam3/streamss.c examples/sam3a/test00.c examples/sam3a/test_sc.c examples/sam3a/test_ss.c src/ext/tinytest.c src/ext/tinytest.h src/ext/tinytest_macros.h src/libsam3/libsam3.c src/libsam3/libsam3.h src/libsam3a/libsam3a.c src/libsam3a/libsam3a.h test/libsam3/test_b32.c test/test.c

## Branches

## Tags

v0.31.00 v0.31.01

## Remotes

origin (fetch) origin (push) ```