{"id":13548386,"url":"https://github.com/named-data/ndn-tools","last_synced_at":"2026-01-11T10:59:06.943Z","repository":{"id":27410045,"uuid":"30886947","full_name":"named-data/ndn-tools","owner":"named-data","description":"NDN Essential Tools","archived":false,"fork":false,"pushed_at":"2025-03-25T05:32:42.000Z","size":2126,"stargazers_count":90,"open_issues_count":0,"forks_count":69,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-25T06:27:18.137Z","etag":null,"topics":["cli","cpp","ndn"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/named-data.png","metadata":{"files":{"readme":"README-dev.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-16T20:33:47.000Z","updated_at":"2025-03-25T05:32:46.000Z","dependencies_parsed_at":"2023-02-12T08:30:37.417Z","dependency_job_id":"2fcc79ea-71f7-4b09-8092-141d7016c9d5","html_url":"https://github.com/named-data/ndn-tools","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/named-data%2Fndn-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/named-data%2Fndn-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/named-data%2Fndn-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/named-data%2Fndn-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/named-data","download_url":"https://codeload.github.com/named-data/ndn-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246895745,"owners_count":20851322,"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","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":["cli","cpp","ndn"],"created_at":"2024-08-01T12:01:09.655Z","updated_at":"2026-01-11T10:59:06.907Z","avatar_url":"https://github.com/named-data.png","language":"C++","funding_links":[],"categories":["C++","cpp"],"sub_categories":[],"readme":"# Notes for ndn-tools developers\n\n## Licensing Requirements\n\nContributions to ndn-tools must be licensed under the GPL v3 or a compatible license.\nIf you choose the GPL v3, please use the following license boilerplate in all `.hpp`\nand `.cpp` files:\n\n```cpp\n/* -*- Mode:C++; c-file-style:\"gnu\"; indent-tabs-mode:nil; -*- */\n/*\n * Copyright (c) [Year(s)], [Copyright Holder(s)].\n *\n * This file is part of ndn-tools (Named Data Networking Essential Tools).\n * See AUTHORS.md for complete list of ndn-tools authors and contributors.\n *\n * ndn-tools is free software: you can redistribute it and/or modify it under the terms\n * of the GNU General Public License as published by the Free Software Foundation,\n * either version 3 of the License, or (at your option) any later version.\n *\n * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n * PURPOSE.  See the GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License along with\n * ndn-tools, e.g., in COPYING.md file.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n */\n```\n\n## Directory Structure and Build Script\n\nAll tools are placed in subdirectories of the [`tools`](tools) directory.\n\nA tool can consist of one or more programs.\nFor instance, a pair of consumer and producer programs that are designed to work together\nshould be considered a single tool, not two separate tools.\n\nEach tool must have a `wscript` build script in its subdirectory. This script will be\ninvoked automatically if the corresponding tool is selected for the build. It should\ncompile the source code and produce one or more binaries in the `build/bin` directory\n(e.g., use `target='../../bin/foo'`).\n\n### Shared Modules\n\nModules shared among multiple tools should be placed in the [`core`](core) directory.\nThey are available for use in all tools.\n\nA header in `core/` can be included in a tool like `#include \"core/foo.hpp\"`.\n\nThe `wscript` of a tool can link a program with modules in `core/` with `use='core-objects'`.\n\n### Documentation\n\nA file named `README.md` in the subdirectory of each tool should provide a brief\ndescription.\n\nManual pages for each program should be written in reStructuredText format\nand placed in the [`manpages`](manpages) directory.\n\n## Code Guidelines\n\nC++ code should conform to the\n[ndn-cxx code style](https://docs.named-data.net/ndn-cxx/current/code-style.html).\n\n### Namespace\n\nTypes in each tool should be declared in a sub-namespace inside `namespace ndn`.\nFor example, a tool in `tools/foo` directory has namespace `ndn::foo`.\nThis allows the tool to reference ndn-cxx types with unqualified name lookup.\nThis also prevents name conflicts between ndn-cxx and tools.\n\nTypes in `core/` should be declared directly inside `namespace ndn`,\nor in a sub-namespace if desired.\n\n### main Function\n\nThe `main` function of a program should be declared as a static function in\nthe namespace of the corresponding tool. This allows referencing types in\nndn-cxx and the tool via unqualified name lookup.\n\nThen, another (non-static) `main` function must be defined in the global\nnamespace, and from there call the `main` function in the tool namespace.\n\nThese two functions should appear in a file named `main.cpp` in the tool's\nsubdirectory.\n\nExample:\n\n```cpp\nnamespace ndn {\nnamespace foo {\n\nclass Bar\n{\npublic:\n  explicit\n  Bar(Face\u0026 face);\n\n  void\n  run();\n};\n\nstatic int\nmain(int argc, char* argv[])\n{\n  Face face;\n  Bar program(face);\n  program.run();\n  return 0;\n}\n\n} // namespace foo\n} // namespace ndn\n\nint\nmain(int argc, char* argv[])\n{\n  return ndn::foo::main(argc, argv);\n}\n```\n\n### Command Line Arguments\n\n[Boost.Program\\_options](https://www.boost.org/doc/libs/1_71_0/doc/html/program_options.html)\nis strongly preferred over `getopt(3)` for parsing command line arguments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamed-data%2Fndn-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamed-data%2Fndn-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamed-data%2Fndn-tools/lists"}