CS 210 PROJECT #2 Due: Noon Thursday 03/27/08 This project asks students to perform several validity-checks on an argument-string supplied by the user as part of the command-line. PROBLEM STATEMENT Enhance the source-code for our 'asclient.s' demo-program so it can accept a pair of command-line arguments which specify (1) the IP-address (in so-called "dotted-decimal" format) and (2) the UDP port-number (as a decimal integer) for the associated server-application: $ ./asclient Your revised 'asclient.s' application should be able to communicate with our 'udpserver.cpp' demo-program running on a workstation in the Kudlick Classroom or in the Fifth-Floor Harney Computer Science Student Lab. It should not have the server's IP-address 'hard-coded' as static data. DETAILS Your program will need to include a subroutine that can convert an IP-address from an ascii-string having "dotted-decimal" format to a 32- bit unsigned integer in "little-endian" byte-order, as depicted below: 138.202.171.9 ---> 0x09ABCA8A Each component of the dotted-decimal IP-address is a string of decimal- numerals which represnts an 8-bit unsigned integer; for example: 138 = 128 + 8 + 2 = 10001010 (binary) = 0x8A 202 = 128 + 64 + 8 + 2 = 11001010 (binary) = 0xCA 171 = 128 + 32 + 8 + 2 + 1 = 10101011 (binary) = 0xAB 9 = 8 + 1 = 00001001 (binary) = 0x09 You already had some experience (in Project 1) with an assembly language subroutine (named 'atoi') which converts a string of decimal-numerals to an unsigned integer. The assembly language ideas employed in that prior subroutine may turn out to be useful for this more extensive conversion. WHAT TO SUBMIT Your project-submission has two required parts: (1) a printout of your edited source-file 'asclient.s'; (2) electronic copies of your THREE project-files; Use our 'ljpages' utility-program (under 'System Software' on our cs210 website) to produce your printout on a laserprinter in our classroom or in one of the Harney Fifth-Floor CS Labs -- Be sure your printout shows YOUR NAME as the project's programmer -- and turn in your 'printout' to the instructor's mailbox (Mathematics Office: Harney-222). Submit your project-files 'asclient.s', 'asclient.o' and 'asclient' electronically, by copying them into your CS210 '/submit' directory, so your instructor can access them for doing testing and grading: $ cp asclient* /home/submit/cs210//. ________________________________________________________________________ Allan B. Cruse University of San Francisco Spring 2008