|
|
|
@ -1,7 +1,14 @@
|
|
|
|
/* Copyright (c) 2008 Victor Julien <victor@inliniac.net> */
|
|
|
|
/* Copyright (c) 2008 Victor Julien <victor@inliniac.net> */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Author: William Metcalf
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/* RespondReject is a threaded wrapper for sending Rejects
|
|
|
|
/* RespondReject is a threaded wrapper for sending Rejects
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|
|
|
|
* TODO
|
|
|
|
|
|
|
|
* - RespondRejectFunc returns 1 on error, 0 on ok... why? For now it should
|
|
|
|
|
|
|
|
* just return 0 always, error handling is a TODO in the threading model (VJ)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
@ -16,6 +23,7 @@
|
|
|
|
#include "tm-queuehandlers.h"
|
|
|
|
#include "tm-queuehandlers.h"
|
|
|
|
#include "tm-modules.h"
|
|
|
|
#include "tm-modules.h"
|
|
|
|
#include "action-globals.h"
|
|
|
|
#include "action-globals.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "respond-reject.h"
|
|
|
|
#include "respond-reject.h"
|
|
|
|
#include "respond-reject-libnet11.h"
|
|
|
|
#include "respond-reject-libnet11.h"
|
|
|
|
|
|
|
|
|
|
|
|
@ -58,7 +66,7 @@ int RespondRejectFunc(ThreadVars *tv, Packet *p, void *data) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
printf ("wtf? packet is not ipv4 or ipv6 returning\n");
|
|
|
|
/* we're only supporting IPv4 and IPv6 */
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -78,14 +86,18 @@ int RejectSendIPv4TCP(ThreadVars *tv, Packet *p, void *data){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* XXX VJ implement this when we have UDP decoding implemented */
|
|
|
|
int RejectSendIPv4ICMP(ThreadVars *tv, Packet *p, void *data) {
|
|
|
|
int RejectSendIPv4ICMP(ThreadVars *tv, Packet *p, void *data) {
|
|
|
|
printf ("we would send a ipv4 icmp reset here\n");
|
|
|
|
printf ("we would send a ipv4 icmp reset here\n");
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int RejectSendIPv6TCP(ThreadVars *tv, Packet *p, void *data) {
|
|
|
|
int RejectSendIPv6TCP(ThreadVars *tv, Packet *p, void *data) {
|
|
|
|
printf ("we would send a ipv6 tcp reset here\n");
|
|
|
|
printf ("we would send a ipv6 tcp reset here\n");
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int RejectSendIPv6ICMP(ThreadVars *tv, Packet *p, void *data) {
|
|
|
|
int RejectSendIPv6ICMP(ThreadVars *tv, Packet *p, void *data) {
|
|
|
|
printf ("we would send a ipv6 icmp reset here\n");
|
|
|
|
printf ("we would send a ipv6 icmp reset here\n");
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
|