NeoMutt  2020-06-26-89-g172cd3
Teaching an old dog new tricks
DOXYGEN
Connection Struct Reference

An open network connection (socket) More...

#include "connection.h"

+ Collaboration diagram for Connection:

Data Fields

struct ConnAccount account
 Account details: username, password, etc. More...
 
unsigned int ssf
 Security strength factor, in bits (see below) More...
 
char inbuf [1024]
 Buffer for incoming traffic. More...
 
int bufpos
 Current position in the buffer. More...
 
int fd
 Socket file descriptor. More...
 
int available
 Amount of data waiting to be read. More...
 
void * sockdata
 Backend-specific socket data. More...
 
int(* open )(struct Connection *conn)
 Note about ssf: in actuality, NeoMutt uses this as a boolean to determine if the connection is "secure" using TLS or $tunnel if $tunnel_is_secure is set. More...
 
int(* read )(struct Connection *conn, char *buf, size_t count)
 Read from a socket Connection. More...
 
int(* write )(struct Connection *conn, const char *buf, size_t count)
 Write to a socket Connection. More...
 
int(* poll )(struct Connection *conn, time_t wait_secs)
 Check whether a socket read would block. More...
 
int(* close )(struct Connection *conn)
 Close a socket Connection. More...
 

Detailed Description

An open network connection (socket)

Definition at line 34 of file connection.h.

Field Documentation

◆ account

struct ConnAccount Connection::account

Account details: username, password, etc.

Definition at line 36 of file connection.h.

◆ ssf

unsigned int Connection::ssf

Security strength factor, in bits (see below)

Definition at line 37 of file connection.h.

◆ inbuf

char Connection::inbuf[1024]

Buffer for incoming traffic.

Definition at line 38 of file connection.h.

◆ bufpos

int Connection::bufpos

Current position in the buffer.

Definition at line 39 of file connection.h.

◆ fd

int Connection::fd

Socket file descriptor.

Definition at line 40 of file connection.h.

◆ available

int Connection::available

Amount of data waiting to be read.

Definition at line 41 of file connection.h.

◆ sockdata

void* Connection::sockdata

Backend-specific socket data.

Definition at line 42 of file connection.h.

◆ open

int(* Connection::open) (struct Connection *conn)

Note about ssf: in actuality, NeoMutt uses this as a boolean to determine if the connection is "secure" using TLS or $tunnel if $tunnel_is_secure is set.

The value is passed to SASL, but since no min_ssf is also passed to SASL I don't believe it makes any difference.

The GnuTLS code currently even puts bytes in here, so I doubt the exact value has significance for NeoMutt purposes. Open a socket Connection

Parameters
connConnection to a server
Return values
0Success
-1Error

Definition at line 62 of file connection.h.

◆ read

int(* Connection::read) (struct Connection *conn, char *buf, size_t count)

Read from a socket Connection.

Parameters
connConnection to a server
bufBuffer to store the data
countNumber of bytes to read
Return values
>0Success, number of bytes read
-1Error, see errno

Definition at line 72 of file connection.h.

◆ write

int(* Connection::write) (struct Connection *conn, const char *buf, size_t count)

Write to a socket Connection.

Parameters
connConnection to a server
bufBuffer to read into
countNumber of bytes to read
Return values
>0Success, number of bytes written
-1Error, see errno

Definition at line 82 of file connection.h.

◆ poll

int(* Connection::poll) (struct Connection *conn, time_t wait_secs)

Check whether a socket read would block.

Parameters
connConnection to a server
wait_secsHow long to wait for a response
Return values
>0There is data to read
0Read would block
-1Connection doesn't support polling

Definition at line 92 of file connection.h.

◆ close

int(* Connection::close) (struct Connection *conn)

Close a socket Connection.

Parameters
connConnection to a server
Return values
0Success
-1Error, see errno

Definition at line 100 of file connection.h.


The documentation for this struct was generated from the following file: