Networking code overview

From RetroShare
Jump to: navigation, search



(Click to view full resoluton)
Pqi overview.png

The base classes used throughout Retroshare/PQI.

  • pqi_data.h


  • PQItem : Base of all the streamed classes. inherited by PQFileItem, MsgItem, ChatItem, etc.
  • Person: Generic Identity of a Peer with Network addresses etc. inherited by "cert" which is associated with a Certificate.
  • PQInterface: Basic Exchange Interface.
  • NetInterface: High Level Connection Interface.
  • BinInterface: Basic Binary Streaming Interface.
  • NetBinInterface: standard binary network interface.
  • P3Interface: High-Level Interface for Retroshare.

Interface to OpenSSL / OpenPGP Encryption and Authentication.



  • cert: Key Class for handling your peers.
  • sslroot: Manages OpenSSL side of things, Saves/Loads/Authenticates certificates. Hashs/Signs/Verfies Data.

Streaming functionality.

  • streaming functions.
  • Implements a PQInterface, transforming the PQItem classes into binary Data Packets, and passing them into a BinInterface.
  • Generic packet tunnelling. This allows
  • other services to built on top of the base system.

OpenSSL Connection to a Peer

  • Implements a NetBinInterface using OpenSSL/XPGP. Enables TCP connections to retroshare Peers. This class is extended for UDP connections by pqissludp.
  • Opens a OpenSSL TCP socket to receive connections.

Classes to combine the low level interfaces:

  • - Combines a set of BinNetInterfaces together and associates them with a single 'Person/cert'. This allows several different methods to be used to communicate with a Peer. (one active at a time). At the moment these are: pqissl and pqissludp
  • - Generic Aggregrator of PQInterfaces (your Peers) into a single P3Interface for retroshare.
  • - Provides the P3Interface for retroshare.Extends pqihandler as a TunnelServer,

this allows extra services to be added. Uses pqipersons to communicate with Peers.

Services Added: Discovery / Proxies / Channels. pqiperson Connect Methods: pqissl / pqissludp

UDP OpenSSL and Proxy Connection System.

A combination of Proxy Tunnel Service to initiate connections,and a OpenSSL UDP system (uses TCP-On-UDP library). This is designed to enable firewalled peers to connect directly to each other. Requires a third peer to proxy the connections.

This system needs more testing.


Neighbour Discovery Service

Used to exchange the certificates and addresses of the friends of your friends. Collates information to determine the best address to connect to. Similistic Algorithm -> could be improved.


Channel Service

Exciting Planned 'channel distribution system'. Basic functionality is complete but still lots of work to finish it off.


Loopback Interfaces.

  • : Loopback PQInterface used for local searches etc.
  • : Loopback p3Interface used for testing.

Utility Functions

  • Generic Networking functions. (Platform independent)
  • Save a set of PQItem * with timestamps/cert ids.
  • BinInterface for Files or Mem. (used with pqiarchive)
  • Generic debug output routines. (pqioutput).
  • pqiindic.h Utility
  • Security fns (not used)


special version of retroshare that accepts connections from everyone - to allow increased retroshare connectivity. No Longer used.

Personal tools

External websites