| /webrtc/mdns/src/message/ |
| H A D | packer.rs | 6 msg.extend_from_slice(field); in pack_bytes() 7 msg in pack_bytes() 12 if new_off > msg.len() { in unpack_bytes() 22 msg in pack_uint16() 31 (msg[off] as u16) << 8 | (msg[off + 1] as u16), in unpack_uint16() 46 msg in pack_uint32() 56 | (msg[off + 3] as u32); in unpack_uint32() 73 msg.push(l as u8); in pack_str() 75 Ok(msg) in pack_str() 79 if off >= msg.len() { in unpack_str() [all …]
|
| H A D | name.rs | 42 mut msg: Vec<u8>, in pack() 55 msg.push(0); in pack() 56 return Ok(msg); in pack() 94 return Ok(msg); in pack() 106 msg.push(0); in pack() 107 Ok(msg) in pack() 117 msg: &[u8], in unpack_compressed() 136 if curr_off >= msg.len() { in unpack_compressed() 139 let c = msg[curr_off]; in unpack_compressed() 202 if new_off >= msg.len() { in skip() [all …]
|
| H A D | builder.rs | 21 pub msg: Option<Vec<u8>>, field 151 let msg = self.msg.take(); in add_question() localVariable 152 if let Some(mut msg) = msg { in add_question() 153 msg = q.pack(msg, &mut self.compression, self.start)?; in add_question() 155 self.msg = Some(msg); in add_question() 181 if let Some(msg) = self.msg.take() { in add_resource() 182 let (mut msg, len_off) = r.header.pack(msg, &mut self.compression, self.start)?; in add_resource() 185 msg = body.pack(msg, &mut self.compression, self.start)?; in add_resource() 189 self.msg = Some(msg); in add_resource() 205 if let Some(mut msg) = self.msg.take() { in finish() [all …]
|
| H A D | header.rs | 122 msg = pack_uint16(msg, self.id); in pack() 123 msg = pack_uint16(msg, self.bits); in pack() 124 msg = pack_uint16(msg, self.questions); in pack() 125 msg = pack_uint16(msg, self.answers); in pack() 126 msg = pack_uint16(msg, self.authorities); in pack() 127 msg = pack_uint16(msg, self.additionals); in pack() 128 msg in pack() 132 let (id, off) = unpack_uint16(msg, off)?; in unpack() 135 let (bits, off) = unpack_uint16(msg, off)?; in unpack() 138 let (questions, off) = unpack_uint16(msg, off)?; in unpack() [all …]
|
| H A D | mod.rs | 103 pack_uint16(msg, *self as u16) in pack() 113 skip_uint16(msg, off) in skip() 147 pack_uint16(msg, self.0) in pack() 157 skip_uint16(msg, off) in skip() 272 self.header = p.start(msg)?; in unpack() 321 let mut msg = h.pack(b); in append_pack() localVariable 334 msg = question.pack(msg, &mut compression, compression_off)?; in append_pack() 337 msg = answer.pack(msg, &mut compression, compression_off)?; in append_pack() 340 msg = authority.pack(msg, &mut compression, compression_off)?; in append_pack() 343 msg = additional.pack(msg, &mut compression, compression_off)?; in append_pack() [all …]
|
| H A D | question.rs | 30 mut msg: Vec<u8>, in pack() 34 msg = self.name.pack(msg, compression, compression_off)?; in pack() 35 msg = self.typ.pack(msg); in pack() 36 Ok(self.class.pack(msg)) in pack()
|
| H A D | parser.rs | 22 pub msg: &'a [u8], field 36 msg, in start() 39 self.off = self.header.unpack(msg, 0)?; in start() 79 let off = hdr.unpack(self.msg, self.off, 0)?; in resource_header() 90 if new_off > self.msg.len() { in skip_resource() 111 off = typ.unpack(self.msg, off)?; in question() 113 off = class.unpack(self.msg, off)?; in question() 145 let mut off = Name::skip(self.msg, self.off)?; in skip_question() 146 off = DnsType::skip(self.msg, off)?; in skip_question() 147 off = DnsClass::skip(self.msg, off)?; in skip_question() [all …]
|
| /webrtc/dtls/src/handshake/ |
| H A D | mod.rs | 119 HandshakeMessage::Finished(msg) => msg.handshake_type(), in handshake_type() 125 HandshakeMessage::ClientHello(msg) => msg.size(), in size() 126 HandshakeMessage::ServerHello(msg) => msg.size(), in size() 127 HandshakeMessage::HelloVerifyRequest(msg) => msg.size(), in size() 128 HandshakeMessage::Certificate(msg) => msg.size(), in size() 129 HandshakeMessage::ServerKeyExchange(msg) => msg.size(), in size() 130 HandshakeMessage::CertificateRequest(msg) => msg.size(), in size() 131 HandshakeMessage::ServerHelloDone(msg) => msg.size(), in size() 132 HandshakeMessage::CertificateVerify(msg) => msg.size(), in size() 133 HandshakeMessage::ClientKeyExchange(msg) => msg.size(), in size() [all …]
|
| /webrtc/mdns/src/message/resource/ |
| H A D | soa.rs | 46 mut msg: Vec<u8>, in pack() 50 msg = self.ns.pack(msg, compression, compression_off)?; in pack() 51 msg = self.mbox.pack(msg, compression, compression_off)?; in pack() 52 msg = pack_uint32(msg, self.serial); in pack() 53 msg = pack_uint32(msg, self.refresh); in pack() 54 msg = pack_uint32(msg, self.retry); in pack() 55 msg = pack_uint32(msg, self.expire); in pack() 56 Ok(pack_uint32(msg, self.min_ttl)) in pack() 60 off = self.ns.unpack(msg, off)?; in unpack() 61 off = self.mbox.unpack(msg, off)?; in unpack() [all …]
|
| H A D | mod.rs | 64 msg: Vec<u8>, in pack() 76 msg = body.pack(msg, compression, compression_off)?; in pack() 79 Ok(msg) in pack() 151 msg = self.name.pack(msg, compression, compression_off)?; in pack() 152 msg = self.typ.pack(msg); in pack() 153 msg = self.class.pack(msg); in pack() 154 msg = pack_uint32(msg, self.ttl); in pack() 156 msg = pack_uint16(msg, self.length); in pack() 180 if msg.len() < pre_len || msg.len() > pre_len + u16::MAX as usize { in fix_len() 242 msg: Vec<u8>, in pack() [all …]
|
| H A D | srv.rs | 33 mut msg: Vec<u8>, in pack() 37 msg = pack_uint16(msg, self.priority); in pack() 38 msg = pack_uint16(msg, self.weight); in pack() 39 msg = pack_uint16(msg, self.port); in pack() 40 msg = self.target.pack(msg, &mut None, compression_off)?; in pack() 41 Ok(msg) in pack() 44 fn unpack(&mut self, msg: &[u8], off: usize, _length: usize) -> Result<usize> { in unpack() 45 let (priority, off) = unpack_uint16(msg, off)?; in unpack() 48 let (weight, off) = unpack_uint16(msg, off)?; in unpack() 51 let (port, off) = unpack_uint16(msg, off)?; in unpack() [all …]
|
| H A D | opt.rs | 49 mut msg: Vec<u8>, in pack() 54 msg = pack_uint16(msg, opt.code); in pack() 55 msg = pack_uint16(msg, opt.data.len() as u16); in pack() 56 msg = pack_bytes(msg, &opt.data); in pack() 58 Ok(msg) in pack() 61 fn unpack(&mut self, msg: &[u8], mut off: usize, length: usize) -> Result<usize> { in unpack() 65 let (code, new_off) = unpack_uint16(msg, off)?; in unpack() 68 let (l, new_off) = unpack_uint16(msg, off)?; in unpack() 75 if off + l as usize > msg.len() { in unpack() 78 opt.data.copy_from_slice(&msg[off..off + l as usize]); in unpack()
|
| H A D | mx.rs | 31 mut msg: Vec<u8>, in pack() 35 msg = pack_uint16(msg, self.pref); in pack() 36 msg = self.mx.pack(msg, compression, compression_off)?; in pack() 37 Ok(msg) in pack() 40 fn unpack(&mut self, msg: &[u8], off: usize, _length: usize) -> Result<usize> { in unpack() 41 let (pref, off) = unpack_uint16(msg, off)?; in unpack() 43 self.mx.unpack(msg, off) in unpack()
|
| H A D | txt.rs | 29 mut msg: Vec<u8>, in pack() 34 msg = pack_str(msg, s)? in pack() 36 Ok(msg) in pack() 39 fn unpack(&mut self, msg: &[u8], mut off: usize, length: usize) -> Result<usize> { in unpack() 43 let (t, new_off) = unpack_str(msg, off)?; in unpack()
|
| H A D | a.rs | 24 msg: Vec<u8>, in pack() 28 Ok(pack_bytes(msg, &self.a)) in pack() 31 fn unpack(&mut self, msg: &[u8], off: usize, _length: usize) -> Result<usize> { in unpack() 32 unpack_bytes(msg, off, &mut self.a) in unpack()
|
| H A D | ptr.rs | 25 msg: Vec<u8>, in pack() 29 self.ptr.pack(msg, compression, compression_off) in pack() 32 fn unpack(&mut self, msg: &[u8], off: usize, _length: usize) -> Result<usize> { in unpack() 33 self.ptr.unpack(msg, off) in unpack()
|
| H A D | aaaa.rs | 24 msg: Vec<u8>, in pack() 28 Ok(pack_bytes(msg, &self.aaaa)) in pack() 31 fn unpack(&mut self, msg: &[u8], off: usize, _length: usize) -> Result<usize> { in unpack() 32 unpack_bytes(msg, off, &mut self.aaaa) in unpack()
|
| H A D | cname.rs | 24 msg: Vec<u8>, in pack() 28 self.cname.pack(msg, compression, compression_off) in pack() 31 fn unpack(&mut self, msg: &[u8], off: usize, _length: usize) -> Result<usize> { in unpack() 32 self.cname.unpack(msg, off) in unpack()
|
| H A D | ns.rs | 25 msg: Vec<u8>, in pack() 29 self.ns.pack(msg, compression, compression_off) in pack() 32 fn unpack(&mut self, msg: &[u8], off: usize, _txt_length: usize) -> Result<usize> { in unpack() 33 self.ns.unpack(msg, off) in unpack()
|
| /webrtc/turn/src/client/ |
| H A D | mod.rs | 102 msg: &Message, in perform_transaction() 110 raw: msg.raw.clone(), in perform_transaction() 312 msg.decode()?; in handle_stun_message() 318 msg in handle_stun_message() 359 msg, in handle_stun_message() 438 let msg = { in send_binding_request_to() localVariable 451 msg in send_binding_request_to() 494 msg.build(&[ in allocate() 507 let res = tr_res.msg; in allocate() 520 msg.build(&[ in allocate() [all …]
|
| H A D | relay_conn.rs | 47 msg: &Message, in perform_transaction() 295 msg.build(&[ in send_to() 392 let msg = { in create_permissions() localVariable 410 msg.build(&setters)?; in create_permissions() 411 msg in create_permissions() 422 tr_res.msg in create_permissions() 468 msg.build(&[ in refresh_allocation() 492 tr_res.msg in refresh_allocation() 542 let (msg, turn_server_addr) = { in bind() 558 msg.build(&setters)?; in bind() [all …]
|
| /webrtc/dtls/examples/hub/src/ |
| H A D | lib.rs | 52 let msg = String::from_utf8(b[..n].to_vec())?; in read_loop() localVariable 79 async fn broadcast(&self, msg: &[u8]) { in broadcast() 82 if let Err(err) = conn.send(msg).await { in broadcast() 97 let mut msg = String::new(); in chat() localVariable 98 match reader.read_line(&mut msg) { in chat() 106 if msg.trim() == "exit" { in chat() 109 self.broadcast(msg.as_bytes()).await; in chat()
|
| /webrtc/stun/examples/ |
| H A D | stun_client.rs | 50 let mut msg = Message::new(); in main() localVariable 51 msg.build(&[Box::<TransactionId>::default(), Box::new(BINDING_REQUEST)])?; in main() 53 client.send(&msg, Some(Arc::new(handler_tx))).await?; in main() 56 let msg = event.event_body?; in main() localVariable 58 xor_addr.get_from(&msg)?; in main()
|
| /webrtc/turn/examples/ |
| H A D | turn_client_udp.rs | 148 let msg = match String::from_utf8(buf[..n].to_vec()) { in do_ping_test() localVariable 149 Ok(msg) => msg, in do_ping_test() 187 let msg = "12345678910".to_owned(); //format!("{:?}", tokio::time::Instant::now()); in do_ping_test() localVariable 188 println!("sending msg={} with size={}", msg, msg.as_bytes().len()); in do_ping_test() 189 pinger_conn_tx.send_to(msg.as_bytes(), relay_addr).await?; in do_ping_test()
|
| /webrtc/data/src/message/ |
| H A D | message_test.rs | 56 let msg = Message::DataChannelAck(DataChannelAck {}); in test_message_marshal_size() localVariable 58 let actual = msg.marshal_size(); in test_message_marshal_size() 70 let msg = Message::DataChannelOpen(DataChannelOpen { in test_message_marshal() localVariable 78 let actual = msg.marshal_to(&mut buf).unwrap(); in test_message_marshal()
|