maph 1.0.0 High-Performance Memory-Mapped Key-Value Database with O(1) Lookups

Loading...
Searching...
No Matches
Classes | Functions
udp.c File Reference
`#include "libusockets.h"`
`#include "internal/internal.h"`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
Include dependency graph for udp.c:

Go to the source code of this file.

## Classes
struct | us_internal_udp_t

## Functions
int | us_udp_packet_buffer_ecn (struct us_udp_packet_buffer_t *buf, int index)
int | us_udp_packet_buffer_local_ip (struct us_udp_packet_buffer_t *buf, int index, char *ip)
char * | us_udp_packet_buffer_peer (struct us_udp_packet_buffer_t *buf, int index)
char * | us_udp_packet_buffer_payload (struct us_udp_packet_buffer_t *buf, int index)
int | us_udp_packet_buffer_payload_length (struct us_udp_packet_buffer_t *buf, int index)
int | us_udp_socket_send (struct us_udp_socket_t *s, struct us_udp_packet_buffer_t *buf, int num)
int | us_udp_socket_receive (struct us_udp_socket_t *s, struct us_udp_packet_buffer_t *buf)
void | us_udp_buffer_set_packet_payload (struct us_udp_packet_buffer_t *send_buf, int index, int offset, void *payload, int length, void *peer_addr)
struct us_udp_packet_buffer_t * | us_create_udp_packet_buffer ()
int | us_udp_socket_bound_port (struct us_udp_socket_t *s)
void | internal_on_udp_read (struct us_udp_socket_t *s)
void * | us_udp_socket_user (struct us_udp_socket_t *s)
struct us_udp_socket_t * | us_create_udp_socket (struct us_loop_t *loop, struct us_udp_packet_buffer_t *buf, void(*data_cb)(struct us_udp_socket_t *, struct us_udp_packet_buffer_t *, int), void(*drain_cb)(struct us_udp_socket_t *), const char *host, unsigned short port, void *user)

## Function Documentation

## ◆ internal_on_udp_read()

void internal_on_udp_read | ( | struct us_udp_socket_t * | s | ) |

Definition at line 84 of file udp.c.

References us_internal_udp_t::data_cb, us_internal_udp_t::receive_buf, and us_udp_socket_receive().

Referenced by us_create_udp_socket().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_create_udp_packet_buffer()

struct us_udp_packet_buffer_t * us_create_udp_packet_buffer | ( |  | ) |

Definition at line 63 of file udp.c.

References bsd_create_udp_packet_buffer().

Referenced by us_create_udp_socket().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_create_udp_socket()

struct us_udp_socket_t * us_create_udp_socket | ( | struct us_loop_t * | loop,
|  | struct us_udp_packet_buffer_t * | buf,
|  | void(*)(struct us_udp_socket_t *, struct us_udp_packet_buffer_t *, int) | data_cb,
|  | void(*)(struct us_udp_socket_t *) | drain_cb,
|  | const char * | host,
|  | unsigned short | port,
|  | void * | user
| ) |  |

Definition at line 104 of file udp.c.

References bsd_addr_get_port(), bsd_create_udp_socket(), bsd_local_addr(), us_internal_callback_t::cb, us_internal_udp_t::cb, us_internal_udp_t::data_cb, us_internal_udp_t::drain_cb, us_poll_t::fd, internal_on_udp_read(), LIBUS_SOCKET_DESCRIPTOR, LIBUS_SOCKET_ERROR, LIBUS_SOCKET_READABLE, POLL_TYPE_CALLBACK, us_internal_udp_t::port, us_internal_udp_t::receive_buf, us_create_poll(), us_create_udp_packet_buffer(), us_poll_init(), us_poll_start(), and us_internal_udp_t::user.

Here is the call graph for this function:

## ◆ us_udp_buffer_set_packet_payload()

void us_udp_buffer_set_packet_payload | ( | struct us_udp_packet_buffer_t * | send_buf,
|  | int | index,
|  | int | offset,
|  | void * | payload,
|  | int | length,
|  | void * | peer_addr
| ) |  |

Definition at line 59 of file udp.c.

References bsd_udp_buffer_set_packet_payload().

Here is the call graph for this function:

## ◆ us_udp_packet_buffer_ecn()

int us_udp_packet_buffer_ecn | ( | struct us_udp_packet_buffer_t * | buf,
|  | int | index
| ) |  |

Definition at line 25 of file udp.c.

References bsd_udp_packet_buffer_ecn().

Here is the call graph for this function:

## ◆ us_udp_packet_buffer_local_ip()

int us_udp_packet_buffer_local_ip | ( | struct us_udp_packet_buffer_t * | buf,
|  | int | index,
|  | char * | ip
| ) |  |

Definition at line 29 of file udp.c.

References bsd_udp_packet_buffer_local_ip().

Here is the call graph for this function:

## ◆ us_udp_packet_buffer_payload()

char * us_udp_packet_buffer_payload | ( | struct us_udp_packet_buffer_t * | buf,
|  | int | index
| ) |  |

Definition at line 37 of file udp.c.

References bsd_udp_packet_buffer_payload().

Here is the call graph for this function:

## ◆ us_udp_packet_buffer_payload_length()

int us_udp_packet_buffer_payload_length | ( | struct us_udp_packet_buffer_t * | buf,
|  | int | index
| ) |  |

Definition at line 41 of file udp.c.

References bsd_udp_packet_buffer_payload_length().

Here is the call graph for this function:

## ◆ us_udp_packet_buffer_peer()

char * us_udp_packet_buffer_peer | ( | struct us_udp_packet_buffer_t * | buf,
|  | int | index
| ) |  |

Definition at line 33 of file udp.c.

References bsd_udp_packet_buffer_peer().

Here is the call graph for this function:

## ◆ us_udp_socket_bound_port()

int us_udp_socket_bound_port | ( | struct us_udp_socket_t * | s | ) |

Definition at line 79 of file udp.c.

## ◆ us_udp_socket_receive()

int us_udp_socket_receive | ( | struct us_udp_socket_t * | s,
|  | struct us_udp_packet_buffer_t * | buf
| ) |  |

Definition at line 54 of file udp.c.

References bsd_recvmmsg(), LIBUS_UDP_MAX_NUM, and us_poll_fd().

Referenced by internal_on_udp_read().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ us_udp_socket_send()

int us_udp_socket_send | ( | struct us_udp_socket_t * | s,
|  | struct us_udp_packet_buffer_t * | buf,
|  | int | num
| ) |  |

Definition at line 46 of file udp.c.

References bsd_sendmmsg(), and us_poll_fd().

Here is the call graph for this function:

## ◆ us_udp_socket_user()

void * us_udp_socket_user | ( | struct us_udp_socket_t * | s | ) |

Definition at line 98 of file udp.c.

References us_internal_udp_t::user.