NAME

fakecheck, fakefill, fakesignal, forbafter, forbclose, forbfd, forbget, forbopen, forbput, forbreap, forbreject, forbseek, forbselect, forbtell, orbpkt_string - routines for manipulating a forb(5) file.

SYNOPSIS

#include "forb.h"

char * orbpkt_string ( char *srcname, double time, char *packet, int nbytes );

int forbopen ( char *filename, char *representation );
int forbclose ( int orb );
int forbfd ( int orb ) ;

int forbput ( int orb, char *srcname, double time, char *packet, int nbytes );
int forbget ( int orb, int which, int *rpktid, char *srcname, double *time, char **packet, int *nbytes, int *bufsize );
int forbreap ( int orb, int *rpktid, char *srcname, double *time, char **packet, int *nbytes, int *bufsize );

int forbtell ( int orb );
int forbseek ( int orb, int which );
int forbafter ( int orb, double atime );

int forbselect ( int orb, char *select );
int forbreject ( int orb, char *reject );

void fakesignal(char *representation, char *srcname, double time, char **packet, int *nsamp, int *bufsize ) ;
int fakefill ( char *representation, char *srcname, double time, char **packet, int *nbytes, int *bufsize ) ;
int fakecheck ( char *srcname, double time, char *packet, int nbytes ) ;

DESCRIPTION

These routines emulate the corresponding orb(3) routines, performing them against a single file rather than a ring buffer with its various files and indexes. The routines are primarily for debugging purposes and to implement forbserver(1). Rather than use these directly, it is preferable to call the standard orb routines providing an orbname of the form ./path, ../path or /path.

forbopen and forbclose open either an individual file of forb(5) packets, or a directory containing multiple forb segment files. forbfd returns the open file descriptor in use by the forb routines. When writing a forb file, the user can write comments directly into this file. The file descriptor can change, so it shouldn't be cached, however.

forbput writes out a packet. forbget returns a particular packet; forbreap returns the next packet.

forbtell returns the current pktid (the current position in the forb). forbseek seeks to a particular pktid; forbafter seeks to the first packet with a time after the specified atime.

forbselect selects packets with srcnames matching the input regular expression select. forbreject rejects packets with srcnames matching the input regular expression reject.

Timing on the return of packets is affected by two parameters. The default is to return packets as quickly as they're read, with the original time tags from the file. However, it's also possible to adjust the packet times so that time is close to the current now(), which may be convenient for running simulations. This is done by adding a fixed time to the packet time from the forb, and in this case, packets are not returned until the real time matches or is greater than the packet time tag.

orbpkt_string returns a forb(5) string representation of the input packet.

fakefill generates a fake packet of the specified size, returning the (internal) sequence number.

RETURN VALUES

forbopen returns the open orb descriptor (which is not the same as an open file descriptor).

forbclose returns the result from closing the open file descriptor.

forbput returns zero for success, -1 for failure.

forbreap returns zero for success, -1 when the end of a forb file is reached or some i/o error occurs.

LIBRARY

$(ORBLIBS)

SEE ALSO

forbserver(1)
forb(5)

AUTHOR

Daniel Quinlan

Table of Contents
Antelope Release 4.8 Darwin 8.7.0 2006-09-20
Boulder Real Time Technologies, Inc For more information, contact support@brtt.com