udp.h File Reference

Fixbuf UDP low-level I/O. More...

#include <fixbuf/autoinc.h>

Go to the source code of this file.

Functions

gboolean fix_udp_read_start (void *ectx, void **ictx, GError **err)
 Low-level input start function for UDP.
gboolean fix_udp_read (void *ectx, void *ictx, uint8_t *buf, uint32_t *len, GError **err)
 Low-level input read function for UDP.
gboolean fix_udp_read_end (void *ectx, void **ictx, GError **err)
 Low-level input end function for UDP.
gboolean fix_udp_write (void *ectx, void *ictx, uint8_t *buf, uint32_t len, GError **err)
 Low-level output write function for UDP.


Detailed Description

Fixbuf UDP low-level I/O.

By passing these functions to fix_writer_alloc() or fix_reader_alloc(), fixbuf can be used to export and collect IPFIX messages via UDP.


Function Documentation

gboolean fix_udp_read void *  ectx,
void *  ictx,
uint8_t *  buf,
uint32_t *  len,
GError **  err
 

Low-level input read function for UDP.

Copies next available bytes out of the message's internal context. ectx is a UDP socket file descriptor. Requires message start and end functions to read the message into the internal context. Do not call this directly; pass it to fix_reader_alloc() instead.

Parameters:
ectx external context from fix_read_start(); a UDP socket.
ictx internal context; UDP message storage
buf buffer to read
len Pointer to length of buffer; on input, defines available buffer size, on output, defines size of read buffer.
err an error description
Returns:
TRUE on success, FALSE otherwise.

gboolean fix_udp_read_end void *  ectx,
void **  ictx,
GError **  err
 

Low-level input end function for UDP.

Cleans up internal context allocated by fix_udp_read_start(). Do not call this directly; pass it to fix_reader_alloc() instead.

Parameters:
ectx external context from fix_read_start(); a UDP socket.
ictx internal context; UDP message storage
err an error description
Returns:
TRUE on success, FALSE otherwise.

gboolean fix_udp_read_start void *  ectx,
void **  ictx,
GError **  err
 

Low-level input start function for UDP.

Reads next available message from UDP socket. ectx is a UDP socket file descriptor, which must already be bound to the port to receive IPFIX messages from via bind(2). Use of this function will cause fix_read_start() to block until a UDP datagram is received. Do not call this directly; pass it to fix_reader_alloc() instead.

Parameters:
ectx external context from fix_read_start(); a UDP socket.
ictx internal context; UDP message storage
err an error description
Returns:
TRUE on success, FALSE otherwise.

gboolean fix_udp_write void *  ectx,
void *  ictx,
uint8_t *  buf,
uint32_t  len,
GError **  err
 

Low-level output write function for UDP.

ectx is a UDP socket file descriptor, which must be associated with the address to send IPFIX messages to via connect(2). Since non-final (i.e., legal on-the-wire) messages are guaranteed to be written in a single write call by fixbuf, this function does not require message start or end functions.

Parameters:
ectx external context from fix_write_start(); a UDP socket.
ictx internal context; ignored
buf buffer to write
len length of buffer
err an error description
Returns:
TRUE on success, FALSE otherwise.


© 2005-2006 Carnegie Mellon University
Generated Thu Jul 6 16:00:08 2006 for libfixbuf 0.4.1 by Doxygen 1.4.5.