added SDLAN_FLAGS_HAS_V6 flag

This commit is contained in:
asxalex 2024-02-27 15:21:43 +08:00
parent 7c37dd1f9e
commit 76162852a3
2 changed files with 13 additions and 1 deletions

View File

@ -5,7 +5,7 @@ pub const FLAGS_BITS_MASK: u16 = 0xffe0;
// common头的flags里面的flag可以组合
pub const SDLAN_FLAGS_FROM_SN: u16 = 0x0020;
pub const SDLAN_FLAGS_SOCKET: u16 = 0x0040;
pub const SDLAN_FLAGS_OPTIONS: u16 = 0x0080;
pub const SDLAN_FLAGS_HAS_V6: u16 = 0x0080;
pub const IPV4_SIZE: u8 = 4;
pub const IPV6_SIZE: u8 = 16;

View File

@ -183,6 +183,18 @@ pub fn encode_packet_encrypted<T: serde::Serialize>(
Ok(result)
}
/*
pub fn encode_packet_packet_encrypt(
cmn: &Common,
pkt: &Packet<'_>,
header_pass: &[u8],
) -> Result<Vec<u8>> {
let data2 = aes_encrypt(header_pass, pkt.data)?;
pkt.data = &data2;
encode_packet_packet(cmn, pkt)
}
*/
pub fn encode_packet_packet(cmn: &Common, pkt: &Packet<'_>) -> Result<Vec<u8>> {
let hdr = cmn.encode();
let body = pkt.marshal()?;