Classified ads
Classes | Enumerations | Functions
protocol.h File Reference
#include "../util/hash.h"
Include dependency graph for protocol.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SendQueueItem
 send-queue item. More...
 
struct  PublishItem
 Carrier for keeping state of item about to be published. More...
 

Enumerations

enum  ProtocolItemType {
  OwnNodeGreeting =1, NodeGreeting =2, ClassifiedAd =3, PrivateMessage =4,
  BinaryBlob =5, UserProfile =6, RequestForClassifiedAd =7, RequestForPrivateMessage =8,
  RequestForBinaryBlob =9, RequestForUserProfile =10, RandomNumbers =11, RequestForNodesAroundHash =12,
  UserProfilePublish =13, BinaryFilePublish =14, ClassifiedAdPublish =15, ClassifiedAd2NdAddr =16,
  RequestAdsClassified =17, PrivateMessagePublish =18, PrivateMessagesForProfile =19, UserProfileComment =20,
  ProfileCommentPublish =21, UserProfileCommentsForProfile =22, RequestForProfilePoll =23, RequestForProfileComment =24,
  RequestForSearchSend =25, RequestForVoiceCallStart =26, RequestForVoiceCallEnd =27, DbRecord =28,
  DbRecordPublish =29, RequestForDbRecord =30
}
 

Functions

static const unsigned char KProtocolVersion (1)
 
static const unsigned char KRandomNumbersPacket (100)
 
static const unsigned char KNodesAroundHash (101)
 
static const unsigned char KProfileAtHash (103)
 
static const unsigned char KBinaryFileAtHash (104)
 
static const unsigned char KClassifiedAdAtHash (109)
 
static const unsigned char KProfilePublish (102)
 
static const unsigned char KBinaryFilePublish (105)
 
static const unsigned char KBinaryFileSend (106)
 
static const unsigned char KClassifiedAdPublish (107)
 
static const unsigned char KProfileSend (108)
 
static const unsigned char KClassifiedAdSend (110)
 
static const unsigned char KAdsClassifiedAtHash (111)
 
static const unsigned char KListOfAdsClassifiedAtHash (112)
 
static const unsigned char KPrivMessagePublish (113)
 
static const unsigned char KPrivMessageSend (114)
 
static const unsigned char KPrivMessagesAtHash (115)
 
static const unsigned char KPrivMessagesForProfile (116)
 
static const unsigned char KProfileCommentPublish (117)
 
static const unsigned char KProfileCommentSend (118)
 
static const unsigned char KProfileCommentAtHash (119)
 
static const unsigned char KSingleProfileCommentAtHash (120)
 
static const unsigned char KSearchRequest (121)
 
static const unsigned char KSearchResults (122)
 
static const unsigned char KVoiceCallStart (123)
 
static const unsigned char KVoiceCallEnd (124)
 
static const unsigned char KRealtimeData (125)
 
static const unsigned char KDbRecordPublish (126)
 
static const unsigned char KDbRecordSend (127)
 
static const unsigned char KDbRecordSearch (128)
 
static const unsigned char KFutureUse4 (129)
 
static const unsigned char KFutureUse5 (130)
 
static const unsigned char KFutureUse6 (131)
 
static const unsigned char KRTDataAudioSubtype (1)
 
static const unsigned char KRTDataControlSubtype (2)
 
static const int KMaxOpenConnections (100)
 
static const int KNumberOfNodesToSendToEachPeer (300)
 
static const int KNumberOfClassifiedAdsToSendToEachPeer (300)
 
static const quint32 KMaxProtocolItemSize (1024 *1024 *2)
 
static const quint16 KBroadCastAdvertismentPort (23432)
 

Detailed Description

this file protocol.h defines constants that are passed between peers as protocol entries.

Possible messages are

Enumeration Type Documentation

◆ ProtocolItemType

this enum lists possible items that we send over socket from one node to another. These get serialized into bitstream whose values are #defined above.

Enumerator
OwnNodeGreeting 

normal node greeting but inside program special handling

NodeGreeting 

node connectivity details

ClassifiedAd 

normal public posting

PrivateMessage 

a message destined to owner of specific profile

BinaryBlob 

just data, relates to something, has SHA1

UserProfile 

user RSA key and possible other related data

RequestForClassifiedAd 

query for other nodes if there is anything about classified ads

RequestForPrivateMessage 

query for other nodes if there is any private msgs

RequestForBinaryBlob 

query for other nodes if there is specific binary avail

RequestForUserProfile 

query for other nodes if user has been in da hood

RandomNumbers 

explained later. this really contains 1 or more random numbers

RequestForNodesAroundHash 

request that other nodes use to retrieve node-refs around given hash

UserProfilePublish 

publish message is different from normal UserProfile

BinaryFilePublish 

publish binary blob is different from normal BinaryBlob

ClassifiedAdPublish 

publish CA is different from normal ad

ClassifiedAd2NdAddr 

publish of CA to group controller

RequestAdsClassified 

query for articles whose classification is known

PrivateMessagePublish 

local user is sending a privmsg

PrivateMessagesForProfile 

specifies a request to send messages destined to profile

UserProfileComment 

invididual profile comment to be sent

ProfileCommentPublish 

profile comment publish item type

UserProfileCommentsForProfile 

request to queue profile comments commenting given profile

RequestForProfilePoll 

UI request regarding profile update poll

RequestForProfileComment 

UI request regarding individual comment

RequestForSearchSend 

UI request about network search

RequestForVoiceCallStart 

node<->node audio control start

RequestForVoiceCallEnd 

node<->node audio control stop

DbRecord 

Record of distributed database

DbRecordPublish 

Record of distributed database via publish operation

RequestForDbRecord 

Query regarding distributed database records

Function Documentation

◆ KAdsClassifiedAtHash()

static const unsigned char KAdsClassifiedAtHash ( 111  )
static

Query about CAs whose classification matches the hash

◆ KBinaryFileAtHash()

static const unsigned char KBinaryFileAtHash ( 104  )
static

Message id for a binary file request

◆ KBinaryFilePublish()

static const unsigned char KBinaryFilePublish ( 105  )
static

Binary blob is published with this number

◆ KBinaryFileSend()

static const unsigned char KBinaryFileSend ( 106  )
static

Binary blob is sent (compare to publish) with this number

◆ KBroadCastAdvertismentPort()

static const quint16 KBroadCastAdvertismentPort ( 23432  )
static

 node may advertise itself in local ethernet segment with broadcast. the port where ads are sent is this

◆ KClassifiedAdAtHash()

static const unsigned char KClassifiedAdAtHash ( 109  )
static

Message id for CA request

◆ KClassifiedAdPublish()

static const unsigned char KClassifiedAdPublish ( 107  )
static

Classified ad is published with this number

◆ KClassifiedAdSend()

static const unsigned char KClassifiedAdSend ( 110  )
static

CA is sent (compare to publish) with this number

◆ KDbRecordPublish()

static const unsigned char KDbRecordPublish ( 126  )
static

Protocol PDU identifier for general-purpose db-record publish

◆ KDbRecordSearch()

static const unsigned char KDbRecordSearch ( 128  )
static

◆ KDbRecordSend()

static const unsigned char KDbRecordSend ( 127  )
static

◆ KFutureUse4()

static const unsigned char KFutureUse4 ( 129  )
static

Protocol constants for future use

◆ KFutureUse5()

static const unsigned char KFutureUse5 ( 130  )
static

◆ KFutureUse6()

static const unsigned char KFutureUse6 ( 131  )
static

◆ KListOfAdsClassifiedAtHash()

static const unsigned char KListOfAdsClassifiedAtHash ( 112  )
static

Reply to Query about CAs whose classification matches the hash

