ns2 Network Simulator      C++ Class Hierarchy of version ns-snapshot-20040722
Home |  Source Code |  Manual |  FAQ |  Mailing List Archive |  Search |  Download | 

Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ns-2/indep-utils/webtrace-conv/ucb/logparse.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "config.h"


struct  lf_entry_st


#define PB_CLNT_NO_CACHE   1
#define PB_CLNT_KEEP_ALIVE   2
#define PB_CLNT_IF_MOD_SINCE   8
#define PB_CLNT_UNLESS   16
#define PB_SRVR_NO_CACHE   1
#define PB_SRVR_EXPIRES   4


typedef lf_entry_st lf_entry


int lf_get_next_entry (int logfile_fd, lf_entry *nextentry, int vers)
void lf_convert_order (lf_entry *convertme)
int lf_write (FILE *outf, lf_entry *writeme)
void lf_dump (FILE *dumpf, lf_entry *dumpme)
void lf_ntoa (unsigned long addr, char *addrbuf)

Define Documentation


#define PB_CLNT_IF_MOD_SINCE   8

#define PB_CLNT_KEEP_ALIVE   2

#define PB_CLNT_NO_CACHE   1

#define PB_CLNT_UNLESS   16


#define PB_SRVR_EXPIRES   4


#define PB_SRVR_NO_CACHE   1

Typedef Documentation

typedef struct lf_entry_st lf_entry

Function Documentation

void lf_convert_order lf_entry   convertme

This function will convert all of the entries in the record into/from host order. This function is its own inverse. This function cannot fail.

void lf_dump FILE *    dumpf,
lf_entry   dumpme

This function will dump a human-readable output version of the record to the passed-in file pointer. Assume that the record is in NETWORK order. Nothing can possibly go wrong. :)

int lf_get_next_entry int    logfile_fd,
lf_entry   nextentry,
int    vers

lf_get_next_entry will suck the next record out of the logfile, and return a lf_entry record witih the information stuffed into it. Note that memory WILL be allocated for the url field; the caller is responsible for freeing the memory when done. The logfile should have everything stored in network order, if all is well.

This function returns 0 on success, 1 for EOF, and something else otherwise. On failure, no memory will have been allocated.

void lf_ntoa unsigned long    addr,
char *    addrbuf

lf_ntoa takes a network IP address (in host order) and converts it to an ascii representation. addrbuf had better be 16 bytes or more...

int lf_write FILE *    outf,
lf_entry   writeme

This function will write the entry pointed to by writeme back out to the file outf, in the canonical logfile binary format. It returns 0 on success, something else on failure.

This document is generated by doxygen.