MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / CreateDeliveryStatusMsg

Function CreateDeliveryStatusMsg

libi2pd/I2NPProtocol.cpp:124–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 std::shared_ptr<I2NPMessage> CreateDeliveryStatusMsg (uint32_t msgID)
125 {
126 auto m = NewI2NPShortMessage ();
127 uint8_t * buf = m->GetPayload ();
128 if (msgID)
129 {
130 htobe32buf (buf + DELIVERY_STATUS_MSGID_OFFSET, msgID);
131 htobe64buf (buf + DELIVERY_STATUS_TIMESTAMP_OFFSET, i2p::util::GetMillisecondsSinceEpoch ());
132 }
133 else // for SSU establishment
134 {
135 RAND_bytes ((uint8_t *)&msgID, 4);
136 htobe32buf (buf + DELIVERY_STATUS_MSGID_OFFSET, msgID);
137 htobe64buf (buf + DELIVERY_STATUS_TIMESTAMP_OFFSET, i2p::context.GetNetID ());
138 }
139 m->len += DELIVERY_STATUS_SIZE;
140 m->FillI2NPMessageHeader (eI2NPDeliveryStatus);
141 return m;
142 }
143
144 std::shared_ptr<I2NPMessage> CreateRouterInfoDatabaseLookupMsg (const uint8_t * key, const uint8_t * from,
145 uint32_t replyTunnelID, bool exploratory, std::unordered_set<i2p::data::IdentHash> * excludedPeers)

Callers 2

Calls 7

NewI2NPShortMessageFunction · 0.85
htobe32bufFunction · 0.85
htobe64bufFunction · 0.85
GetNetIDMethod · 0.80
FillI2NPMessageHeaderMethod · 0.80
GetPayloadMethod · 0.45

Tested by

no test coverage detected