<commit_before>require 'rbsigar'

sigar = Sigar.new
iflist = sigar.net_interface_list

iflist.each do |ifname|
  ifconfig = sigar.net_interface_config(ifname)
  flags = ifconfig.flags
  encap = ifconfig.type
  hwaddr = ifconfig.hwaddr

  puts ifname + "\t" + "Link encap:" + encap + hwaddr
  ptp = "" #XXX
  bcast = "" #XXX

  puts "\t" + "inet addr:" + ifconfig.address +
    ptp + bcast + " Mask:" + ifconfig.netmask

  puts "\t" +
    Sigar.net_interface_flags_to_s(flags) +
    " MTU:" + ifconfig.mtu.to_s +
    " Metric:" + ifconfig.metric.to_s<commit_msg>add ptp and broadcast<commit_after>require 'rbsigar'

sigar = Sigar.new
iflist = sigar.net_interface_list

iflist.each do |ifname|
  ifconfig = sigar.net_interface_config(ifname)
  flags = ifconfig.flags
  encap = ifconfig.type
  hwaddr = ifconfig.hwaddr

  puts ifname + "\t" + "Link encap:" + encap + hwaddr

  if (flags & Sigar::IFF_POINTOPOINT) != 0
    ptp = "  P-t-P:" + ifconfig.destination
  else
    ptp = ""
  end

  if (flags & Sigar::IFF_BROADCAST) != 0
    bcast = "  Bcast:" + ifconfig.broadcast
  else
    bcast = ""
  end

  puts "\t" + "inet addr:" + ifconfig.address +
    ptp + bcast + " Mask:" + ifconfig.netmask

  puts "\t" +
    Sigar.net_interface_flags_to_s(flags) +
    " MTU:" + ifconfig.mtu.to_s +
    " Metric:" + ifconfig.metric.to_s
{'fraction_non_alphanumeric': 0.13746223564954682, 'fraction_numerical': 0.0015105740181268882, 'mean_word_length': 3.1930379746835444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6119958', 'n_tokens_mistral': 535, 'n_tokens_neox': 526, 'n_words': 106}