Ensō 0.4.6
Software API reference
Loading...
Searching...
No Matches
socket.h File Reference

Socket-like API. More...

#include <arpa/inet.h>
#include <enso/consts.h>
#include <linux/types.h>

Go to the source code of this file.

Macros

#define MAX_NB_CORES   128
 
#define MAX_NB_SOCKETS   MAX_NB_FLOWS
 

Typedefs

typedef unsigned short enso::sa_family_t
 
typedef unsigned int enso::socklen_t
 

Functions

void enso::set_bdf (uint16_t bdf_)
 
int enso::socket (int domain, int type, int protocol, bool fallback) noexcept
 
int enso::bind (int sockfd, const struct sockaddr *addr, socklen_t addrlen) noexcept
 
uint64_t enso::get_socket_phys_addr (int sockfd)
 
void * enso::get_socket_virt_addr (int sockfd)
 
uint64_t enso::convert_buf_addr_to_phys (int sockfd, void *addr)
 
int enso::shutdown (int sockfd, int how) noexcept
 
ssize_t enso::recv (int sockfd, void *buf, size_t len, int flags)
 
ssize_t enso::recv_zc (int sockfd, void **buf, size_t len, int flags)
 
ssize_t enso::recv_select (int ref_sockfd, int *sockfd, void **buf, size_t len, int flags)
 
ssize_t enso::send (int sockfd, uint64_t phys_addr, size_t len, int flags)
 
uint32_t enso::get_completions (int ref_sockfd)
 
int enso::enable_device_timestamp (int ref_sockfd, uint8_t offset=kDefaultRttOffset)
 
int enso::disable_device_timestamp (int ref_sockfd)
 
int enso::enable_device_rate_limit (int ref_sockfd, uint16_t num, uint16_t den)
 
int enso::disable_device_rate_limit (int ref_sockfd)
 
int enso::enable_device_round_robin (int ref_sockfd)
 
int enso::disable_device_round_robin (int ref_sockfd)
 
void enso::free_enso_pipe (int sockfd, size_t len)
 
void enso::print_sock_stats (int sockfd)
 

Detailed Description

Socket-like API.

Deprecated:
Use the API defined in pipe.h instead.
Author
Hugo Sadok sadok.nosp@m.@cmu.nosp@m..edu

Definition in file socket.h.

Macro Definition Documentation

◆ MAX_NB_CORES

#define MAX_NB_CORES   128

Definition at line 53 of file socket.h.

◆ MAX_NB_SOCKETS

#define MAX_NB_SOCKETS   MAX_NB_FLOWS

Definition at line 54 of file socket.h.

Typedef Documentation

◆ sa_family_t

typedef unsigned short enso::sa_family_t

Definition at line 50 of file socket.h.

◆ socklen_t

typedef unsigned int enso::socklen_t

Definition at line 51 of file socket.h.

Function Documentation

◆ bind()

int enso::bind ( int  sockfd,
const struct sockaddr *  addr,
socklen_t  addrlen 
)
noexcept

Definition at line 93 of file socket.cpp.

◆ convert_buf_addr_to_phys()

uint64_t enso::convert_buf_addr_to_phys ( int  sockfd,
void *  addr 
)

Definition at line 126 of file socket.cpp.

◆ disable_device_rate_limit()

int enso::disable_device_rate_limit ( int  ref_sockfd)

Definition at line 219 of file socket.cpp.

◆ disable_device_round_robin()

int enso::disable_device_round_robin ( int  ref_sockfd)

Definition at line 233 of file socket.cpp.

◆ disable_device_timestamp()

int enso::disable_device_timestamp ( int  ref_sockfd)

Definition at line 204 of file socket.cpp.

◆ enable_device_rate_limit()

int enso::enable_device_rate_limit ( int  ref_sockfd,
uint16_t  num,
uint16_t  den 
)

Definition at line 211 of file socket.cpp.

◆ enable_device_round_robin()

int enso::enable_device_round_robin ( int  ref_sockfd)

Definition at line 226 of file socket.cpp.

◆ enable_device_timestamp()

int enso::enable_device_timestamp ( int  ref_sockfd,
uint8_t  offset = kDefaultRttOffset 
)

Definition at line 196 of file socket.cpp.

◆ free_enso_pipe()

void enso::free_enso_pipe ( int  sockfd,
size_t  len 
)

Definition at line 192 of file socket.cpp.

◆ get_completions()

uint32_t enso::get_completions ( int  ref_sockfd)

Definition at line 186 of file socket.cpp.

◆ get_socket_phys_addr()

uint64_t enso::get_socket_phys_addr ( int  sockfd)

Definition at line 112 of file socket.cpp.

◆ get_socket_virt_addr()

void * enso::get_socket_virt_addr ( int  sockfd)

Definition at line 119 of file socket.cpp.

◆ print_sock_stats()

void enso::print_sock_stats ( int  sockfd)

Definition at line 250 of file socket.cpp.

◆ recv()

ssize_t enso::recv ( int  sockfd,
void *  buf,
size_t  len,
int  flags 
)

Definition at line 130 of file socket.cpp.

◆ recv_select()

ssize_t enso::recv_select ( int  ref_sockfd,
int *  sockfd,
void **  buf,
size_t  len,
int  flags 
)

Definition at line 170 of file socket.cpp.

◆ recv_zc()

ssize_t enso::recv_zc ( int  sockfd,
void **  buf,
size_t  len,
int  flags 
)

Definition at line 156 of file socket.cpp.

◆ send()

ssize_t enso::send ( int  sockfd,
uint64_t  phys_addr,
size_t  len,
int  flags 
)

Definition at line 180 of file socket.cpp.

◆ set_bdf()

void enso::set_bdf ( uint16_t  bdf_)

Definition at line 61 of file socket.cpp.

◆ socket()

int enso::socket ( int  domain,
int  type,
int  protocol,
bool  fallback 
)
noexcept

Definition at line 63 of file socket.cpp.