twizzler_net/
rx_req.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use crate::{
    addr::{Ipv4Addr, NodeAddr, ServiceAddr},
    req::{CloseInfo, ConnectionId, PacketData},
};

#[derive(Clone, Copy, Debug)]
#[repr(C)]
pub struct Connection {
    addr: (NodeAddr, ServiceAddr),
    peer: (NodeAddr, ServiceAddr),
}

#[derive(Clone, Copy, Debug)]
#[repr(C)]
pub enum RxRequest {
    EchoReply(PacketData),
    RecvFromIpv4(Ipv4Addr, PacketData),
    Recv(ConnectionId, PacketData),
    CloseConnection(ConnectionId, CloseInfo),
    NewConnection(ConnectionId, ConnectionId, Connection),
    Close,
}

#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub enum RxCompletion {
    Nothing,
}