![]() |
NetSim Source Code Help
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <stdbool.h>#include "stdarg.h"#include "Linux.h"#include <time.h>#include <stdint.h>

Go to the source code of this file.
Data Structures | |
| struct | stru_pcap_writer |
| struct | stru_wireshark_trace |
Macros | |
| #define | _CRT_SECURE_NO_DEPRECATE |
| #define | _CRT_SECURE_NO_WARNINGS |
| #define | NETSIM_UTILITY_EXPORT extern |
| #define | SET_BIT(val, bitIndex) ((val) |= (1 << (bitIndex))) |
| #define | SET_BIT_64(val, bitIndex) ((val) |= (1i64 << (bitIndex))) |
| #define | CLEAR_BIT(val, bitIndex) ((val) &= ~(1 << (bitIndex))) |
| #define | CLEAR_BIT_64(val, bitIndex) ((val) &= ~(1i64 << (bitIndex))) |
| #define | TOGGLE_BIT(val, bitIndex) ((val) ^= (1 << (bitIndex))) |
| #define | TOGGLE_BIT_64(val, bitIndex) ((val) ^= (1i64 << (bitIndex))) |
| #define | BIT_IS_SET(val, bitIndex) ((val) & (1 << (bitIndex))) |
| #define | BIT_IS_SET_64(val, bitIndex) ((val) & (1i64 << (bitIndex))) |
| #define | LSHIFTCHAR(x, eposition) ((UINT8)(x << (8 - eposition))) |
| #define | RSHIFTCHAR(x, eposition) ((UINT8)(x >> (8 - eposition))) |
| #define | htonll(x) ((1==htonl(1)) ? (x) : ((uint64_t)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32)) |
Typedefs | |
| typedef struct stru_pcap_writer | PCAP_WRITER |
| typedef struct stru_pcap_writer * | PPCAP_WRITER |
| typedef struct stru_wireshark_trace | WIRESHARKTRACE |
| typedef struct stru_wireshark_trace * | PWIRESHARKTRACE |
Functions | |
| void | fnGetFilePath (char *name, char *path) |
| int | fnParseOption (int count, char *arg[], char *opt) |
| void | GetTimeStr (char *date, int len) |
| FILE * | open_log_file (char *filename, char *mode) |
| int | close_log_file (FILE *fp) |
| int | ReportLog (FILE *fp, const char *msg,...) |
| char * | rstrip (char *s) |
| char * | lskip (const char *s) |
| char * | find_char_or_comment (const char *s, char c) |
| char * | strncpy0 (char *dest, const char *src, size_t size) |
| char * | find_word (char **s) |
| bool | startsWith (const char *str, const char *pre) |
| void | init_time () |
| uint64_t | em_current_time () |
| void | em_init_time (void) |
| struct tm | get_start_time () |
| void | usleep (__int64 usec) |
| char * | get_filename_without_extension (char *filename) |
| void | create_wireshark_filter (__out char *filter, __in int len, __in char *src_ip, __in char *dst_ip) |
| void | call_wireshark (int duration, char *filter_string) |
| void * | open_pcap_file (const char *filename, char *pipename, uint32_t network) |
| void | write_to_pcap (void *handle, unsigned char *packet, unsigned int len, double *dTime) |
| void | close_pcap_file (void *pcap_handle) |
| int | isBitSet (unsigned int num, int index) |
| unsigned int | setBit (unsigned int num, int index) |
| unsigned int | unsetBit (unsigned int num, int index) |
| UINT64 | hex_to_decimal (char hex[]) |
| char * | hex_to_binary (char *hex, char *bin) |
| void | binary_to_hex (char *bin, char *hex) |
| UINT64 | binary_to_decimal (char bin[]) |
| UINT8 | maskChar (UINT8 sposition, UINT8 eposition) |
| bool | find_interaction (double arg1[2], double arg2[2], double intersection[2]) |
| void | netsim_matlab_interface_configure (char *appPath) |
| void | netsim_matlab_interface_close () |
| void | netsim_matlab_send_command (void *command, int len) |
| void | netsim_matlab_send_ascii_command (char *format,...) |
| bool | netsim_matlab_get_value (char *out, int outLen, char *name, char *type) |
Variables | |
| NETSIM_UTILITY_EXPORT WIRESHARKTRACE | wireshark_trace |
| #define _CRT_SECURE_NO_DEPRECATE |
Definition at line 30 of file NetSim_utility.h.
| #define _CRT_SECURE_NO_WARNINGS |
Definition at line 33 of file NetSim_utility.h.
| #define BIT_IS_SET | ( | val, | |
| bitIndex | |||
| ) | ((val) & (1 << (bitIndex))) |
Definition at line 160 of file NetSim_utility.h.
| #define BIT_IS_SET_64 | ( | val, | |
| bitIndex | |||
| ) | ((val) & (1i64 << (bitIndex))) |
Definition at line 161 of file NetSim_utility.h.
| #define CLEAR_BIT | ( | val, | |
| bitIndex | |||
| ) | ((val) &= ~(1 << (bitIndex))) |
Definition at line 156 of file NetSim_utility.h.
| #define CLEAR_BIT_64 | ( | val, | |
| bitIndex | |||
| ) | ((val) &= ~(1i64 << (bitIndex))) |
Definition at line 157 of file NetSim_utility.h.
| #define htonll | ( | x | ) | ((1==htonl(1)) ? (x) : ((uint64_t)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32)) |
Definition at line 165 of file NetSim_utility.h.
| #define LSHIFTCHAR | ( | x, | |
| eposition | |||
| ) | ((UINT8)(x << (8 - eposition))) |
Definition at line 162 of file NetSim_utility.h.
| #define NETSIM_UTILITY_EXPORT extern |
Definition at line 63 of file NetSim_utility.h.
| #define RSHIFTCHAR | ( | x, | |
| eposition | |||
| ) | ((UINT8)(x >> (8 - eposition))) |
Definition at line 163 of file NetSim_utility.h.
| #define SET_BIT | ( | val, | |
| bitIndex | |||
| ) | ((val) |= (1 << (bitIndex))) |
Definition at line 154 of file NetSim_utility.h.
| #define SET_BIT_64 | ( | val, | |
| bitIndex | |||
| ) | ((val) |= (1i64 << (bitIndex))) |
Definition at line 155 of file NetSim_utility.h.
| #define TOGGLE_BIT | ( | val, | |
| bitIndex | |||
| ) | ((val) ^= (1 << (bitIndex))) |
Definition at line 158 of file NetSim_utility.h.
| #define TOGGLE_BIT_64 | ( | val, | |
| bitIndex | |||
| ) | ((val) ^= (1i64 << (bitIndex))) |
Definition at line 159 of file NetSim_utility.h.
| typedef struct stru_pcap_writer PCAP_WRITER |
| typedef struct stru_pcap_writer* PPCAP_WRITER |
| typedef struct stru_wireshark_trace* PWIRESHARKTRACE |
| typedef struct stru_wireshark_trace WIRESHARKTRACE |
| UINT64 binary_to_decimal | ( | char | bin[] | ) |

