{"id":29675860,"url":"https://github.com/oxidecomputer/ispf","last_synced_at":"2025-07-22T23:38:56.082Z","repository":{"id":103490023,"uuid":"425968533","full_name":"oxidecomputer/ispf","owner":"oxidecomputer","description":"An Internet packet format Serde implementation","archived":false,"fork":false,"pushed_at":"2024-08-06T18:43:28.000Z","size":41,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-02-10T00:58:01.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oxidecomputer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-11-08T19:32:33.000Z","updated_at":"2023-01-19T05:25:23.000Z","dependencies_parsed_at":"2024-08-06T21:57:08.628Z","dependency_job_id":"4859740f-72d9-4a07-bcd1-210784e7f760","html_url":"https://github.com/oxidecomputer/ispf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oxidecomputer/ispf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Fispf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Fispf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Fispf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Fispf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxidecomputer","download_url":"https://codeload.github.com/oxidecomputer/ispf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Fispf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266591233,"owners_count":23953082,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":"2025-07-22T23:38:55.428Z","updated_at":"2025-07-22T23:38:56.032Z","avatar_url":"https://github.com/oxidecomputer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Internet-Style Packet Format (ISPF) for Serde\n\nThis crate provides machinery for serializing and deserializing Internet-style\npackets with [Serde](https://serde.rs).\n\n## By Example\n\nConsider the following Internet-style packet\n\n```\n 0                   1                   2                   3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|                              size                             |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|     type      |              tag              |     msize     :\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n:                                               |  version.size :\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n:               |                   version                     :\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n:                               ...                             :\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n```\n\nwith Serde/ISPF this can be represented as\n\n```rust\n#[derive(Debug, Serialize, Deserialize, PartialEq)]\nstruct Version {\n    size: u32,\n    typ: u8,\n    tag: u16,\n    msize: u32,\n    #[serde(with = \"ispf::str_lv16\")]\n    version: String,\n}\n```\n\nThe annotation on `version` in this data structure indicates that `version`\nshould be serialized as a length-value pair with a 16-bit unsigned integer as\nthe length.\n\nA basic round trip to and from wire format is performed as the following\n([full example](examples/main.rs)).\n\n```rust\nlet v = Version{\n    size: 47,\n    typ: 9,\n    tag: 15,\n    msize: 99,\n    version: \"muffin\".into(),\n};\n\nlet out = to_bytes_le(\u0026v)?;\nprintln!(\"{:?}\", out);\n\nlet full_circle: Version = from_bytes_le(out.as_slice())?;\nprintln!(\"{:#?}\", full_circle);\nassert_eq!(v, full_circle);\n```\n\nSo the basic thing that ISPF does is create packed wire representations for Rust\ndata types and provides a configurable means by which to represent types that are\nnot statically sized, such as the `ispf::str_lv64` serializer annotation above.\n\n## Available Formatters\n\n### Strings\n\n- `str_lv8`\n- `str_lv16`\n- `str_lv32`\n- `str_lv64`\n\nLength value represents the number of total bytes in the string.\n\n### Vectors by count\n\n- `vec_lv8`\n- `vec_lv16`\n- `vec_lv32`\n- `vec_lv64`\n\nLength value represents number of elements in the vector.\n\n### Vectors by bytes\n\n- `vec_lv8b`\n- `vec_lv16b`\n- `vec_lv32b`\n- `vec_lv64b`\n\nLength value represents number of total bytes in the vector (the sum of the\nsize of the elements).\n\n## Building\n\n```\ncargo build\ncargo test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxidecomputer%2Fispf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxidecomputer%2Fispf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxidecomputer%2Fispf/lists"}