{"id":20445852,"url":"https://github.com/rapid7/network_interface","last_synced_at":"2025-04-13T07:49:14.618Z","repository":{"id":9302947,"uuid":"11141234","full_name":"rapid7/network_interface","owner":"rapid7","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-13T14:46:27.000Z","size":52,"stargazers_count":9,"open_issues_count":5,"forks_count":28,"subscribers_count":119,"default_branch":"master","last_synced_at":"2025-04-13T07:49:11.791Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rapid7.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":"2013-07-03T03:39:17.000Z","updated_at":"2025-02-13T14:46:30.000Z","dependencies_parsed_at":"2025-02-24T03:10:54.117Z","dependency_job_id":"090ad96a-d06c-4916-89f2-b7da683ebd00","html_url":"https://github.com/rapid7/network_interface","commit_stats":{"total_commits":33,"total_committers":7,"mean_commits":4.714285714285714,"dds":"0.33333333333333337","last_synced_commit":"2612bfb4b6feeb0365051185fa590bd2118bf101"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fnetwork_interface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fnetwork_interface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fnetwork_interface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fnetwork_interface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rapid7","download_url":"https://codeload.github.com/rapid7/network_interface/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"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":[],"created_at":"2024-11-15T10:14:51.287Z","updated_at":"2025-04-13T07:49:14.592Z","avatar_url":"https://github.com/rapid7.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetworkInterface\n\nA simple Ruby wrapper for accessing network interface information\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'network_interface'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install network_interface\n\n## Usage\n\n```ruby\nrequire 'network_interface'\n\nputs NetworkInterface.interfaces\nputs NetworkInterface.addresses('eth0')\n```\n\n## Development\n\nCompiling:\n\n```\nbundle install\nbundle exec rake clean\nbundle exec rake compile\n```\n\nRunning the test suite, requires `ifconfig`/`ipconfig` to be installed:\n\n```\nbundle exec rspec\n```\n\nTo debug with GDB:\n\n1. Optional: Explicitly add `asm(\"int3\");` into the C code that you wish to have a breakpoint for:\n\n```c\nVALUE rb_cNetworkInterface;\nvoid\nInit_network_interface_ext()\n{\n    asm(\"int3\");\n\n    // ...\n}\n```\n\n2. Compile and start GDB:\n\n```shell\nbundle exec rake compile\ngdb run --args ruby -e '$LOAD_PATH.unshift(File.join(Dir.pwd, \"lib\")); require(\"network_interface\"); puts NetworkInterface.interfaces'\n```\n\n3. Add a runtime breakpoint:\n\n```shell\n(gdb) add-symbol-file ./lib/network_interface_ext.so\nReading symbols from ./lib/network_interface_ext.so...\n\n(gdb) break Init_network_interface_ext\nBreakpoint 1 at 0x1850: file ../../../../ext/network_interface_ext/netifaces.c, line 825.\n\n(gdb) run\nStarting program: /usr/bin/ruby -e \\$LOAD_PATH.unshift\\(File.join\\(Dir.pwd,\\ \\\"lib\\\"\\)\\)\\;\\ require\\(\\\"network_interface\\\"\\)\\;\\ puts\\ NetworkInterface.interfaces\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\n\nBreakpoint 1.2, Init_network_interface_ext () at ../../../../ext/network_interface_ext/netifaces.c:825\n825             rb_cNetworkInterface = rb_define_module(\"NetworkInterface\");\n(gdb)\n```\n\nTo use a development build of this gem in another project, add this to the target project's `Gemfile`:\n\n```\ngem 'network_interface', path: '../network_interface'\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapid7%2Fnetwork_interface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frapid7%2Fnetwork_interface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapid7%2Fnetwork_interface/lists"}