Homework 5: MAC Conversion Utility¶
The purpose of this task is to write code that performs the MAC conversion based on the following usage specification and input/output scheme. This conversion MUST follow the procedure that we discussed in the lecture. The code you write for this project should be in a Linux-compatible language (e.g. C/C++, Java, Python, Perl, etc.). Your code should assume that little endian reordering has already been applied to the input:
mac_conversion -T|-D [-f filename | -x hex_value ]
Where the parameters must conform to the following specifications:
-T Use time conversion module. Either
-hmust be given.
-D Use date conversion module. Either
-hmust be given.
-f filename This specifies the path to a filename that includes a hex value of time or date. Note that the hex value should follow this notation:
0x1234. For the multiple hex values in either a file or a command line input, we consider only one hex value so the recursive mode for MAC conversion is optional.
-x hex_value This specifies the hex value for converting to either date or time value. Note that the hex value should follow this notation:
Ox1234. For the multiple hex values in either a file or a command line input, we consider only one hex value so the recursive mode for MAC conversion is optional.
The converted time or date value should be based on the following scheme:
Time: hr:min:sec AM|PM Date: Month day, Year
An example of this in use would be the following, where the time conversion is requested with a file:
$ mac_conversion -T -f test.txt Time: 10:31:44 AM
Another example shows the date conversion with the hex value as an input:
$ mac_conversion -D -h 0x4f42 Date: Feb 15, 2013
Your program must work on Ubuntu 18.04 64-bit with the default packages installed. You may find it helpful to set up a virtual machine to do your development. VirtualBox is a free and open-source VM system.
If you wish to use packages that are not installed on Ubuntu 18.04 64-bit by default, please submit a file with your
packages, with a list of packages that you would like installed before calling
make. Each line of
packages must be a valid package name, one package per line. The submission
system will automatically install all the dependencies that the package lists.
We’ve created a test script called
test.sh to help you test your program before compiling.
- Download test.sh to the directory where your code lives (including
- Ensure that
chmod +x test.sh
You will need to submit your source code, along with a Makefile and README. The Makefile must create your executable,
mac_conversion, when the command
make is run. Your README file must be plain text and should contain your
name, ASU ID, and a description of how your program works.
A prior TA compiled some resources on how to write a Makefile which might be helpful: