File: interfacing.txt

package info (click to toggle)
entropybroker 2.9-9
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,700 kB
  • sloc: cpp: 14,387; sh: 934; makefile: 188; java: 148; perl: 12
file content (30 lines) | stat: -rw-r--r-- 1,284 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Writing your own server/client
------------------------------
- include <protocol.h>, <string>
- instantiate a 'protocol'-class:
  protocol *p = new protocol(char *host, int port, std::string username, std::string password, bool is_server, std::string type);
      host + port = entropy broker
      username + password = authentication against broker
      is_server = false for client, true for server
      type = name of server/client with any details added
- then to transmit data:
  int message_transmit_entropy_data(unsigned char *bytes, int n_bytes);
      bytes / n_bytes = where from, how many
      returns 0 for ok, -1 for error
- to retrieve data:
  int request_bytes(char *where_to, int n_bits, bool fail_on_no_bits);
      where_to = where to place the data
      n_bits = number of bits requested, broker may return less
      fail_on_no_bits = if the broker does not have data and this
                        is set to true, then this method won't
                        keep trying
- when linking, add the following files:
  error.cpp log.cpp kernel_prng_rw.cpp protocol.cpp utils.cpp
  server_utils.cpp auth.cpp my_pty.cpp kernel_prng_io.cpp
  also add the following libraries:
  -lcrypto -lrt -lz -lutil -rdynamic


Contact info
------------
mail@vanheusden.com