Macros | Typedefs | Enumerations | Functions | Variables
libzmq/tests/testutil.hpp File Reference
#include "../src/platform.hpp"
#include "../include/zmq.h"
#include "../src/stdint.hpp"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <stdlib.h>
Include dependency graph for libzmq/tests/testutil.hpp:

Go to the source code of this file.

Macros

#define ENDPOINT_0   "tcp://127.0.0.1:5555"
 
#define ENDPOINT_1   "tcp://127.0.0.1:5556"
 
#define ENDPOINT_2   "tcp://127.0.0.1:5557"
 
#define ENDPOINT_3   "tcp://127.0.0.1:5558"
 
#define ENDPOINT_4   "udp://127.0.0.1:5559"
 
#define ENDPOINT_5   "udp://127.0.0.1:5560"
 
#define IPPROTO_WS   10000
 
#define IPPROTO_WSS   10001
 
#define LIBZMQ_UNUSED(object)   (void) object
 
#define MAX_SOCKET_STRING   256
 
#define MSG_NOSIGNAL   0
 
#define PORT_6   5561
 
#define SETTLE_TIME   300
 

Typedefs

typedef zmq_fd_t fd_t
 
typedef size_t socket_size_t
 

Enumerations

enum  { retired_fd = -1 }
 

Functions

const voidas_setsockopt_opt_t (const void *opt_)
 
struct sockaddr_in bind_bsd_socket (int socket)
 
fd_t bind_socket_resolve_port (const char *address_, const char *port_, char *my_endpoint_, const int af_=AF_INET, const int protocol_=IPPROTO_TCP)
 
void bounce (void *server_, void *client_)
 
void close_zero_linger (void *socket_)
 
fd_t connect_socket (const char *endpoint_, const int af_=AF_INET, const int protocol_=IPPROTO_TCP)
 
void expect_bounce_fail (void *server_, void *client_)
 
int fuzzer_corpus_encode (const char *filename, uint8_t ***data, size_t **len, size_t *num_cases)
 
int is_ipv6_available (void)
 
int is_tipc_available (void)
 
void msleep (int milliseconds_)
 
char * s_recv (void *socket_)
 
void s_recv_seq (void *socket_,...)
 
void s_send_seq (void *socket_,...)
 
void setup_test_environment (int timeout_seconds_=60)
 
bool streq (const char *lhs, const char *rhs)
 
bool strneq (const char *lhs, const char *rhs)
 
int test_inet_pton (int af_, const char *src_, void *dst_)
 

Variables

const char * SEQ_END
 
const uint8_t zmtp_greeting_curve [64]
 
const uint8_t zmtp_greeting_null [64]
 
const uint8_t zmtp_ready_dealer [43]
 
const uint8_t zmtp_ready_sub [27]
 
const uint8_t zmtp_ready_xpub [28]
 

Macro Definition Documentation

◆ ENDPOINT_0

#define ENDPOINT_0   "tcp://127.0.0.1:5555"

Definition at line 39 of file libzmq/tests/testutil.hpp.

◆ ENDPOINT_1

#define ENDPOINT_1   "tcp://127.0.0.1:5556"

Definition at line 40 of file libzmq/tests/testutil.hpp.

◆ ENDPOINT_2

#define ENDPOINT_2   "tcp://127.0.0.1:5557"

Definition at line 41 of file libzmq/tests/testutil.hpp.

◆ ENDPOINT_3

#define ENDPOINT_3   "tcp://127.0.0.1:5558"

Definition at line 42 of file libzmq/tests/testutil.hpp.

◆ ENDPOINT_4

#define ENDPOINT_4   "udp://127.0.0.1:5559"

Definition at line 43 of file libzmq/tests/testutil.hpp.

◆ ENDPOINT_5

#define ENDPOINT_5   "udp://127.0.0.1:5560"

Definition at line 44 of file libzmq/tests/testutil.hpp.

◆ IPPROTO_WS

#define IPPROTO_WS   10000

Definition at line 194 of file libzmq/tests/testutil.hpp.

◆ IPPROTO_WSS

#define IPPROTO_WSS   10001

Definition at line 195 of file libzmq/tests/testutil.hpp.

◆ LIBZMQ_UNUSED

#define LIBZMQ_UNUSED (   object)    (void) object

Definition at line 128 of file libzmq/tests/testutil.hpp.

◆ MAX_SOCKET_STRING

#define MAX_SOCKET_STRING   256

Definition at line 35 of file libzmq/tests/testutil.hpp.

◆ MSG_NOSIGNAL

#define MSG_NOSIGNAL   0

Definition at line 71 of file libzmq/tests/testutil.hpp.

◆ PORT_6

#define PORT_6   5561

Definition at line 45 of file libzmq/tests/testutil.hpp.

◆ SETTLE_TIME

#define SETTLE_TIME   300

Definition at line 31 of file libzmq/tests/testutil.hpp.

Typedef Documentation

◆ fd_t

typedef zmq_fd_t fd_t

Definition at line 98 of file libzmq/tests/testutil.hpp.

