|
|
|
|
|
|
|
|
unsigned char *pkt; |
|
|
unsigned char *pkt; |
|
|
int pktlen; |
|
|
int pktlen; |
|
|
int offset = 0; |
|
|
int offset = 0; |
|
|
unsigned char *remoteid; |
|
|
|
|
|
|
|
|
unsigned char *remoteid = NULL; |
|
|
int remoteidlen = 0; |
|
|
int remoteidlen = 0; |
|
|
int found = 0; |
|
|
int found = 0; |
|
|
uint8_t ipver = 0; |
|
|
uint8_t ipver = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
offset++; |
|
|
offset++; |
|
|
|
|
|
|
|
|
// printf("type : %i\n",type); |
|
|
|
|
|
|
|
|
|
|
|
// padding of 1 octet |
|
|
// padding of 1 octet |
|
|
if ( type == 0 ) { |
|
|
if ( type == 0 ) { |
|
|
continue; |
|
|
continue; |
|
|
|
|
|
|
|
|
len = pkt[offset]; |
|
|
len = pkt[offset]; |
|
|
offset++; |
|
|
offset++; |
|
|
|
|
|
|
|
|
// printf("len : %i\n", len); |
|
|
|
|
|
|
|
|
|
|
|
// can the value be read |
|
|
// can the value be read |
|
|
if ( offset+len>=pktlen ) |
|
|
|
|
|
|
|
|
if ( offset+len>pktlen ) |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
// option 82 parser |
|
|
// option 82 parser |
|
|
|
|
|
|
|
|
static int dp_callback(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_data *nfa, void *data) { |
|
|
static int dp_callback(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_data *nfa, void *data) { |
|
|
struct nfqnl_msg_packet_hdr *ph = nfq_get_msg_packet_hdr(nfa); |
|
|
struct nfqnl_msg_packet_hdr *ph = nfq_get_msg_packet_hdr(nfa); |
|
|
dp_conf *conf = (dp_conf*)data; |
|
|
dp_conf *conf = (dp_conf*)data; |
|
|
int id; |
|
|
|
|
|
|
|
|
int id = -1; |
|
|
int verdict; |
|
|
int verdict; |
|
|
|
|
|
|
|
|
if ( ph ) { |
|
|
if ( ph ) { |