#![no_std]
#[macro_use]
extern crate log;
extern crate alloc;
cfg_if::cfg_if! {
if #[cfg(feature = "smoltcp")] {
mod smoltcp_impl;
use smoltcp_impl as net_impl;
}
}
use ax_driver::{AxDeviceContainer, prelude::*};
pub use self::net_impl::{
TcpSocket, UdpSocket, bench_receive, bench_transmit, dns_query, poll_interfaces,
};
pub fn init_network(mut net_devs: AxDeviceContainer<AxNetDevice>) {
info!("Initialize network subsystem...");
if let Some(dev) = net_devs.take_one() {
info!(" use NIC 0: {:?}", dev.device_name());
net_impl::init(dev);
} else {
warn!(" No network device found!");
}
}