How cjtarre/cmsc-131-lab1-starter works
renpkt is a small command-line tool for decoding and encoding fixed 20-byte IPv4 headers. Users choose a decode or encode command: decoding reads a header, extracts its fields, checks its checksum, and prints the result; encoding parses field options, constructs a header, and writes it. The assembly routines implement bit-level transformations and checksum arithmetic, called through the C driver. The README documents the encode/checksum relationship; assembly implementations were not sampled, so other internal calls are not inferred.
Main entry points: driver.c Decode command · encode.asm Header encoder · checksum.asm Checksum routine · cdecl.h cdecl macros
Components 8
Command-line driver
- Decode command
driver.c - Encode command
driver.c - File and output
driver.c
Assembly routines
- Header decoder
decode.asm - Header encoder
encode.asm - Checksum routine
checksum.asm
Calling convention
- cdecl macros
cdecl.h
Other components
- CLI user
Connections 11
- CLI user → Decode command: selects decode
driver.c - CLI user → Encode command: selects encode
driver.c - Decode command → File and output: reads header
driver.c - Decode command → Header decoder: calls decoder
driver.c - Decode command → Checksum routine: checks checksum
driver.c - Decode command → File and output: prints fields
driver.c - Encode command → Header encoder: calls encoder
driver.c - Encode command → File and output: writes header
driver.c - Header encoder → Checksum routine: uses checksum
- Decode command → cdecl macros: uses declarations
driver.c - Encode command → cdecl macros: uses declarations
driver.c