Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose quiche_conn_retire_dcid(...) #1668

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions quiche/include/quiche.h
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,10 @@ uint64_t quiche_conn_new_scid(quiche_conn *conn,
const uint8_t *scid, size_t scid_len,
const uint8_t *reset_token, bool retire_if_needed);

// Requests the retirement of the destination Connection ID used by the
// host to reach its peer.
int quiche_conn_retire_dcid(quiche_conn *conn, uint64_t dcid_seq);

// Frees the connection object.
void quiche_conn_free(quiche_conn *conn);

Expand Down
10 changes: 10 additions & 0 deletions quiche/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,16 @@ pub extern fn quiche_conn_new_scid(
}
}

#[no_mangle]
pub extern fn quiche_conn_retire_dcid(
conn: &mut Connection, dcid_seq: u64,
) -> c_int {
match conn.retire_dcid(dcid_seq) {
Ok(_) => 0,
Err(e) => e.to_c() as c_int,
}
}

#[no_mangle]
pub extern fn quiche_conn_available_dcids(conn: &Connection) -> size_t {
conn.available_dcids() as size_t
Expand Down
Loading