host_tap.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package compute
  15. const (
  16. HostVpcBridge = "__vpc_bridge__"
  17. HostTapBridge = "__tap_bridge__"
  18. HostLocalBridge = "brlocal"
  19. )
  20. type SMirrorConfig struct {
  21. TapHostIp string `json:"tap_host_ip"`
  22. HostIp string `json:"host_ip"`
  23. Port string `json:"port"`
  24. Bridge string `json:"bridge"`
  25. FlowId uint16 `json:"flow_id"`
  26. VlanId int `json:"vlan_id"`
  27. Direction string `json:"direction"`
  28. }
  29. /*
  30. type SHostBridgeMirrorConfig struct {
  31. TapHostIp string `json:"tap_host_ip"`
  32. HostIp string `json:"host_ip"`
  33. Bridge string `json:"bridge"`
  34. Direction string `json:"direction"`
  35. FlowId uint16 `json:"flow_id"`
  36. VlanId []int `json:"vlan_id"`
  37. Port []string `json:"port"`
  38. }
  39. */
  40. type STapServiceConfig struct {
  41. TapHostIp string `json:"tap_host_ip"`
  42. MacAddr string `json:"mac_addr"`
  43. Ifname string `json:"ifname"`
  44. Mirrors []SMirrorConfig `json:"mirrors"`
  45. }
  46. type SHostTapConfig struct {
  47. Taps []STapServiceConfig `json:"taps"`
  48. Mirrors []SMirrorConfig `json:"mirrors"`
  49. }