Skip to content
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
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ ax-memory-set = { version = "0.6.10", path = "memory/memory_set" }
axpanic = { version = "0.1.0", path = "components/axpanic" }
ax-mm = { version = "0.5.18", path = "os/arceos/modules/axmm" }
ax-net = { version = "0.7.2", path = "net/ax-net" }
axnet = { version = "0.7.2", package = "ax-net", path = "net/ax-net" }
ax-page-table-entry = { version = "0.8.10", path = "memory/page_table_entry" }
ax-page-table-multiarch = { version = "0.8.12", path = "memory/page_table_multiarch" }
ax-percpu = { version = "0.4.13", path = "components/percpu/percpu" }
Expand Down
4 changes: 2 additions & 2 deletions net/ax-net/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- *(irq)* introduce shared IRQ framework ([#1065](https://github.com/rcore-os/tgoskits/pull/1065))
- *(axnet)* implement SO_TYPE, SO_PROTOCOL, SO_DOMAIN socket options ([#884](https://github.com/rcore-os/tgoskits/pull/884))
- *(ax-net)* implement SO_TYPE, SO_PROTOCOL, SO_DOMAIN socket options ([#884](https://github.com/rcore-os/tgoskits/pull/884))

### Fixed

Expand Down Expand Up @@ -68,7 +68,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- *(starry-kernel)* close CLI compatibility gaps ([#524](https://github.com/rcore-os/tgoskits/pull/524))
- UDP recv returns EAGAIN on unconnected socket, sendto dispatches loopback ([#529](https://github.com/rcore-os/tgoskits/pull/529))
- *(proc)* expose arp table for busybox arp ([#480](https://github.com/rcore-os/tgoskits/pull/480))
- *(axnet)* call poll_interfaces() after TCP send to wake epoll waiters ([#485](https://github.com/rcore-os/tgoskits/pull/485))
- *(ax-net)* call poll_interfaces() after TCP send to wake epoll waiters ([#485](https://github.com/rcore-os/tgoskits/pull/485))
- *(arceos)* adjust dynamic platform and network integration
- implement close_all_fds function and enhance pipe and syscall handling ([#305](https://github.com/rcore-os/tgoskits/pull/305))

Expand Down
2 changes: 1 addition & 1 deletion os/StarryOS/kernel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- *(starry-task)* implement sys_getcpu ([#924](https://github.com/rcore-os/tgoskits/pull/924))
- *(starry-kernel)* add inotifywait support ([#894](https://github.com/rcore-os/tgoskits/pull/894))
- *(starry)* add userspace test for prlimit64 syscall ([#801](https://github.com/rcore-os/tgoskits/pull/801))
- *(axnet)* implement SO_TYPE, SO_PROTOCOL, SO_DOMAIN socket options ([#884](https://github.com/rcore-os/tgoskits/pull/884))
- *(ax-net)* implement SO_TYPE, SO_PROTOCOL, SO_DOMAIN socket options ([#884](https://github.com/rcore-os/tgoskits/pull/884))
- *(starry-kernel)* implement xattr syscall stubs for rsext4 ([#882](https://github.com/rcore-os/tgoskits/pull/882))
- *(starry-kernel)* add /proc/self/statm and /proc/loadavg, add procps test ([#853](https://github.com/rcore-os/tgoskits/pull/853))
- *(starry)* expose dumpable in procfs status and complete uid/gid tests ([#757](https://github.com/rcore-os/tgoskits/pull/757))
Expand Down
2 changes: 1 addition & 1 deletion os/StarryOS/kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ax-input = { workspace = true, optional = true }
ax-lazyinit.workspace = true
ax-log.workspace = true
ax-mm.workspace = true
axnet = { workspace = true }
ax-net = { workspace = true }
ax-driver = { workspace = true, features = ["usb"] }
axklib = { workspace = true, optional = true }
axplat-dyn = { workspace = true, optional = true }
Expand Down
10 changes: 5 additions & 5 deletions os/StarryOS/kernel/src/file/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use core::{
};

use ax_errno::{AxError, AxResult};
use axnet::{
use ax_net::{
RecvOptions, SendOptions, Socket as SocketInner, SocketOps,
options::{Configurable, GetSocketOption, SetSocketOption},
};
Expand All @@ -31,7 +31,7 @@ use crate::{
};

/// Real eth0 MAC address. Uses the QEMU default; TODO: query
/// `EthernetDriver::mac_address()` from axnet at init time once the API is
/// `EthernetDriver::mac_address()` from ax_net at init time once the API is
/// exposed, then replace this with a `static` or `LazyLock`.
pub const ETH0_REAL_MAC: [u8; 6] = [0x02, 0x00, 0x00, 0x00, 0x00, 0x01];

Expand Down Expand Up @@ -82,8 +82,8 @@ enum NetInterface {
Loopback,
}

fn eth0_ipv4_config() -> AxResult<axnet::Ipv4InterfaceConfig> {
axnet::eth0_ipv4_config().ok_or(AxError::NoSuchDevice)
fn eth0_ipv4_config() -> AxResult<ax_net::Ipv4InterfaceConfig> {
ax_net::eth0_ipv4_config().ok_or(AxError::NoSuchDevice)
}

fn eth0_ipv4_addr() -> AxResult<[u8; 4]> {
Expand All @@ -97,7 +97,7 @@ fn ipv4_netmask(prefix_len: u8) -> [u8; 4] {
(!0u32 << (32 - prefix_len)).to_be_bytes()
}

fn ipv4_broadcast(config: axnet::Ipv4InterfaceConfig) -> [u8; 4] {
fn ipv4_broadcast(config: ax_net::Ipv4InterfaceConfig) -> [u8; 4] {
let ip = u32::from_be_bytes(config.address.address().octets());
let mask = u32::from_be_bytes(ipv4_netmask(config.address.prefix_len()));
(ip | !mask).to_be_bytes()
Expand Down
2 changes: 1 addition & 1 deletion os/StarryOS/kernel/src/file/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fn build_arp_reply(request: &[u8]) -> Option<PacketFrame> {
}

fn is_modeled_peer_ipv4(ip: [u8; 4]) -> bool {
axnet::eth0_ipv4_config()
ax_net::eth0_ipv4_config()
.and_then(|config| config.gateway)
.is_some_and(|gateway| gateway.octets() == ip)
}
Expand Down
2 changes: 1 addition & 1 deletion os/StarryOS/kernel/src/pseudofs/dev/log.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use core::fmt;

use ax_errno::LinuxResult;
use axnet::{
use ax_net::{
RecvOptions, SocketAddrEx, SocketOps,
unix::{DgramTransport, UnixSocket, UnixSocketAddr},
};
Expand Down
2 changes: 1 addition & 1 deletion os/StarryOS/kernel/src/pseudofs/proc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ fn render_stat() -> String {
}

fn render_proc_net_arp() -> String {
let mut entries = axnet::arp_entries();
let mut entries = ax_net::arp_entries();
entries.sort_by(|a, b| {
a.device
.cmp(&b.device)
Expand Down
4 changes: 2 additions & 2 deletions os/StarryOS/kernel/src/syscall/net/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use core::{

use ax_errno::{AxError, AxResult, LinuxError};
#[cfg(feature = "vsock")]
use axnet::vsock::VsockAddr;
use axnet::{SocketAddrEx, unix::UnixSocketAddr};
use ax_net::vsock::VsockAddr;
use ax_net::{SocketAddrEx, unix::UnixSocketAddr};
use linux_raw_sys::{net::*, netlink::sockaddr_nl};

use crate::mm::{UserConstPtr, UserPtr};
Expand Down
4 changes: 2 additions & 2 deletions os/StarryOS/kernel/src/syscall/net/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use core::{net::Ipv4Addr, time::Duration};

use ax_errno::{AxError, AxResult};
use ax_io::prelude::*;
use ax_net::{CMsgData, RecvFlags, RecvOptions, SendFlags, SendOptions, SocketAddrEx, SocketOps};
use ax_runtime::hal::time::wall_time;
use axnet::{CMsgData, RecvFlags, RecvOptions, SendFlags, SendOptions, SocketAddrEx, SocketOps};
use linux_raw_sys::{
general::timespec,
net::{
Expand Down Expand Up @@ -162,7 +162,7 @@ fn recv_impl(

let Ok(socket) = Socket::from_fd(fd) else {
if let Ok(netlink) = NetlinkSocket::from_fd(fd) {
// Netlink is a FileLike, not an axnet Socket, so the flag-aware recv
// Netlink is a FileLike, not an ax_net Socket, so the flag-aware recv
// path below is unreachable for it. Honor the recv flags here:
// MSG_PEEK (do not consume the dump — getifaddrs/dnsmasq peek-then-
// read to size their buffer), MSG_TRUNC (full datagram length),
Expand Down
2 changes: 1 addition & 1 deletion os/StarryOS/kernel/src/syscall/net/name.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ax_errno::AxResult;
use axnet::SocketOps;
use ax_net::SocketOps;
use linux_raw_sys::net::{sockaddr, socklen_t};

use super::addr::{SocketAddrExt, socket_addr_ex_for_user_name};
Expand Down
6 changes: 3 additions & 3 deletions os/StarryOS/kernel/src/syscall/net/opt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ax_errno::{AxError, AxResult, LinuxError};
use axnet::options::{
use ax_net::options::{
Configurable, GetSocketOption, SetSocketOption, TcpInfo, TcpInfoOptions, TcpState,
};
use linux_raw_sys::net::{
Expand Down Expand Up @@ -113,7 +113,7 @@ fn write_tcp_info(socket: &Socket, optval: UserPtr<u8>, optlen: &mut socklen_t)

mod conv {
use ax_errno::{AxError, AxResult};
use axnet::options::UnixCredentials;
use ax_net::options::UnixCredentials;
use linux_raw_sys::{general::timeval, net::ucred};

use crate::time::TimeValueLike;
Expand Down Expand Up @@ -264,7 +264,7 @@ pub fn sys_getsockopt(
// SO_TYPE is handled at the kernel level because the socket type is
// known from the Socket enum variant, not from a per-protocol option.
{
use axnet::Socket as SocketInner;
use ax_net::Socket as SocketInner;
use linux_raw_sys::net::{SO_TYPE, SOCK_DGRAM, SOCK_RAW, SOCK_STREAM, SOL_SOCKET};

if level == SOL_SOCKET && optname == SO_TYPE {
Expand Down
8 changes: 4 additions & 4 deletions os/StarryOS/kernel/src/syscall/net/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ use alloc::boxed::Box;

use ax_errno::{AxError, AxResult, LinuxError};
use ax_fs::FS_CONTEXT;
use ax_task::current;
use axfs_ng_vfs::{MetadataUpdate, NodeType};
#[cfg(feature = "vsock")]
use axnet::vsock::{VsockSocket, VsockStreamTransport};
use axnet::{
use ax_net::vsock::{VsockSocket, VsockStreamTransport};
use ax_net::{
Shutdown, Socket as SocketInner, SocketAddrEx, SocketOps,
raw::{IpProtocol, IpVersion, RawSocket},
tcp::TcpSocket,
udp::UdpSocket,
unix::{DgramTransport, StreamTransport, UnixSocket, UnixSocketAddr},
};
use ax_task::current;
use axfs_ng_vfs::{MetadataUpdate, NodeType};
use linux_raw_sys::{
general::{O_CLOEXEC, O_NONBLOCK},
net::{
Expand Down