cd /tmp/ wget http://ckanich.uicbits.net/cs450/bitsvpn.tgz tar xzf bitsvpn.tgz cd bitsvpn sudo ./install.shThe install script will ask you for the password that you selected for your user account when you created the virtual machine. If all goes well, your virtual machine is now on the IPv6 Internet. You can verify this by trying the command:
ping6 ipv6.google.com
If that ping command works, you're in business! Now you're ready for the fun part.
Refer to our Piazza site if you have further questions.
svn checkout svn://cs450.cs.uic.edu/s13/mynamehere --username mynamehere
a directory with the same name as your username will appear. In this directory, create a directory for homework one. Call it hw1. Add this directory to the repository through the command:
svn add hw1
and then
svn commit -m "Added my first homework directory!"
to store it permanently in the central repository. Make sure you got it right by deleting the checked out directory (named as your username), and then running
svn checkout svn://cs450.cs.uic.edu/s13/mynamehere --username mynamehere
again. This time, the checked out directory should already contain your hw1 directory. Any file you want to turn in as your homework submission needs to be added to the correct directory using "svn add". Before the submission deadline, make sure that you have committed the most recent version of your submission directory, by running "svn commit" inside the directory. You can always double-check the status of all your files by running "svn status". You are encouraged to add files and commit new revisions as often as you like, before the submission deadline: only the most recent revision, committed to the repository before the submission deadline, will be used.
svn://cs450.cs.uic.edu/pub/examples/sockets/
, and the http example sessions shown in class, write a command-line program called hw1 that takes a URL as its only parameter, retrieves the indicated file, and stores it in the local directory with the appropriate filename. If the URL does not end in a filename, use 'index.html'. Make sure it works for both text and images by opening the stored file in a web browser. You may assume that the URL is on the form http://host/path, where path may or may not be an empty string, may or may not contain multiple slashes (for subdirectories), and may or may not contain a file name. You may assume files to be no larger than one megabyte, and you are not expected to handle HTTP redirect (3xx) return codes other than report them.
The hostname may be a name like www.google.com, but the example code requires an ip address (like 64:ff9b::83c1:201d). To look up the IP address of a given host name, use getaddrinfo(). "man 3 getaddrinfo" on the command line will give you the details, or use this link, and see the getaddrinfo.c example.
svn rm hw1 svn commit -m "deleted old hw1 directory"and then copy the skeleton directory from the svn like this
svn export svn://cs450.cs.uic.edu/pub/homeworks/hw1 svn add hw1this will automatically copy all the contents of the skeleton directory to your local directory, and add these new files to your own repository.
sprintf, sscanf, strstr, strchr
Read more about these using the "man pages". For example, try "man sprintf" on the command line.
NOTE: Newlines in http are represented as "\r\n", not just "\n".
Your program will be tested (at least) on these urls:
http://www.google.com/svn checkout svn://cs450.cs.uic.edu/s13/mynamehere/hw1 --username mynamehere cd hw1 make ./hw1 http://www.google.com/index.htmlthis should produce a file called index.html, containing the source for the google front page.
./hw1 http://www.google.com/intl/en_ALL/images/logo.gifshould produce a file called logo.gif, containing the google logo.
svn co svn://cs450.cs.uic.edu/pub/
The grading script is in /pub/grading-scripts/hw1/hw1_score
. You will need to give your svn username, a file to have all output from your program run and another file for your score same as following
./hw1_score username output_file score_file
This script will create a directory with your username, download hw1 from svn and create output_file and score_file inside hw1. The score file will look something like the following, with minor changes:
[SUCCESS] files submitted using svn? [2]: 2 [SUCCESS] index.html created for http://www.google.com? [0.50]: 0.50 [SUCCESS] skype_logo.png created for http://c.skype.com/i/images/logos/skype_logo.png? [0.25]: 0.25 [SUCCESS] images_logo_lg.gif created for http://images.google.com/intl/en_ALL/images/logos/images_logo_lg.gif? [0.25]: 0.25 [SUCCESS] chord_sigcomm.pdf created for http://pdos.csail.mit.edu/papers/chord:sigcomm01/chord_sigcomm.pdf? [0.25]: 0.25 [SUCCESS] cs450.html created for ipv6 only host http://cs450.uicbits.net/cs450/cs450.html? [0.25]: 0.25 [SUCCESS] ipv4.html created for ipv4 host http://131.193.34.207/cs450/ipv4.html? [0.25]: 0.25 [SUCCESS] exit with error for http://www.google.com/thispagedoesnotexist? [0.25]: 0.25 [SUCCESS] exit with error for http://www.thissitedoesnotexist1000.com? [0.25]: 0.25 [SUCCESS] exit with error for http://www.skype.com? [0.25]: 0.25 [SUCCESS] skype_logo.png size correct? [0.25]: 0.25 [SUCCESS] images_logo_lg.gif size correct? [0.25]: 0.25 [SUCCESS] chord_sigcomm.pdf size correct? [0.25]: 0.25 [SUCCESS] skype_logo.png content correct? [0.25]: 0.25 [SUCCESS] images_logo_lg.gif content correct? [0.25]: 0.25 [SUCCESS] chord_sigcomm.pdf content correct? [0.25]: 0.25 [SUCCESS] cs450.html content correct? [0.25]: 0.25 [SUCCESS] ipv4.html content correct? [0.25]: 0.25 [SUCCESS] index.html created for http://cs450.uicbits.net/cs450/? [0.25]: 0.25 [SUCCESS] Lenses-Product-Reviews-AdoramaTV created for http://www.adorama.com/alc/0012691/article/Lenses-Product-Reviews-AdoramaTV? [0.25]: 0.25 Total score: 7
Copyright 2016 The Board of Trustees of the University of Illinois.webmaster@cs.uic.edu |
WISEST Helping Women Faculty Advance Funded by NSF | ![]() | ![]() |