51#define DB_TCPDATA (512)
54#define DB_IPV6_ND (4096)
55#define DB_IPV6_ICMP (8192)
56#define DB_IPV6_ROUTE (16384)
57#define DB_IPV6_FRAG (32768)
58#define DB_IPV6_ERR (65536)
83void fShowCounters(FILE *fp);
100 uint32_t start, uint32_t end,
const char *indent=NULL);
111 uint32_t start, uint32_t end,
const char *indent=NULL);
119void FdShowData(
int fd,
const uint8_t *fromptr, uint16_t len);
127void ShowData(
const uint8_t *fromptr, uint16_t len);
233#define AsciiToIp AsciiToIp4
235#define AsciiToIp AsciiToIp6
278 return ia.
sprintf(buf, maxlen);
280#define ShowIP ShowIP6
281#define snShowIP snShowIP6
283#define ShowIP ShowIP4
284#define snShowIP snShowIP4
352void fShowCounters(FILE *fp);
361void fShowMac(FILE *fp,
const MACADR *ma);
369void fShowIP4(FILE *fp,
const IPADDR4 ia);
378void fShowIP6(FILE *fp,
const IPADDR &ia);
379#define fShowIP fShowIP6
381#define fShowIP fShowIP4
399 unsigned int fromByteCount,
400 unsigned char *toBufferPtr,
401 unsigned int toByteCount);
414 unsigned int fromByteCount,
415 unsigned char *toBufferPtr,
416 unsigned int toByteCount);
427const char *
bufnstr(
const char *search,
const char *target,
size_t len);
432#if ((defined _DEBUG) || (defined _DEBUG_PRINT))
433extern unsigned int DB_FLAGS;
439 iprintf("ASSERT failed at %d of %s\n", __LINE__, __FILE__); \
442#elif defined CORTEX_M7
446 iprintf("ASSERT failed at %d of %s\n", __LINE__, __FILE__); \
454 iprintf("ASSERT failed at %d of %s\n", __LINE__, __FILE__); \
459#define DBPRINT(x, y) \
460 if (DB_FLAGS & x) printf(y);
462 if (DB_FLAGS & x) putnum(y);
463#define DBBYTE(x, y) \
464 if (DB_FLAGS & x) putbytenum(y);
465#define DBPRINTF(x, ...) \
466 if (DB_FLAGS & x) printf(__VA_ARGS__);
467#define DBIPRINTF(x, ...) \
468 if (DB_FLAGS & x) iprintf(__VA_ARGS__);
470#define ASSERT(x) ((void)0)
471#define DBPRINT(x, y) ((void)0)
472#define DBNUM(x, y) ((void)0)
473#define DBBYTE(x, y) ((void)0)
474#define DBPRINTF(x, ...) ((void)0)
475#define DBIPRINTF(x, ...) ((void)0)
478#if ((defined _DEBUG) || (defined _DEBUG_PRINT))
479#define PPPDBPRINT(x) DBPRINT(DB_PPP, (x))
480#define PPPDBPRINTF(...) DBPRINTF(DB_PPP, __VA_ARGS__)
481#define PPPDBIPRINTF(...) DBIPRINTF(DB_PPP, __VA_ARGS__)
482#define PPPDBNUM(x) DBNUM(DB_PPP, (x))
483#define PPPDBBYTE(x) DBBYTE(DB_PPP, (x))
493#define PPPDBPRINTF(...)
494#define PPPDBIPRINTF(...)
500void LocalOutByte(
char c);
503 void Local_OutString(
const char *cp);
508#if ((defined _DEBUG) || (defined USER_CRITICAL_SANITY))
510#define USER_CRITICAL_ASSERT() \
511 if (critical_count != 0) \
513 Local_OutString("Illegal pend after USER_ENTER_CRITICAL(). Halting.\r\n"); \
517#elif (defined CORTEX_M7)
518#define USER_CRITICAL_ASSERT() \
519 if (critical_count != 0) \
521 Local_OutString("Illegal pend after USER_ENTER_CRITICAL(). Halting.\r\n"); \
526#define USER_CRITICAL_ASSERT() \
527 if (critical_count != 0) \
529 Local_OutString("Illegal pend after USER_ENTER_CRITICAL(). Halting.\r\n"); \
535#define USER_CRITICAL_ASSERT() ((void)0)
541BOOL OnModDev70(
void);
542void putleds(
unsigned char c);
543unsigned char getleds();
544void putdisp(
unsigned short w);
545unsigned short getdisp();
546unsigned char getdipsw();
551void putSegments(
unsigned char DisplayMask,
552 unsigned char DisplayData);
554void putDecimal(
unsigned char DisplayMask);
556unsigned char getCPLDver();
557unsigned char getCPLDrev();
560#define SevenSeg_0 (0x3F)
561#define SevenSeg_1 (0x06)
562#define SevenSeg_2 (0x5B)
563#define SevenSeg_3 (0x4F)
564#define SevenSeg_4 (0x66)
565#define SevenSeg_5 (0x6D)
566#define SevenSeg_6 (0x7C)
567#define SevenSeg_7 (0x07)
568#define SevenSeg_8 (0x7F)
569#define SevenSeg_9 (0x67)
570#define SevenSeg_A (0x77)
571#define SevenSeg_B (0x7F)
572#define SevenSeg_C (0x39)
573#define SevenSeg_D (0x3F)
574#define SevenSeg_E (0x79)
575#define SevenSeg_F (0x71)
576#define SevenSeg_H (0x76)
577#define SevenSeg_I (0x06)
578#define SevenSeg_J (0x1E)
579#define SevenSeg_L (0x38)
580#define SevenSeg_O (0x3F)
581#define SevenSeg_P (0x73)
582#define SevenSeg_S (0x6D)
583#define SevenSeg_U (0x3E)
584#define SevenSeg_b (0x7C)
585#define SevenSeg_c (0x58)
586#define SevenSeg_d (0x5E)
587#define SevenSeg_h (0x74)
588#define SevenSeg_l (0x06)
589#define SevenSeg_n (0x54)
590#define SevenSeg_o (0x53)
591#define SevenSeg_r (0x50)
592#define SevenSeg_u (0x1C)
593#define SevenSeg_Dash (0x40)
594#define SevenSeg_Decimal (0x80)
595#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.
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:262
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 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:276
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)
Converts an integer to ASCII (adds the stdlib itoa)
NetBurner IPADDR4 Class. See the IPADDR4 Class page for complete documentation.