# USB/IP Server Configuration - Tree Pattern Examples

# Example 1: Share all devices on a specific USB hub
listenAddress: 0.0.0.0
listenPort: 3240
logLevel: info
devices:
  # Tree pattern - all devices under this hub
  - path: "pci-0000:00:14.0-usb-0:1:**"
    description: "All devices on USB hub at port 1"
    allowedClients: []  # Allow all clients

  # Exact device match (backward compatible)
  - path: "pci-0000:00:14.0-usb-0:2:1.0"
    description: "Specific USB device on port 2.1"
    allowedClients: ["client1"]

---

# Example 2: Multiple identical devices on different ports
listenAddress: 0.0.0.0
listenPort: 3240
logLevel: info
devices:
  # Option A: Specify each device explicitly
  - path: "pci-0000:00:14.0-usb-0:1:1.0"
    description: "USB Dongle #1"
  - path: "pci-0000:00:14.0-usb-0:1:2.0"
    description: "USB Dongle #2"
  - path: "pci-0000:00:14.0-usb-0:1:3.0"
    description: "USB Dongle #3"

  # Option B: Use tree pattern to share all at once
  # - path: "pci-0000:00:14.0-usb-0:1:**"
  #   description: "All USB dongles on hub port 1"

---

# Example 3: Filtered tree pattern (only specific vendor)
listenAddress: 0.0.0.0
listenPort: 3240
logLevel: info
devices:
  - path: "pci-0000:00:14.0-usb-0:1:**"
    vendorId: "1234"
    description: "Only vendor 1234 devices from hub"
    allowedClients: ["trusted-client"]

---

# Example 4: Mixed exact and tree patterns with access control
listenAddress: 0.0.0.0
listenPort: 3240
logLevel: info
devices:
  # Hub 1 - accessible to client A
  - path: "pci-0000:00:14.0-usb-0:1:**"
    description: "Hub 1 - All devices for Client A"
    allowedClients: ["clientA"]
  
  # Hub 2 - accessible to client B
  - path: "pci-0000:00:14.0-usb-0:2:**"
    description: "Hub 2 - All devices for Client B"
    allowedClients: ["clientB"]
  
  # Specific device - accessible to all
  - path: "pci-0000:00:14.0-usb-0:3:1.0"
    description: "Shared printer"
    allowedClients: []
