diff options
Diffstat (limited to 'src/common')
-rwxr-xr-x | src/common/basic_utils.cpp | 12 | ||||
-rwxr-xr-x | src/common/basic_utils.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/common/basic_utils.cpp b/src/common/basic_utils.cpp index b2277697..f169c29f 100755 --- a/src/common/basic_utils.cpp +++ b/src/common/basic_utils.cpp @@ -29,6 +29,18 @@ bool utl_is_file_exists (const std::string& name) { } } +void utl_k12_pkt_format(FILE* fp,void * src, unsigned int size) { + unsigned int i; + fprintf(fp,"\n"); + fprintf(fp,"+---------+---------------+----------+\n"); + fprintf(fp,"00:00:00,000,000 ETHER \n"); + fprintf(fp,"|0 |"); + for ( i=0; i<size;i++ ) { + fprintf(fp,"%02x|",((unsigned char *)src)[i]); + } + fprintf(fp,"\n");; +} + void utl_DumpBuffer(FILE* fp,void * src, unsigned int size,int offset) { unsigned int i; diff --git a/src/common/basic_utils.h b/src/common/basic_utils.h index 1884e896..f6250a2b 100755 --- a/src/common/basic_utils.h +++ b/src/common/basic_utils.h @@ -40,6 +40,7 @@ inline uint utl_align_down(uint num,uint round){ return( (num) & (~(round-1)) ); } +void utl_k12_pkt_format(FILE* fp,void * src, unsigned int size) ; void utl_DumpBuffer(FILE* fp,void * src, unsigned int size,int offset=0); |