Ripples 1.0
High Performant Software Architecture For Transaction Processing
Loading...
Searching...
No Matches
conn.h File Reference
#include <stdint.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <time.h>
#include <uthash/uthash.h>
#include "query.h"
Include dependency graph for conn.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  conn_tcp_s
 
struct  conn_udp_s
 
struct  conn_s
 
struct  conn_fifo_queue_s
 

Macros

#define CONN_IS_UDP_LISTENER(conn)    conn->lc == 0 && conn->proto == 0
 
#define CONN_IS_TCP_LISTENER(conn)    conn->lc == 0 && conn->proto == 1
 
#define CONN_IS_TCP_CONN(conn)    conn->lc == 1 && conn->proto == 1
 

Typedefs

typedef enum listener_start_error_e listener_start_error_t
 
typedef enum conn_tcp_state_e conn_tcp_state_t
 
typedef struct conn_tcp_s conn_tcp_t
 
typedef struct conn_udp_s conn_udp_t
 
typedef struct conn_s conn_t
 
typedef struct conn_fifo_queue_s conn_fifo_queue_t
 

Enumerations

enum  listener_start_error_e {
  LISTENER_ERR_SOCKET = -1 , LISTENER_ERR_SOCKET_OPT_REUSEADDR = -2 , LISTENER_ERR_SOCKET_OPT_REUSEPORT = -3 , LISTENER_ERR_BIND = -4 ,
  LISTENER_ERR_LISTEN = -5 , LISTENER_ERR_SOCKET_OPT_IP_PKTINFO = -6 , LISTENER_ERR_SOCKET_OPT_IPV6_V6ONLY = -7 , LISTENER_ERR_SOCKET_OPT_IPV6_RECVPKTINFO = -8 ,
  LISTENER_ERR_SOCKET_OPT_RCVBUF = -9 , LISTENER_ERR_SOCKET_OPT_SNDBUF = -10
}
 
enum  conn_tcp_state_e {
  TCP_CONN_ST_ASSIGN_CONN_ID_ERR = 0 , TCP_CONN_ST_WAIT_FOR_QUERY , TCP_CONN_ST_WAIT_FOR_QUERY_DATA , TCP_CONN_ST_WAIT_FOR_WRITE ,
  TCP_CONN_ST_CLOSED_FOR_READ , TCP_CONN_ST_READ_ERR , TCP_CONN_ST_CLOSED_FOR_WRITE , TCP_CONN_ST_WRITE_ERR ,
  TCP_CONN_ST_QUERY_SIZE_TOOLARGE
}
 

Functions

void conn_fifo_enqueue_read (conn_fifo_queue_t *queue, conn_t *entry)
 
conn_tconn_fifo_dequeue_read (conn_fifo_queue_t *queue)
 
void conn_fifo_enqueue_write (conn_fifo_queue_t *queue, conn_t *entry)
 
conn_tconn_fifo_dequeue_write (conn_fifo_queue_t *queue)
 
void conn_fifo_enqueue_gen (conn_fifo_queue_t *queue, conn_t *conn)
 
conn_tconn_fifo_dequeue_gen (conn_fifo_queue_t *queue)
 
void conn_fifo_remove_from_read_queue (conn_fifo_queue_t *queue, conn_t *conn_rm)
 
void conn_fifo_remove_from_write_queue (conn_fifo_queue_t *queue, conn_t *conn_rm)
 
void conn_fifo_enqueue_release (conn_fifo_queue_t *queue, conn_t *conn)
 
conn_tconn_fifo_dequeue_release (conn_fifo_queue_t *queue)
 
void conn_tcp_release (conn_tcp_t *conn_tcp)
 
void conn_udp_release (conn_udp_t *conn_udp)
 
void conn_release (conn_t *conn)
 
void conn_udp_vectors_reset (conn_udp_t *conn_udp)
 
conn_udp_tconn_udp_new (config_t *cfg, int family)
 
conn_tconn_new_tcp (int fd, config_t *cfg, int ip_version, struct sockaddr_storage *client_ip, struct sockaddr_storage *local_ip)
 
conn_tconn_listener_provision (config_t *cfg, int family, int protocol, char *err_buf, size_t err_buf_len)
 
conn_tconn_lru_cache_get (conn_t **lru, uint64_t id)
 
bool conn_tcp_id_assign (uint64_t *id, conn_t **lru, uint64_t *base)
 
void conn_tcp_report_metrics (conn_tcp_t *conn_tcp, metrics_t *metrics)
 

Detailed Description

Author
Faruk Grozdanic

Copyright (c) 2025 Faruk Grozdanic

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.