Commit 63711a12 authored by 's avatar
Browse files

some changes to DC protocol identifications


git-svn-id: file:///home/svn/mapi/trunk@283 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 5cc29b32
......@@ -54,6 +54,8 @@ char *dc_strings[42]={"$MyNick","$Lock","$Direction","$Key","$ConnectToMe","$Get
"$NickList","$OpList","$MultiConnectToMe","$RevConnectToMe","$To:","$Quit","$OpForceMove $Who:","$ForceMove",
"$To:","$Kick","$Search","$Search Hub:","$Up","$UpToo"};
int isDc(mapidflib_function_instance_t *, const unsigned char *, int );
struct mapid_dc {
int *shift[42];
int *skip[42];
......@@ -156,8 +158,59 @@ static int dc_process(mapidflib_function_instance_t *instance,
return 0;
}
for(temp = dclist->head, prev = dclist->head; temp != NULL; prev = temp, temp = temp->next)
{
if(temp->protocol == iph->protocol &&
(
(temp->saddr == saddr && temp->daddr == daddr && temp->sp == sp && temp->dp == dp)
||
(temp->saddr == daddr && temp->daddr == saddr && temp->sp == dp && temp->dp == sp))
)
{
/* if(tcph->fin)
{
prev->next = temp->next;
temp->next = NULL;
free(temp);
}
*/
return 1;
}
}
if(isDc(instance,pkt,len) == 1)
{
if(iph->protocol == 6)
{
p += tcph->doff * 4;
if(p == NULL)
return 0;
if(*p != '$')
return 0;
if(pkt[pkt_head->wlen - 1] != '|')
return 0;
}
else if(iph->protocol == 17)
{
p += 16;
if(p == NULL)
return 0;
if(*p != '$')
return 0;
if(pkt[pkt_head->wlen - 1] != '|')
return 0;
}
else
{
return 0;
}
new = (struct filters*)malloc(sizeof(struct filters));
new->protocol = iph->protocol;
......@@ -184,28 +237,6 @@ static int dc_process(mapidflib_function_instance_t *instance,
return 1;
}
else
{
for(temp = dclist->head, prev = dclist->head; temp != NULL; prev = temp, temp = temp->next)
{
if(temp->protocol == iph->protocol &&
(
(temp->saddr == saddr && temp->daddr == daddr && temp->sp == sp && temp->dp == dp)
||
(temp->saddr == daddr && temp->daddr == saddr && temp->sp == dp && temp->dp == sp))
)
{
/* if(tcph->fin)
{
prev->next = temp->next;
temp->next = NULL;
free(temp);
}
*/
return 1;
}
}
}
return 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment