aboutsummaryrefslogtreecommitdiff
path: root/rtp/src/rtcp.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-11-19 03:25:57 +0100
committermetamuffin <metamuffin@disroot.org>2024-11-19 03:25:57 +0100
commitd40f5bc6ece18c8fa09013d2e47e500a9e333dcd (patch)
treea8f80e11968b0566db6f1f186bb49ddebfe1b483 /rtp/src/rtcp.rs
parentcbc111f90b5facc1f2a9dd79ced216279d6260af (diff)
downloadsip-rs-d40f5bc6ece18c8fa09013d2e47e500a9e333dcd.tar
sip-rs-d40f5bc6ece18c8fa09013d2e47e500a9e333dcd.tar.bz2
sip-rs-d40f5bc6ece18c8fa09013d2e47e500a9e333dcd.tar.zst
move files again
Diffstat (limited to 'rtp/src/rtcp.rs')
-rw-r--r--rtp/src/rtcp.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/rtp/src/rtcp.rs b/rtp/src/rtcp.rs
new file mode 100644
index 0000000..0ae8ea7
--- /dev/null
+++ b/rtp/src/rtcp.rs
@@ -0,0 +1,26 @@
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+ #[error("packet truncated")]
+ Truncated,
+}
+
+pub struct RtcpPacket<'a> {
+ a: &'a [u8],
+}
+
+pub enum RtcpPart {
+ SenderReport {},
+ ReceiverReport {},
+ SourceDescription {},
+ Bye {},
+ Application {},
+}
+
+impl<'a> RtcpPacket<'a> {
+ pub fn parse(packet: &'a [u8]) -> Result<RtcpPacket<'a>, Error> {
+ Ok(Self { a: packet })
+ }
+ pub fn write(&self, out: &mut Vec<u8>) {
+ out.extend(self.a);
+ }
+}