Skip to content

Commit

Permalink
sdp: move pub functions up
Browse files Browse the repository at this point in the history
  • Loading branch information
melekes committed Sep 5, 2022
1 parent 6399627 commit a2ae49f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions transports/webrtc/src/sdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ use std::net::IpAddr;

use crate::fingerprint::Fingerprint;

pub(crate) fn render_server_session_description(
addr: SocketAddr,
fingerprint: &Fingerprint,
ufrag: &str,
) -> String {
render_description(SERVER_SESSION_DESCRIPTION, addr, fingerprint, ufrag)
}

pub(crate) fn render_client_session_description(
addr: SocketAddr,
fingerprint: &Fingerprint,
ufrag: &str,
) -> String {
render_description(CLIENT_SESSION_DESCRIPTION, addr, fingerprint, ufrag)
}

// An SDP message that constitutes the offer.
//
// Main RFC: <https://datatracker.ietf.org/doc/html/rfc8866>
Expand Down Expand Up @@ -189,22 +205,6 @@ struct DescriptionContext {
pub pwd: String,
}

pub(crate) fn render_server_session_description(
addr: SocketAddr,
fingerprint: &Fingerprint,
ufrag: &str,
) -> String {
render_description(SERVER_SESSION_DESCRIPTION, addr, fingerprint, ufrag)
}

pub(crate) fn render_client_session_description(
addr: SocketAddr,
fingerprint: &Fingerprint,
ufrag: &str,
) -> String {
render_description(CLIENT_SESSION_DESCRIPTION, addr, fingerprint, ufrag)
}

/// Renders a [`TinyTemplate`] description using the provided arguments.
fn render_description(
description: &str,
Expand Down

0 comments on commit a2ae49f

Please sign in to comment.