ns2 Network Simulator C++ Class Hierarchy of version ns-snapshot-20040722 | |
| Home | Source Code | Manual | FAQ | Mailing List Archive | Search | | | Download | |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <errno.h>
#include "logparse.h"
#include "utils.h"
Functions | |
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) |
|
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. |
|
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. :) |
|
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. |
|
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... |
|
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. |