◆ KMaxOpenConnections()

static const int KMaxOpenConnections ( 100  )
static

How many open connections we wish to have open at same time

◆ KMaxProtocolItemSize()

static const quint32 KMaxProtocolItemSize ( 1024 *1024 *  2)
static

max size of single published item

◆ KNodesAroundHash()

static const unsigned char KNodesAroundHash ( 101  )
static

Message id for requesting nodes around hash

◆ KNumberOfClassifiedAdsToSendToEachPeer()

static const int KNumberOfClassifiedAdsToSendToEachPeer ( 300  )
static

how many classified ads to send to remote peer without the peer asking.

◆ KNumberOfNodesToSendToEachPeer()

static const int KNumberOfNodesToSendToEachPeer ( 300  )
static

how many noderefs to send automatically after peer has connected. Noderef with ipv4+ipv6 as compressed json is ~100bytes so 300 mean some 30 kilobytes -> can handle.

◆ KPrivMessagePublish()

static const unsigned char KPrivMessagePublish ( 113  )
static

user is publishing a new private message

◆ KPrivMessagesAtHash()

static const unsigned char KPrivMessagesAtHash ( 115  )
static

Request for private message having given hash

◆ KPrivMessageSend()

static const unsigned char KPrivMessageSend ( 114  )
static

node is sending a private message

◆ KPrivMessagesForProfile()

static const unsigned char KPrivMessagesForProfile ( 116  )
static

Request for private message destined so given profile

◆ KProfileAtHash()

static const unsigned char KProfileAtHash ( 103  )
static

Message id for a profile request

◆ KProfileCommentAtHash()

static const unsigned char KProfileCommentAtHash ( 119  )
static

sent as a request to send profile comments. This is not about sending individual comment but instead comments of a profile there is separate request for single comment

◆ KProfileCommentPublish()

static const unsigned char KProfileCommentPublish ( 117  )
static

user is publishing a new comment to profile

◆ KProfileCommentSend()

static const unsigned char KProfileCommentSend ( 118  )
static

node is sending a profile comment

◆ KProfilePublish()

static const unsigned char KProfilePublish ( 102  )
static

Profile is published with this number

◆ KProfileSend()

static const unsigned char KProfileSend ( 108  )
static

Operator profile is sent (compare to publish) with this number

◆ KProtocolVersion()

static const unsigned char KProtocolVersion ( )
static

node greeting msg identifier

◆ KRandomNumbersPacket()

static const unsigned char KRandomNumbersPacket ( 100  )
static

rnd number msg identifier

◆ KRealtimeData()

static const unsigned char KRealtimeData ( 125  )
static

This is used to send rt-data inside ssl socket. Typically RT data would belong to UDP packet but sometimes UDP won't work while TCP does. Use-case for this is voice call audio packets but there may be other types also ; the data anyway contains a sub-type, for instance for sending separate audio, chat messages or even moving pictures.

◆ KRTDataAudioSubtype()

static const unsigned char KRTDataAudioSubtype ( )
static

next thing is rt-data subtypes. First audio.

◆ KRTDataControlSubtype()

static const unsigned char KRTDataControlSubtype ( )
static

Call control real-time data packet subtype

◆ KSearchRequest()

static const unsigned char KSearchRequest ( 121  )
static

sent as a request to perform search

◆ KSearchResults()

static const unsigned char KSearchResults ( 122  )
static

sent as a response to KSearchRequest (if there were any results)

◆ KSingleProfileCommentAtHash()

static const unsigned char KSingleProfileCommentAtHash ( 120  )
static

sent as a request to send single profile comment.

◆ KVoiceCallEnd()

static const unsigned char KVoiceCallEnd ( 124  )
static

send as indication about closing of audio channel to operators node

◆ KVoiceCallStart()

static const unsigned char KVoiceCallStart ( 123  )
static

send as request to open audio channel to operators node