|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "socket.h"#include "init/init.h"#include "ioforge/ioforge.h"#include "ioforge/ioforge_nic.h"#include "libk/serial.h"#include <str.h>#include "memory/slab.h"#include "ethernet.h"#include "arp.h"#include "icmp.h"#include "ipv4.h"#include "ip_type.h"#include "net/netbuff.h"#include "tcp.h"#include "netutils.h"#include "netdev.h"#include "type.h"Go to the source code of this file.
Macros | |
| #define | MYIP "192.168.100.80" |
Functions | |
| static int | socket_receive (socket_t *socket, void *buffer, size_t size) |
| static int | socket_set_sockopt (socket_t *socket, uint32_t level, uint32_t optname, const void *optval, uint32_t optlen) |
| static int | socket_bind (socket_t *socket, sockaddr_in_t *addr, uint32_t len) |
| INIT (Socket) | |
| void | vxSocket (sock_family_t family, sock_type_t type, uint16_t protocol, socket_t **socket) |
Variables | |
| static struct slab_cache * | socket_cache = 0 |
| static socket_ops_t * | socket_ops = 0 |
| #define MYIP "192.168.100.80" |
Definition at line 56 of file socket.c.
Referenced by socket_receive().
| INIT | ( | Socket | ) |
Definition at line 28 of file socket.c.
References socket_ops::bind, kalloc(), socket_ops::recv, socket_ops::set_sockopt, socket_bind(), socket_receive(), and socket_set_sockopt().
|
static |
Definition at line 58 of file socket.c.
References arp_reply(), buffer, pending_rx::data, ETHER_TYPE_ARP, ETHER_TYPE_IP, ethernet_header::ethertype, ethertype, handle_icmp(), handle_tcp(), ICMP_PROTOCOL, ioforge_clear_rx_queue(), ioforge_receive_pending_queue(), pending_rx::len, LOG2_INFO, memcopy(), MYIP, socket::netdev, netdev::nic, ipv4_header::protocol, arp_packet::sender_ip, size, SOCK_ERR_NODEV, ipv4_header::src_ip, ethernet_header::src_mac, arp_packet::target_ip, TCP_PROTOCOL, vxHtons(), vxInetAddr(), and vxInetNtoa().
Referenced by INIT().
|
static |
Definition at line 127 of file socket.c.
References lookup_netdev(), socket::netdev, SO_BINDTODEVICE, SOCK_ERR_NODEV, SOCK_ERR_NOTCONN, SOCK_OK, SOL_SOCKET, and UNUSED.
Referenced by INIT().
| void vxSocket | ( | sock_family_t | family, |
| sock_type_t | type, | ||
| uint16_t | protocol, | ||
| socket_t ** | socket ) |
Definition at line 35 of file socket.c.
References socket::family, LOG2_WARN, protocol, socket_cache, type, vxCreateSlabCache(), and vxSlabAlloc().
|
static |
Definition at line 19 of file socket.c.
Referenced by vxSocket().
|
static |