Puppet::Type.newtype(:ethtool) do
  @doc = "Manage settings with ethtool."
  newparam(:name)
  {
    :tso => 'if TCP segment offload is enabled or disabled for this interface',
    :ufo => 'Specifies whether UDP fragmentation offload should be enabled or disabled',
    :gso => 'Specifies whether generic segmentation offload should be enabled',
    :gro => 'Specifies whether generic receive offload should be enabled',
    :sg => 'Specifies whether scatter-gather should be enabled',
    :checksum_rx => 'Specifies whether RX checksumming should be enabled',
    :checksum_tx => 'Specifies whether TX checksumming should be enabled',
    :autonegotiate_tx => 'if autonegotiation is enabled or disabled for transmitting',
    :autonegotiate_rx => 'if autonegotiation is enabled or disabled for receiving'
  }.each do |name, description|
    newproperty(name) do
      desc description
      newvalue(:enabled)
      newvalue(:disabled)
    end
  end
end


Puppet::Type.newtype(:ethtool) do
  @doc = "Manage settings with ethtool."
  newparam(:name)
  {
    :tso => 'if TCP segment offload is enabled or disabled for this interface',
    :lro => 'Specifies whether large receive offload should be enabled or disabled',
    :ufo => 'Specifies whether UDP fragmentation offload should be enabled or disabled',
    :gso => 'Specifies whether generic segmentation offload should be enabled',
    :gro => 'Specifies whether generic receive offload should be enabled',
    :sg => 'Specifies whether scatter_gather should be enabled',
    :checksum_rx => 'Specifies whether RX checksumming should be enabled',
    :checksum_tx => 'Specifies whether TX checksumming should be enabled',
    :autonegotiate => 'if autonegotiation is enabled or disabled',
    :autonegotiate_tx => 'if autonegotiation is enabled or disabled for transmitting',
    :autonegotiate_rx => 'if autonegotiation is enabled or disabled for receiving',
    :adaptive_tx => '',
    :adaptive_rx => '',
  }.each do |name, description|
    newproperty(name) do
      desc description if description != ''
      newvalue(:enabled)
      newvalue(:disabled)
    end
  end
  # FIXME - docs
  {:rx_usecs => '', :rx_frames => '', :rx_usecs_irq => '', :rx_frames_irq => '', :tx_usecs => '', :tx_frames => '', :tx_usecs_irq => '', :tx_frames_irq => '',
   :stats_block_usecs => '', :pkt_rate_low => '', :rx_usecs_low => '', :rx_frames_low => '', :tx_usecs_low => '', :tx_frames_low => '', :pkt_rate_high => '',
   :rx_usecs_high => '', :rx_frames_high => '', :tx_usecs_high => '', :tx_frames_high => '', :sample_interval=> ''}.each do |prop_name, prop_docs|
    newproperty(prop_name) do
      desc prop_docs if prop_docs != ''
      # FIXME Allow integers..
    end
  end 
end


Fix up the type to know about the new arguments
Fix up the type to know about the new arguments
