Friday, May 4, 2012

NIOSII - Week 11

I was able to get the input from the daughter card working. I used ip_dump(pkt); to print out the info gotten from the packet, here is what it outputs when connected to the router. s91_rcvdata is the function for receving the data. I fixed it by combining two RD into one and put into the data.

IP packet header:
ver/hlen: 45, TOS: 00, len: 0155, id: 0009
flags/offs: 0000, TTL 96, protocol: 11, cksum: 71eb (ok)
src: 192.168.1.1  dest: 239.255.255.250
ip address 101a8c0

It printed the ARP info to check that it is getting the ARP correctly and it is working correctly.
Arp received
hardware address length: 6
protocol header length: 4
Source IP: 192.168.1.14 Dest IP: 192.168.1.234
Source MAC: 20:cf:30:2d:76:e2  Dest MAC: 00:07:ed:ff:75:4a

Now I have to change s91_senddata to get the data sending correctly. I got it working by splitting the 32bit data into two 16bit data and  then send them one at a time. I got it working and is able to ping into it.

No comments:

Post a Comment