|
|
@ -1,10 +1,14 @@
|
|
|
|
/* Copyright (c) 2009 Open Infosec Foundation
|
|
|
|
/* Copyright (c) 2009 Open Infosec Foundation
|
|
|
|
* Written by Breno Silva Pinto <breno.silva@gmail.com> */
|
|
|
|
* Written by Breno Silva Pinto <breno.silva@gmail.com> */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "eidps.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "decode.h"
|
|
|
|
#include "decode.h"
|
|
|
|
#include "decode-ppp.h"
|
|
|
|
#include "decode-ppp.h"
|
|
|
|
#include "decode-events.h"
|
|
|
|
#include "decode-events.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "flow.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "util-unittest.h"
|
|
|
|
#include "util-unittest.h"
|
|
|
|
|
|
|
|
|
|
|
|
void DecodePPP(ThreadVars *t, Packet *p, u_int8_t *pkt, u_int16_t len, PacketQueue *pq)
|
|
|
|
void DecodePPP(ThreadVars *t, Packet *p, u_int8_t *pkt, u_int16_t len, PacketQueue *pq)
|
|
|
@ -166,8 +170,12 @@ static int DecodePPPtest03 (void) {
|
|
|
|
memset(&tv, 0, sizeof(ThreadVars));
|
|
|
|
memset(&tv, 0, sizeof(ThreadVars));
|
|
|
|
memset(&p, 0, sizeof(Packet));
|
|
|
|
memset(&p, 0, sizeof(Packet));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FlowInitConfig(FLOW_QUIET);
|
|
|
|
|
|
|
|
|
|
|
|
DecodePPP(&tv, &p, raw_ppp, sizeof(raw_ppp), NULL);
|
|
|
|
DecodePPP(&tv, &p, raw_ppp, sizeof(raw_ppp), NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FlowShutdown();
|
|
|
|
|
|
|
|
|
|
|
|
if(p.ppph == NULL) {
|
|
|
|
if(p.ppph == NULL) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -207,8 +215,12 @@ static int DecodePPPtest04 (void) {
|
|
|
|
memset(&tv, 0, sizeof(ThreadVars));
|
|
|
|
memset(&tv, 0, sizeof(ThreadVars));
|
|
|
|
memset(&p, 0, sizeof(Packet));
|
|
|
|
memset(&p, 0, sizeof(Packet));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FlowInitConfig(FLOW_QUIET);
|
|
|
|
|
|
|
|
|
|
|
|
DecodePPP(&tv, &p, raw_ppp, sizeof(raw_ppp), NULL);
|
|
|
|
DecodePPP(&tv, &p, raw_ppp, sizeof(raw_ppp), NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FlowShutdown();
|
|
|
|
|
|
|
|
|
|
|
|
if(p.ppph == NULL) {
|
|
|
|
if(p.ppph == NULL) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|