I take that back, it may still be necessary because you need to compute the checksum beforehand.
-----Original Message----- From: Daniel Ng, Mr Sent: Tuesday, October 27, 2009 11:56 AM To: Xi Chen Cc: gini@cs.mcgill.ca Subject: RE: UDP programming Ok, it seems that this is not even necessary, as this step is performed in IPOutgoingPacket. -----Original Message----- From: gini-boun...@cs.mcgill.ca [mailto:gini-boun...@cs.mcgill.ca] On Behalf Of Daniel Ng, Mr Sent: October 27, 2009 11:40 AM To: Xi Chen Cc: gini@cs.mcgill.ca Subject: Re: [gini] UDP programming I imagine most groups will ask this question at some point, so here it is. Use findRouteEntry from routetable.c first to find your interface number, then use that number in findInterfaceIP from mtu.c to get the source address. As for the port I believe it is your choice. This is not necessarily the only solution, so if you have it working another way (other than hardcoding), there is no need to change it. Daniel -----Original Message----- From: Xi Chen Sent: October 27, 2009 10:38 AM To: Daniel Ng, Mr Subject: RE: UDP programming Hi Daniel, I understand when we process the UDP packet, we can get the source IP and port from the IP header, but what about when we send the UDP packet? Do you know what method to call to get those information? Thanks, Xi _______________________________________________ gini mailing list gini@cs.mcgill.ca http://mailman.cs.mcgill.ca/mailman/listinfo/gini _______________________________________________ gini mailing list gini@cs.mcgill.ca http://mailman.cs.mcgill.ca/mailman/listinfo/gini