◆ socket_size_t

typedef size_t socket_size_t

Definition at line 90 of file libzmq/tests/testutil.hpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
retired_fd 

Definition at line 115 of file libzmq/tests/testutil.hpp.

Function Documentation

◆ as_setsockopt_opt_t()

const void* as_setsockopt_opt_t ( const void opt_)
inline

Definition at line 91 of file libzmq/tests/testutil.hpp.

◆ bind_bsd_socket()

struct sockaddr_in bind_bsd_socket ( int  socket)

Definition at line 329 of file testutil.cpp.

◆ bind_socket_resolve_port()

fd_t bind_socket_resolve_port ( const char *  address_,
const char *  port_,
char *  my_endpoint_,
const int  af_ = AF_INET,
const int  protocol_ = IPPROTO_TCP 
)

Definition at line 410 of file testutil.cpp.

◆ bounce()

void bounce ( void server_,
void client_ 
)

Definition at line 71 of file testutil.cpp.

◆ close_zero_linger()

void close_zero_linger ( void socket_)

Definition at line 193 of file testutil.cpp.

◆ connect_socket()

fd_t connect_socket ( const char *  endpoint_,
const int  af_ = AF_INET,
const int  protocol_ = IPPROTO_TCP 
)

Definition at line 353 of file testutil.cpp.

◆ expect_bounce_fail()

void expect_bounce_fail ( void server_,
void client_ 
)

Definition at line 107 of file testutil.cpp.

◆ fuzzer_corpus_encode()

int fuzzer_corpus_encode ( const char *  filename,
uint8_t ***  data,
size_t **  len,
size_t *  num_cases 
)

Definition at line 534 of file testutil.cpp.

◆ is_ipv6_available()

int is_ipv6_available ( void  )

Definition at line 236 of file testutil.cpp.

◆ is_tipc_available()

int is_tipc_available ( void  )

Definition at line 283 of file testutil.cpp.

◆ msleep()

void msleep ( int  milliseconds_)

Definition at line 227 of file testutil.cpp.

◆ s_recv()

char* s_recv ( void socket_)

Definition at line 123 of file testutil.cpp.

◆ s_recv_seq()

void s_recv_seq ( void socket_,
  ... 
)

Definition at line 158 of file testutil.cpp.

◆ s_send_seq()

void s_send_seq ( void socket_,
  ... 
)

Definition at line 135 of file testutil.cpp.

◆ setup_test_environment()

void setup_test_environment ( int  timeout_seconds_ = 60)

Definition at line 201 of file testutil.cpp.

◆ streq()

bool streq ( const char *  lhs,
const char *  rhs 
)

Definition at line 508 of file testutil.cpp.

◆ strneq()

bool strneq ( const char *  lhs,
const char *  rhs 
)

Definition at line 513 of file testutil.cpp.

◆ test_inet_pton()

int test_inet_pton ( int  af_,
const char *  src_,
void dst_ 
)

Definition at line 303 of file testutil.cpp.

Variable Documentation

◆ SEQ_END

const char* SEQ_END

Definition at line 47 of file testutil.cpp.

◆ zmtp_greeting_curve

const uint8_t zmtp_greeting_curve[64]
Initial value:
= {
0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0x7f, 3, 0, 'C', 'U', 'R', 'V',
'E', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

Definition at line 53 of file libzmq/tests/testutil.hpp.

◆ zmtp_greeting_null

const uint8_t zmtp_greeting_null[64]
Initial value:
= {
0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0x7f, 3, 0, 'N', 'U', 'L', 'L',
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

Definition at line 48 of file libzmq/tests/testutil.hpp.

◆ zmtp_ready_dealer

const uint8_t zmtp_ready_dealer[43]
Initial value:
= {
4, 41, 5, 'R', 'E', 'A', 'D', 'Y', 11, 'S', 'o', 'c', 'k', 'e', 't',
'-', 'T', 'y', 'p', 'e', 0, 0, 0, 6, 'D', 'E', 'A', 'L', 'E', 'R',
8, 'I', 'd', 'e', 'n', 't', 'i', 't', 'y', 0, 0, 0, 0}

Definition at line 57 of file libzmq/tests/testutil.hpp.

◆ zmtp_ready_sub

const uint8_t zmtp_ready_sub[27]
Initial value:
= {
4, 25, 5, 'R', 'E', 'A', 'D', 'Y', 11, 'S', 'o', 'c', 'k', 'e',
't', '-', 'T', 'y', 'p', 'e', 0, 0, 0, 3, 'S', 'U', 'B'}

Definition at line 64 of file libzmq/tests/testutil.hpp.

◆ zmtp_ready_xpub

const uint8_t zmtp_ready_xpub[28]
Initial value:
= {
4, 26, 5, 'R', 'E', 'A', 'D', 'Y', 11, 'S', 'o', 'c', 'k', 'e',
't', '-', 'T', 'y', 'p', 'e', 0, 0, 0, 4, 'X', 'P', 'U', 'B'}

Definition at line 61 of file libzmq/tests/testutil.hpp.



libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:04