Hello,
I am trying to forward port the RTSP module from 2.6.21 to 2.6.22 and
I am nearly done. All there is missing is a helper function. I had a
look at the skbuff struct but I could not find out what needed to be
changed.
Here is the short original helper function.
static void
get_skb_tcpdata(struct sk_buff* skb, char** pptcpdata, uint*
ptcpdatalen)
{
struct iphdr* iph = (struct iphdr*)skb->nh.iph;
struct tcphdr* tcph = (struct tcphdr*)((char*)iph + iph->ihl*4);
*pptcpdata = (char*)tcph + tcph->doff*4;
*ptcpdatalen = ((char*)skb->h.raw + skb->len) - *pptcpdata;
}
I changed this to
static void
get_skb_tcpdata(struct sk_buff** skb, char** pptcpdata, uint*
ptcpdatalen)
{
struct iphdr* iph = ip_hdr(*skb);
struct tcphdr* tcph = (void *)iph + iph->ihl*4;
*pptcpdata = (char*)tcph + tcph->doff*4;
*ptcpdatalen = ((char*)skb->h.raw + skb->len) - *pptcpdata;
}
I am pretty sure, that the first three lines are ok. But the last one
is giving me some problems, since "h" is no longer in the skb struct.
Maybe someone with a little bit more knowledge about the changes can
help me here.
Kind regards,
Michael
I am trying to forward port the RTSP module from 2.6.21 to 2.6.22 and
I am nearly done. All there is missing is a helper function. I had a
look at the skbuff struct but I could not find out what needed to be
changed.
Here is the short original helper function.
static void
get_skb_tcpdata(struct sk_buff* skb, char** pptcpdata, uint*
ptcpdatalen)
{
struct iphdr* iph = (struct iphdr*)skb->nh.iph;
struct tcphdr* tcph = (struct tcphdr*)((char*)iph + iph->ihl*4);
*pptcpdata = (char*)tcph + tcph->doff*4;
*ptcpdatalen = ((char*)skb->h.raw + skb->len) - *pptcpdata;
}
I changed this to
static void
get_skb_tcpdata(struct sk_buff** skb, char** pptcpdata, uint*
ptcpdatalen)
{
struct iphdr* iph = ip_hdr(*skb);
struct tcphdr* tcph = (void *)iph + iph->ihl*4;
*pptcpdata = (char*)tcph + tcph->doff*4;
*ptcpdatalen = ((char*)skb->h.raw + skb->len) - *pptcpdata;
}
I am pretty sure, that the first three lines are ok. But the last one
is giving me some problems, since "h" is no longer in the skb struct.
Maybe someone with a little bit more knowledge about the changes can
help me here.
Kind regards,
Michael