| void binary_to_hex | ( | char * | bin, |
| char * | hex | ||
| ) |
| void call_wireshark | ( | int | duration, |
| char * | filter_string | ||
| ) |
| int close_log_file | ( | FILE * | fp | ) |
| void close_pcap_file | ( | void * | pcap_handle | ) |
| void create_wireshark_filter | ( | __out char * | filter, |
| __in int | len, | ||
| __in char * | src_ip, | ||
| __in char * | dst_ip | ||
| ) |
| uint64_t em_current_time | ( | ) |
| void em_init_time | ( | void | ) |
| char * find_char_or_comment | ( | const char * | s, |
| char | c | ||
| ) |
| bool find_interaction | ( | double | arg1[2], |
| double | arg2[2], | ||
| double | intersection[2] | ||
| ) |
| char * find_word | ( | char ** | s | ) |

| void fnGetFilePath | ( | char * | name, |
| char * | path | ||
| ) |
| int fnParseOption | ( | int | count, |
| char * | arg[], | ||
| char * | opt | ||
| ) |
| char * get_filename_without_extension | ( | char * | filename | ) |
| struct tm get_start_time | ( | ) |
| void GetTimeStr | ( | char * | date, |
| int | len | ||
| ) |
| char * hex_to_binary | ( | char * | hex, |
| char * | bin | ||
| ) |
| UINT64 hex_to_decimal | ( | char | hex[] | ) |
| void init_time | ( | ) |
| int isBitSet | ( | unsigned int | num, |
| int | index | ||
| ) |

| char * lskip | ( | const char * | s | ) |

| bool netsim_matlab_get_value | ( | char * | out, |
| int | outLen, | ||
| char * | name, | ||
| char * | type | ||
| ) |

| void netsim_matlab_interface_close | ( | ) |

| void netsim_matlab_interface_configure | ( | char * | appPath | ) |
| void netsim_matlab_send_ascii_command | ( | char * | format, |
| ... | |||
| ) |

| void netsim_matlab_send_command | ( | void * | command, |
| int | len | ||
| ) |
| FILE * open_log_file | ( | char * | filename, |
| char * | mode | ||
| ) |
| void * open_pcap_file | ( | const char * | filename, |
| char * | pipename, | ||
| uint32_t | network | ||
| ) |
| int ReportLog | ( | FILE * | fp, |
| const char * | msg, | ||
| ... | |||
| ) |
| char * rstrip | ( | char * | s | ) |

| unsigned int setBit | ( | unsigned int | num, |
| int | index | ||
| ) |
| bool startsWith | ( | const char * | str, |
| const char * | pre | ||
| ) |
| char * strncpy0 | ( | char * | dest, |
| const char * | src, | ||
| size_t | size | ||
| ) |
| unsigned int unsetBit | ( | unsigned int | num, |
| int | index | ||
| ) |
| void usleep | ( | __int64 | usec | ) |
| void write_to_pcap | ( | void * | handle, |
| unsigned char * | packet, | ||
| unsigned int | len, | ||
| double * | dTime | ||
| ) |
| NETSIM_UTILITY_EXPORT WIRESHARKTRACE wireshark_trace |
Definition at line 82 of file NetSim_utility.h.