28#include <ipv6/ipv6_addr.h>
79#define DB_TCPDATA (512)
82#define DB_IPV6_ND (4096)
83#define DB_IPV6_ICMP (8192)
84#define DB_IPV6_ROUTE (16384)
85#define DB_IPV6_FRAG (32768)
86#define DB_IPV6_ERR (65536)
111void fShowCounters(FILE *fp);
128 uint32_t start, uint32_t end,
const char *indent=NULL);
139 uint32_t start, uint32_t end,
const char *indent=NULL);
147void FdShowData(
int fd,
const uint8_t *fromptr, uint16_t len);
155void ShowData(
const uint8_t *fromptr, uint16_t len);
261#define AsciiToIp AsciiToIp4
263#define AsciiToIp AsciiToIp6
306 return ia.
sprintf(buf, maxlen);
308#define ShowIP ShowIP6
309#define snShowIP snShowIP6
311#define ShowIP ShowIP4
312#define snShowIP snShowIP4
380void fShowCounters(FILE *fp);
389void fShowMac(FILE *fp,
const MACADR *ma);
397void fShowIP4(FILE *fp,
const IPADDR4 ia);
406void fShowIP6(FILE *fp,
const IPADDR &ia);
407#define fShowIP fShowIP6
409#define fShowIP fShowIP4
692 unsigned int fromByteCount,
693 unsigned char *toBufferPtr,
694 unsigned int toByteCount);
1074 unsigned int fromByteCount,
1075 unsigned char *toBufferPtr,
1076 unsigned int toByteCount);
1086const char *
bufnstr(
const char *search,
const char *target,
size_t len);
1091#if ((defined _DEBUG) || (defined _DEBUG_PRINT))
1092extern unsigned int DB_FLAGS;
1098 iprintf("ASSERT failed at %d of %s\n", __LINE__, __FILE__); \
1101#elif defined CORTEX_M7
1105 iprintf("ASSERT failed at %d of %s\n", __LINE__, __FILE__); \
1113 iprintf("ASSERT failed at %d of %s\n", __LINE__, __FILE__); \
1118#define DBPRINT(x, y) \
1119 if (DB_FLAGS & x) printf(y);
1120#define DBNUM(x, y) \
1121 if (DB_FLAGS & x) putnum(y);
1122#define DBBYTE(x, y) \
1123 if (DB_FLAGS & x) putbytenum(y);
1124#define DBPRINTF(x, ...) \
1125 if (DB_FLAGS & x) printf(__VA_ARGS__);
1126#define DBIPRINTF(x, ...) \
1127 if (DB_FLAGS & x) iprintf(__VA_ARGS__);
1129#define ASSERT(x) ((void)0)
1130#define DBPRINT(x, y) ((void)0)
1131#define DBNUM(x, y) ((void)0)
1132#define DBBYTE(x, y) ((void)0)
1133#define DBPRINTF(x, ...) ((void)0)
1134#define DBIPRINTF(x, ...) ((void)0)
1137#if ((defined _DEBUG) || (defined _DEBUG_PRINT))
1138#define PPPDBPRINT(x) DBPRINT(DB_PPP, (x))
1139#define PPPDBPRINTF(...) DBPRINTF(DB_PPP, __VA_ARGS__)
1140#define PPPDBIPRINTF(...) DBIPRINTF(DB_PPP, __VA_ARGS__)
1141#define PPPDBNUM(x) DBNUM(DB_PPP, (x))
1142#define PPPDBBYTE(x) DBBYTE(DB_PPP, (x))
1151#define PPPDBPRINT(x)
1152#define PPPDBPRINTF(...)
1153#define PPPDBIPRINTF(...)
1159void LocalOutByte(
char c);
1162 void Local_OutString(
const char *cp);
1167#if ((defined _DEBUG) || (defined USER_CRITICAL_SANITY))
1169#define USER_CRITICAL_ASSERT() \
1170 if (critical_count != 0) \
1172 Local_OutString("Illegal pend after USER_ENTER_CRITICAL(). Halting.\r\n"); \
1176#elif (defined CORTEX_M7)
1177#define USER_CRITICAL_ASSERT() \
1178 if (critical_count != 0) \
1180 Local_OutString("Illegal pend after USER_ENTER_CRITICAL(). Halting.\r\n"); \
1185#define USER_CRITICAL_ASSERT() \
1186 if (critical_count != 0) \
1188 Local_OutString("Illegal pend after USER_ENTER_CRITICAL(). Halting.\r\n"); \
1194#define USER_CRITICAL_ASSERT() ((void)0)
1200BOOL OnModDev70(
void);
1201void putleds(
unsigned char c);
1202unsigned char getleds();
1203void putdisp(
unsigned short w);
1204unsigned short getdisp();
1205unsigned char getdipsw();
1210void putSegments(
unsigned char DisplayMask,
1211 unsigned char DisplayData);
1213void putDecimal(
unsigned char DisplayMask);
1215unsigned char getCPLDver();
1216unsigned char getCPLDrev();
1219#define SevenSeg_0 (0x3F)
1220#define SevenSeg_1 (0x06)
1221#define SevenSeg_2 (0x5B)
1222#define SevenSeg_3 (0x4F)
1223#define SevenSeg_4 (0x66)
1224#define SevenSeg_5 (0x6D)
1225#define SevenSeg_6 (0x7C)
1226#define SevenSeg_7 (0x07)
1227#define SevenSeg_8 (0x7F)
1228#define SevenSeg_9 (0x67)
1229#define SevenSeg_A (0x77)
1230#define SevenSeg_B (0x7F)
1231#define SevenSeg_C (0x39)
1232#define SevenSeg_D (0x3F)
1233#define SevenSeg_E (0x79)
1234#define SevenSeg_F (0x71)
1235#define SevenSeg_H (0x76)
1236#define SevenSeg_I (0x06)
1237#define SevenSeg_J (0x1E)
1238#define SevenSeg_L (0x38)
1239#define SevenSeg_O (0x3F)
1240#define SevenSeg_P (0x73)
1241#define SevenSeg_S (0x6D)
1242#define SevenSeg_U (0x3E)
1243#define SevenSeg_b (0x7C)
1244#define SevenSeg_c (0x58)
1245#define SevenSeg_d (0x5E)
1246#define SevenSeg_h (0x74)
1247#define SevenSeg_l (0x06)
1248#define SevenSeg_n (0x54)
1249#define SevenSeg_o (0x53)
1250#define SevenSeg_r (0x50)
1251#define SevenSeg_u (0x1C)
1252#define SevenSeg_Dash (0x40)
1253#define SevenSeg_Decimal (0x80)
1254#define SevenSeg_OFF (0x00)
Used to store and manipulate IPv4 addresses in dual stack mode.
Definition nettypes.h:225
Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.
Definition ipv6_addr.h:41
void print(bool bCompact=true, bool bShowV4Raw=false) const
Print the IP address value to stdout.
int sprintf(char *cp, int maxl, bool bCompact=true, bool bShowV4Raw=false) const
Print the IP address to the specified buffer.
Used to store and manipulate MAC addresses.
Definition nettypes.h:69
void outbyte(char c)
Write out a single, unbuffered byte to stdio.
unsigned char * convertBinaryToHexAscii(unsigned char *fromBufferPtr, unsigned int fromByteCount, unsigned char *toBufferPtr, unsigned int toByteCount)
Convert binary data to hexadecimal ASCII representation.
int kill(int pid, int sig)
Send a signal to a process.
unsigned long long Get_msec()
Returns the number of milliseconds as a 64-bit value.
int _fini(void)
Finalization function.
void fdShowMac(int fd, const MACADR *ma)
Dump a MAC address to file descriptor.
void ShowRingData(const uint8_t *ringBuf, uint32_t bufLen, uint32_t start, uint32_t end, const char *indent=NULL)
Dump part of a ring buffer to stdio.
IPADDR AsciiToIp6(const char *p)
Convert an ASCII IPv6 string to an IP address.
void snShowMac(char *buf, size_t maxlen, const MACADR *ma)
Dump a MAC address to character buffer.
void _exit(int i)
Terminate the calling process.
void FdShowRingData(int fd, const uint8_t *ringBuf, uint32_t bufLen, uint32_t start, uint32_t end, const char *indent=NULL)
Dump part of a ring buffer to file descriptor.
void ShowIP4(const IPADDR4 ia)
Dump an IPv4 address in ASCII IP string format to stdio.
void ShowIP6(const IPADDR &ia)
Dump an IPv6 address in ASCII IP string format to stdio.
Definition utils.h:290
void putnum(int i)
Write out a hexadecimal, unbuffered number to stdio.
const char * bufnstr(const char *search, const char *target, size_t len)
Search for a C string in an arbitrary memory blob that may contain NULL chars.
MACADR AsciiToMac(const char *p)
Convert an ASCII MAC address string to a MAC address.
void print(const char *str)
Write out a zero-terminated, unbuffered string.
void putbytenum(unsigned char c)
Write out a hexadecimal, unbuffered byte to stdio.
unsigned char * convertHexAsciiToBinary(unsigned char *fromBufferPtr, unsigned int fromByteCount, unsigned char *toBufferPtr, unsigned int toByteCount)
Convert hexadecimal ASCII string to binary data.
int snShowIP4(char *buf, size_t maxlen, const IPADDR4 ia)
Dump an IPv4 address in ASCII IP string format to character buffer.
void ShowData(const uint8_t *fromptr, uint16_t len)
Dump a block of data to stdio and show in ASCII and hex.
void FdShowData(int fd, const uint8_t *fromptr, uint16_t len)
Dump a block of data to file descriptor and show in ASCII and hex.
void MacToID(MACADR *ma, char *IDBuf)
Write 6 character ID string based on unique portion of MAC.
BOOL ValidIPv4(const char *p)
Validate if a string contains a valid IPv4 address.
void ShowMac(const MACADR *ma)
Dump a MAC address to stdio.
int snShowIP6(char *buf, size_t maxlen, const IPADDR &ia)
Dump an IPv6 address in ASCII IP string format to character buffer.
Definition utils.h:304
void sShowCounters(char *buffer, int slen)
Dump all system counters to a memory buffer.
IPADDR4 AsciiToIp4(const char *p)
Convert an ASCII IPv4 string to an IP address.
void ShowCounters()
Dump all system counters to stdio.
uint32_t GetPreciseTime(void)
Gets the time tick since system start at a higher resolution.