mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-09 03:54:15 +00:00
made non-xpf wrapper for serval_packetvisualise, and added
missing header.
This commit is contained in:
parent
b758366cc3
commit
b67ee5d4c5
@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -50,7 +51,7 @@ int main(int argc,char **argv)
|
||||
int i;
|
||||
len=random()%8192;
|
||||
for(i=0;i<len;i++) buff[i]=random()&0xff;
|
||||
serval_packetvisualise(XPRINTF_STDIO(stdout), "Fuzz Test", buff, len);
|
||||
serval_packetvisualise_xpf(XPRINTF_STDIO(stdout), "Fuzz Test", buff, len);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -509,7 +510,7 @@ int isDNAPacket(XPRINTF xpf, const unsigned char *packet, size_t *ofs, size_t le
|
||||
return 0;
|
||||
}
|
||||
|
||||
int serval_packetvisualise(XPRINTF xpf, const char *message, const unsigned char *packet, size_t len)
|
||||
int serval_packetvisualise_xpf(XPRINTF xpf, const char *message, const unsigned char *packet, size_t len)
|
||||
{
|
||||
if (message)
|
||||
xprintf(xpf, "%s: ",message);
|
||||
@ -551,3 +552,8 @@ static void _dump(XPRINTF xpf, const unsigned char *data, size_t len, size_t ofs
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
int serval_packetvisualise(const char *message, const unsigned char *packet, size_t len)
|
||||
{
|
||||
return serval_packetvisualise_xpf(XPRINTF_STDIO(stdout),message, packet, len);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user