Hi
I am using rte on top RTLinux version1, with a SMC-ULTRA 16 ethernet card...This computer is a connected to a subnet in my university. with ip adress of 137.82.52.60 or 255 for broadcast
In the receive procedure, the normal stuff is done:
    - allocate skb(pktlen+2)   /* pktlen is length of IP packet
    - skb_reserve(2)
    - skb_put(pktlen)
    - input_block (skb, device-memory, dev...)
    - skb->protocol=eth_trans....
      -  if  MYnetif_rx ----->>>>>>>
                this will call rxPacket in rte package...

****Please tell me what I am doing worong after this....
In rxPacket, I donot retreive the ethernet header by any push or anything I leave it as it is... I don't touch SKB at all. I only added the following to rxPacket.
 
        ...
        struct iphdr * myheader;
        myheader = ( struct iphdr *) skb->data;
        for (i=0...40)
            {
               1- printk( "%d  all skb", (unsigned char) *(skb->head + i )
                2- printk("%d  all packet ", (unsigned char )* (skb->data + i)
            }
         3- printk ("%s dest address", in_ntoa(myheader->daddr))
         4- printk  ("%d protocol ",  (unsigned char )*(skb->data + 9)
         inputPacket ++
         .....

I am getting different packets from the network broadcast, more than 400 of them with no bufferning or anything in less than a minute.   Is this a problenm???????

I am not getting what I expect from the above:
 
            1- I was expecting to get only (14+2) 16 bytes different between skb->head and sk->data, while I get alot more..
 
           2- I wanted to get the  first 20  bytes of my IP packet, with the same format as standard IPV4. It doesn't match. The destination addr, 137.82.52.255 location in the byte stream is moving for different packets.. The only thing it matches, both location and value,  is the length of packet...(min 46)
 
            3- it rotating or shifting for each packet: 137.82.52.255,  4.5,137.82, ...

            4- I was expecting to get either 6 for TCP or 17 from UDP...while I get non sense numbers...

My final goal is to receive raw packet from a particular machine, I don't care that to be TCP or UDP... and I don't want to be bombard with other networks. Unfortunately I don't have root access to another machine right now, so I just tried the machine as it is, networked with other SUN and PC machines...But getting another PC and using sock_packet there is a possibility...

****Do you think setting another linuix machine and only having ethernet connection (datalink layer) is the only clean, way?!

**** do you think there is anyproblem with my byte ordering?
**** would the problem be with not enough buffering anf being bombarded with packets?

I truly appreciate your help...
maryam

-- 

+ Maryam Moghaddas            + Department Of Electrical & Computer Eng.
+ email: [EMAIL PROTECTED]   + U OF British Columbia
+ Work: (604) 822-5103        + 2356 Mail Mall
+ room: CICSR 362 or 371      + Vancouver, BC V6T 1Z4 Canada

++++ The algorithm of LOVING :  
     if you love something, Set it free.
     if   it comes back to you, it's yours
     else it was never meant to be....
 

Reply via email to