MCPcopy Create free account

hub / github.com/Mimir-IM/mimir / functions

Functions338 in github.com/Mimir-IM/mimir

↓ 47 callersFunctionwrite_tlv
(buf: &mut Vec<u8>, tag: u8, value: &[u8])
src/tlv.rs:47
↓ 28 callersFunctionbuild_header
Build a 16-byte frame header. Public so connection.rs can build frames for the async write channel without going through async write helpers.
src/peer/protocol.rs:161
↓ 25 callersFunctionwrite_tlv_i64
(buf: &mut Vec<u8>, tag: u8, v: i64)
src/tlv.rs:57
↓ 23 callersMethodinto_error
(self, prefix: &str)
src/mediator/protocol.rs:169
↓ 22 callersFunctionparse_tlvs
Parse all TLV fields from `data` into a map of `tag -> value bytes`. If a tag appears more than once, only the last value is kept.
src/tlv.rs:77
↓ 21 callersMethodrequest
Send a command and wait for the matching response (up to `REQ_TIMEOUT`).
src/mediator/client.rs:428
↓ 20 callersMethodget
Retrieve a live client (returns None if not connected).
src/mediator/manager.rs:272
↓ 19 callersMethodget_or_create
Return the running client for `mediator_pubkey`, creating it if needed. Uses a per-key async mutex to prevent concurrent connection races: if two cal
src/mediator/manager.rs:61
↓ 18 callersFunctionto_key32
(v: &[u8])
src/mediator/mod.rs:274
↓ 16 callersFunctionread_blob_i32
Read a length-prefixed byte blob: [len: i32][bytes].
src/peer/protocol.rs:128
↓ 15 callersMethodget_i64
(&self, tag: u8)
src/tlv.rs:149
↓ 14 callersFunctionread_exact
Read exactly `n` bytes from the connection, blocking until done.
src/peer/protocol.rs:101
↓ 11 callersFunctiongenerate_shared_key
Generate a random 32-byte shared key for a new group chat.
src/crypto.rs:41
↓ 10 callersFunctionpubkey_of
Derive the 32-byte Ed25519 public key from a signing key.
src/crypto.rs:34
↓ 10 callersMethodsend_cmd
(&self, pubkey: &[u8; 32], cmd: OutgoingCmd)
src/peer/mod.rs:190
↓ 10 callersFunctionvec_to_key
(v: &[u8])
src/peer/mod.rs:833
↓ 9 callersMethodget_bytes
(&self, tag: u8)
src/tlv.rs:133
↓ 9 callersMethodopt_bytes
(&self, tag: u8)
src/tlv.rs:185
↓ 9 callersFunctionread_i64
Read a big-endian i64.
src/peer/protocol.rs:122
↓ 9 callersFunctionread_varint
Decode a varint from `data[offset..]`. Returns `(value, bytes_consumed)` or an error.
src/tlv.rs:26
↓ 9 callersFunctionwrite_tlv_u8
(buf: &mut Vec<u8>, tag: u8, v: u8)
src/tlv.rs:65
↓ 8 callersMethodon_call_status_changed
(&self, status: CallStatus, pubkey: Option<Vec<u8>>)
src/peer/mod.rs:105
↓ 8 callersFunctionrandom_sk
()
src/crypto.rs:230
↓ 8 callersFunctionread_header
(conn: &AsyncConn)
src/peer/protocol.rs:151
↓ 8 callersFunctionread_i32
Read a big-endian i32.
src/peer/protocol.rs:116
↓ 8 callersFunctionsign
Sign `message` with `key`. Returns a 64-byte Ed25519 signature.
src/crypto.rs:15
↓ 8 callersMethodsubscribe
Subscribe to push messages for `chat_id`. Returns the server's last message ID (use to fetch missed messages). Also fires `on_subscribed` so the calle
src/mediator/mod.rs:180
↓ 8 callersFunctionwrite_tlv_u64
(buf: &mut Vec<u8>, tag: u8, v: u64)
src/tlv.rs:53
↓ 7 callersMethodget_u64
(&self, tag: u8)
src/tlv.rs:139
↓ 7 callersFunctionto_key32
(v: &[u8])
src/files/mod.rs:256
↓ 6 callersFunctionparse_get_addrs_response
Parse a V2 GET_ADDRS response TLV payload: - TAG_COUNT: number of records - TAG_RECORD (repeated): nested TLV with TAG_NODE_PUB, TAG_SIGNATURE, TAG_PR
src/peer/resolver.rs:362
↓ 6 callersFunctionrandom_sk
()
src/peer/resolver.rs:480
↓ 6 callersFunctionwrite_tlv_u32
(buf: &mut Vec<u8>, tag: u8, v: u32)
src/tlv.rs:61
↓ 5 callersFunctionconsume_bytes
Consume and discard `count` bytes from the stream to keep it in sync.
src/peer/data_stream.rs:356
↓ 5 callersMethodis_disconnected
Returns `true` if this client has been marked as disconnected.
src/mediator/client.rs:699
↓ 5 callersMethodpublic_key
Our 32-byte Ed25519 public key (= Yggdrasil node identity).
src/peer/mod.rs:477
↓ 5 callersMethodpublish_info
Read the current active-peer state and publish it on the watch channel.
src/peer/ygg_selector.rs:159
↓ 5 callersFunctionwrite_tlv_str
(buf: &mut Vec<u8>, tag: u8, s: &str)
src/tlv.rs:69
↓ 5 callersFunctionwrite_varint
Append a variable-length unsigned integer to `buf`.
src/tlv.rs:13
↓ 4 callersMethodconnect
Dial `server_pubkey` on `port`, authenticate, and spawn background tasks.
src/files/client.rs:67
↓ 4 callersMethodget_cached
Return unexpired cached ephemeral keys for `permanent_pubkey`, sorted by priority (highest first).
src/peer/resolver.rs:129
↓ 4 callersFunctionkey32
Convert a byte slice to a 32-byte array, returning a descriptive error.
src/crypto.rs:216
↓ 4 callersFunctionmake_resolver
Spin up a minimal, unconnected Resolver (no peers, no trackers).
src/peer/resolver.rs:506
↓ 4 callersFunctionnow_ms
()
src/mediator/client.rs:706
↓ 3 callersFunctionbuild_get_addrs_payload
Build a valid V2 GET_ADDRS response TLV payload for the given peers.
src/peer/resolver.rs:485
↓ 3 callersFunctionbuild_request_header
Build just the 7-byte request header without copying the payload. Use together with a separate `conn.write(payload)` under the same write mutex to av
src/mediator/protocol.rs:140
↓ 3 callersFunctiondiscard
Discard `n` bytes from the connection (e.g., oversized avatar or unknown frame).
src/peer/protocol.rs:137
↓ 3 callersFunctionencrypt_message
Encrypt `plaintext` with `shared_key` using ChaCha20-Poly1305. Output format: `[nonce(12)][ciphertext][tag(16)]`
src/crypto.rs:50
↓ 3 callersFunctionencrypt_shared_key
Encrypt `shared_key` for `recipient_ed25519_pubkey` using ECIES. Algorithm: 1. Ephemeral X25519 keypair 2. Recipient Ed25519 pubkey → X25519 3. X2551
src/crypto.rs:91
↓ 3 callersMethodget_or_connect
(&self, server_pubkey: &[u8; 32])
src/files/mod.rs:156
↓ 3 callersFunctionnow_ms
()
src/files/client.rs:439
↓ 3 callersFunctionrandom_nonce
()
src/peer/resolver.rs:461
↓ 3 callersFunctionread_ok
Read an OK payload (header already consumed). Returns the message id.
src/peer/protocol.rs:268
↓ 3 callersMethodrecv_matching
Wait for a datagram from `expected_sender` whose payload starts with `[nonce:4][cmd:1]`. Returns the payload after those 5 bytes.
src/peer/resolver.rs:315
↓ 3 callersMethodrequest
(&self, cmd: u8, payload: &[u8])
src/files/client.rs:315
↓ 3 callersMethodrequest_timed
( &self, cmd: u8, payload: &[u8], timeout_dur: Duration, )
src/files/client.rs:319
↓ 3 callersFunctionverify
Verify that `signature` is a valid Ed25519 signature of `message` by the holder of `pubkey`.
src/crypto.rs:21
↓ 3 callersFunctionwrite_challenge
Write a Challenge or Challenge2.
src/peer/protocol.rs:237
↓ 3 callersMethodygg_node
(&self)
src/peer/mod.rs:793
↓ 2 callersMethodadd_peer
Add new peer to connect
src/peer/mod.rs:733
↓ 2 callersFunctionbuild_request_frame
Build a client-request frame: `[cmd:1][reqId:2 BE][payloadLen:4 BE][payload]`.
src/mediator/protocol.rs:127
↓ 2 callersFunctionchacha20_poly1305_decrypt
ChaCha20-Poly1305 (RFC 8439 AEAD) decryption. `ciphertext_with_tag` = `ciphertext || tag(16)`.
src/crypto.rs:169
↓ 2 callersFunctionchacha20_poly1305_encrypt
ChaCha20-Poly1305 (RFC 8439 AEAD) encryption. Returns `ciphertext || tag(16)`.
src/crypto.rs:161
↓ 2 callersFunctionchunk_nonce
Build the 12-byte nonce for chunk `index` (little-endian u96).
src/files/crypto.rs:20
↓ 2 callersFunctionencode_data_frame
Encode a single file transfer frame for the persistent data stream.
src/peer/data_stream.rs:31
↓ 2 callersFunctionencode_message
(msg: &P2pMessage)
src/peer/connection.rs:990
↓ 2 callersMethodget_nonce
(&self, pubkey: &[u8])
src/mediator/client.rs:412
↓ 2 callersFunctionhkdf_sha256
HKDF-SHA256 with no salt. Returns 32 bytes of output keying material.
src/crypto.rs:208
↓ 2 callersMethodmake_ctx
(&self)
src/peer/mod.rs:163
↓ 2 callersFunctionmessage_loop
Post-auth message loop. Runs until the connection dies or is explicitly closed.
src/peer/connection.rs:346
↓ 2 callersMethodon_disconnected
(&self, mediator_pubkey: Vec<u8>)
src/mediator/manager.rs:356
↓ 2 callersMethodon_file_receive_progress
(&self, pubkey: Vec<u8>, guid: i64, bytes_received: i64, total_bytes: i64)
src/peer/mod.rs:113
↓ 2 callersMethodon_message_received
(&self,pubkey: Vec<u8>, guid: i64, reply_to: i64, send_time: i64, edit_time: i64, msg_type: i32, data: Vec<u8>
src/peer/mod.rs:92
↓ 2 callersMethodon_tracker_announce
(&self, ok: bool, ttl: i32)
src/peer/mod.rs:133
↓ 2 callersMethodopt_i64
(&self, tag: u8)
src/tlv.rs:198
↓ 2 callersFunctionparse_tlvs_multi
Parse all TLV fields, collecting **all** values per tag (for repeated tags like `TAG_RECORD` in GET_ADDRS responses).
src/tlv.rs:99
↓ 2 callersFunctionparse_tracker
Parse `"<hex32>:<port>"` into a TrackerEntry.
src/peer/resolver.rs:453
↓ 2 callersMethodpick_tracker
Ping each tracker in order until one responds. Returns the index of the first responsive tracker, or `None` if all are unreachable. The ping primes
src/peer/resolver.rs:255
↓ 2 callersMethodquery_trackers
Query a responsive tracker for `permanent_pubkey`. Pings trackers to find a live one (priming the Yggdrasil route), then queries that single tracker.
src/peer/resolver.rs:148
↓ 2 callersFunctionrandom_bytes
(n: usize)
src/peer/connection.rs:1134
↓ 2 callersFunctionread_challenge
Read a Challenge or Challenge2 payload (header already consumed).
src/peer/protocol.rs:232
↓ 2 callersFunctionread_challenge_answer
Read a ChallengeAnswer or ChallengeAnswer2 (same format as Challenge).
src/peer/protocol.rs:252
↓ 2 callersFunctionread_exact
Read exactly `buf.len()` bytes from `conn`, looping over partial reads. Updates `activity` with the current timestamp after every successful read so t
src/mediator/protocol.rs:177
↓ 2 callersFunctionread_full
Read up to `buf.len()` bytes, looping until EOF or buffer full.
src/files/crypto.rs:91
↓ 2 callersFunctionread_response
Read one response frame from the connection. Returns an error on I/O failure or if the payload is unreasonably large. `activity` is updated after ever
src/mediator/protocol.rs:201
↓ 2 callersMethodregister_peer
(&self, key: [u8; 32], tx: mpsc::UnboundedSender<OutgoingCmd>)
src/peer/mod.rs:178
↓ 2 callersMethodremove_peer
Remove one of added peers
src/peer/mod.rs:740
↓ 2 callersMethodrequest_timed
Like `request()` but with a caller-specified timeout. Two-phase approach: - **Write phase**: each 64 KB chunk gets its own `CHUNK_TIMEOUT` deadline s
src/mediator/client.rs:440
↓ 2 callersFunctionrun_outbound
Drive an **outbound** connection to completion. Returns the outgoing-command sender on success.
src/peer/connection.rs:165
↓ 2 callersMethodruntime
(&self)
src/peer/mod.rs:797
↓ 2 callersMethodschedule_reconnect
Schedule a reconnection with exponential backoff.
src/mediator/manager.rs:184
↓ 2 callersFunctionsha256_file
Compute SHA-256 of a file using 64 KB streaming reads.
src/files/mod.rs:263
↓ 2 callersMethodsigning_key
(&self)
src/peer/mod.rs:801
↓ 2 callersMethodstop
Stop all mediator connections.
src/mediator/mod.rs:94
↓ 2 callersMethodsubscribe
Returns the server's last message ID for the chat (used to detect missed messages).
src/mediator/client.rs:278
↓ 2 callersMethodupdate_cost_from_node
(&self, node: &AsyncNode)
src/peer/ygg_selector.rs:172
↓ 2 callersFunctionwrite_challenge_answer
Write a ChallengeAnswer or ChallengeAnswer2.
src/peer/protocol.rs:257
↓ 2 callersFunctionwrite_ok
Write an OK with the given message id.
src/peer/protocol.rs:273
↓ 1 callersMethodannounce
Announce our current ephemeral address (= `our_pubkey`) to a tracker. Pings trackers to find a live one (priming the route), then announces to that s
src/peer/resolver.rs:192
↓ 1 callersFunctionauth_inbound
Inbound mutual auth handshake. Returns the peer's public key. Flow (inbound perspective): recv Hello → send Challenge → recv ChallengeAnswer → ver
src/peer/connection.rs:235
next →1–100 of 338, ranked by callers