tcpset.h File Reference
`#include "config.h"`
`#include <stdint.h>`
`#include "status.h"`
`#include "wire/buffer.h"`
`#include "wire/xfrd.h"`

Go to the source code of this file.

## Data Structures

struct | tcp_conn_struct
struct | tcp_set_struct

## Macros

#define | TCPSET_MAX 50

## Typedefs

typedef struct tcp_conn_struct | tcp_conn_type
typedef struct tcp_set_struct | tcp_set_type

## Functions

tcp_conn_type * | tcp_conn_create (void)
tcp_set_type * | tcp_set_create (void)
void | tcp_conn_ready (tcp_conn_type *tcp)
int | tcp_conn_read (tcp_conn_type *tcp)
int | tcp_conn_write (tcp_conn_type *tcp)
void | tcp_set_cleanup (tcp_set_type *set)

## Macro Definition Documentation

## TCPSET_MAX

#define TCPSET_MAX 50

Definition at line 45 of file tcpset.h.

## Typedef Documentation

## tcp_conn_type

typedef struct tcp_conn_struct tcp_conn_type

TCP connections.

Definition at line 38 of file tcpset.h.

## tcp_set_type

typedef struct tcp_set_struct tcp_set_type

Definition at line 39 of file tcpset.h.

## Function Documentation

## tcp_conn_create()

tcp_conn_type * tcp_conn_create | ( | void |  | ) |

extern

Create a tcp connection.

Parameters

  [in] | allocator | memory allocator

Returns
  tcp_conn_type* TCP connection.

Create a tcp connection.

Definition at line 45 of file tcpset.c.

References buffer_create(), tcp_conn_struct::fd, tcp_conn_struct::msglen, tcp_conn_struct::packet, PACKET_BUFFER_SIZE, and tcp_conn_struct::total_bytes.

Referenced by tcp_set_create().

## tcp_conn_read()

int tcp_conn_read | ( | tcp_conn_type * | tcp | ) |

extern

Definition at line 103 of file tcpset.c.

References buffer_capacity(), buffer_current(), buffer_position(), buffer_remaining(), buffer_set_limit(), buffer_skip(), tcp_conn_struct::fd, tcp_conn_struct::msglen, tcp_conn_struct::packet, and tcp_conn_struct::total_bytes.

## tcp_conn_ready()

void tcp_conn_ready | ( | tcp_conn_type * | tcp | ) |

extern

Make tcp connection ready for reading.

Parameters

  [in] | tcp | tcp connection

Definition at line 89 of file tcpset.c.

References buffer_clear(), tcp_conn_struct::msglen, tcp_conn_struct::packet, and tcp_conn_struct::total_bytes.

## tcp_conn_write()

int tcp_conn_write | ( | tcp_conn_type * | tcp | ) |

extern

Definition at line 177 of file tcpset.c.

References buffer_current(), buffer_remaining(), buffer_skip(), tcp_conn_struct::fd, tcp_conn_struct::msglen, tcp_conn_struct::packet, and tcp_conn_struct::total_bytes.

## tcp_set_cleanup()

void tcp_set_cleanup | ( | tcp_set_type * | set | ) |

extern

Clean up set of tcp connections.

Parameters

  [in] | set | set of tcp connections
  [in] | allocator | memory allocator

Clean up set of tcp connections.

Definition at line 242 of file tcpset.c.

References tcp_set_struct::tcp_conn, and TCPSET_MAX.

Referenced by xfrhandler_cleanup().

## tcp_set_create()

tcp_set_type * tcp_set_create | ( | void |  | ) |

extern

Create a set of tcp connections.

Parameters

  [in] | allocator | memory allocator

Returns
  tcp_set_type* set of tcp connection.

Create a set of tcp connections.

Definition at line 67 of file tcpset.c.

References tcp_set_struct::tcp_conn, tcp_conn_create(), tcp_set_struct::tcp_count, tcp_set_struct::tcp_waiting_first, tcp_set_struct::tcp_waiting_last, and TCPSET_MAX.

Referenced by xfrhandler_create().