{"id":19053307,"url":"https://github.com/sbmueller/packet_parser","last_synced_at":"2025-10-14T08:14:15.376Z","repository":{"id":83263266,"uuid":"85753811","full_name":"sbmueller/packet_parser","owner":"sbmueller","description":"Small hacking project parsing a toy protocol","archived":false,"fork":false,"pushed_at":"2017-03-22T14:48:07.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T14:53:45.234Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbmueller.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-21T21:09:28.000Z","updated_at":"2024-03-03T07:24:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9154892-6ff9-4be5-a374-b92186227fad","html_url":"https://github.com/sbmueller/packet_parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sbmueller/packet_parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbmueller%2Fpacket_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbmueller%2Fpacket_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbmueller%2Fpacket_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbmueller%2Fpacket_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbmueller","download_url":"https://codeload.github.com/sbmueller/packet_parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbmueller%2Fpacket_parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018306,"owners_count":26086334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T23:30:03.029Z","updated_at":"2025-10-14T08:14:15.360Z","avatar_url":"https://github.com/sbmueller.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"What follows is the definition for a toy protocol.  I wanted to use\na real world example, but the more I considered various protocols the\nmore frustrated I grew with how long it would take to either implement\nor test solutions.  What results was a compromise that should require \na bit of work, but nothing so long that it's discouraging.\n\n    0       1       2       3       4       5       6       7\n+-------+-------+-------+-------+-------+-------+-------+-------+\n|       |       |       |       |       |       |       |       |\n|  hdr1 |  hdr2 |  src     src     src     src  |  dst     dst  |\n|alwys Z| Y or Z|        network order          | network order |\n| 8-bit | 8-bit |            32-bit             |    32-bit     |\n|       |       |       |       |       |       |       |       |\n+-------+-------+-------+-------+-------+-------+-------+-------+\n|       |       |       |       |       |       |       |       |\n|  dst     dst  |  crc     crc     crc     crc  | flags |  len  |\n| network order | CRC-32 (ANSI, Ethernet, etc.) |       |       |\n|  32-bit cont  |            32-bit             | 8-bit | 8-bit |\n|       |       |       |       |       |       |       |       |\n+-------+-------+-------+-------+-------+-------+-------+-------+\n|       |       |\n|  payload\n|\n|  0 to 2040 bits ...\n|       |\n+-------+-- -\n\n\nflags\n\n    0       1       2       3       4       5       6       7\n+-------+-------+-------+-------+-------+-------+-------+-------+\n|       |       |       |       |       |       |       |       |\n| rsrvd | rsvrd | rsvrd |unknown| reset |urgent |  ack  |  ack  |\n|       |       |       |       |       |  msg  | rqstd |       |\n|       |       |       |       |       |       |       |       |\n| 1-bit | 1-bit | 1-bit | 1-bit | 1-bit | 1-bit | 1-bit | 1-bit |\n|       |       |       |       |       |       |       |       |\n+-------+-------+-------+-------+-------+-------+-------+-------+\n\nBecause we don't have a pcap format or anything of the sort for this\nmade up protocol, I've generated some test data and then converted\nthat to hex to simulate what is returned from a read off of a device.\n\nThe test file shows a (completely fake) conversation between the \nhosts AA:BB:CC:DD and 11:22:33:44.\n\nI would like a program that lets me \"grep\" these packets in at least\nthe following two ways (though extra options are appreciated):\n\n1) print just the payload of all *VALID* messages with the urgent flag\n2) display the full packet for ALL messages with the unknown flag and\n   a payload length of at least 10.\n\nAdditionally I would like to have:\n\n3) some sort of \"pretty print\" breakout option for each of the fields\n\nI will be paying attention to how you access the data as well as\nlooking at how you solve (intentionally) ambiguous cases.  If it can't\nbe derived from the sample data, feel free to make assumptions and \ndocument why you made them.  (You can also ask questions if you're \nunsure.)\n\nI'll be testing this on Linux and would like a solution in C or C++.  \nBonus points if it's a library and can also work in Python.  Super\nextra bonus points if you figure out what the payload is.  (Note:\ndon't waste too much time there.)\n\nPlease also provide a simple Makefile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbmueller%2Fpacket_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbmueller%2Fpacket_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbmueller%2Fpacket_parser/lists"}