File: list_interfaces.rb

package info (click to toggle)
ruby-nfnetlink 1.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 136 kB
  • sloc: ruby: 136; makefile: 8
file content (7 lines) | stat: -rw-r--r-- 177 bytes parent folder | download
1
2
3
4
5
6
7
#!/usr/bin/env ruby

require 'nfnetlink'

Netfilter::Netlink.interfaces.each do |iface|
    puts "[%d] %12s: %s" % [ iface[:index], iface[:name], iface[:flags].join(", ") ]
end