|
8 | 8 |
|
9 | 9 | "github.com/hashicorp/terraform/helper/hashcode"
|
10 | 10 | "github.com/hashicorp/terraform/helper/schema"
|
| 11 | + "github.com/hashicorp/terraform/helper/validation" |
11 | 12 | )
|
12 | 13 |
|
13 | 14 | func route() *schema.Resource {
|
@@ -62,6 +63,20 @@ func resourceZeroTierNetwork() *schema.Resource {
|
62 | 63 | Optional: true,
|
63 | 64 | Default: true,
|
64 | 65 | },
|
| 66 | + //Warning: Undecoumented on the API, but that is how the UI manages it |
| 67 | + "broadcast": &schema.Schema{ |
| 68 | + Type: schema.TypeBool, |
| 69 | + Description: "Enable network broadcast (ff:ff:ff:ff:ff:ff)", |
| 70 | + Optional: true, |
| 71 | + Default: true, |
| 72 | + }, |
| 73 | + "multicast_limit": &schema.Schema{ |
| 74 | + Type: schema.TypeInt, |
| 75 | + Description: "The maximum number of recipients that can receive an Ethernet multicast or broadcast. Setting to 0 disables multicast, but be aware that only IPv6 with NDP emulation (RFC4193 or 6PLANE addressing modes) or other unicast-only protocols will work without multicast.", |
| 76 | + Optional: true, |
| 77 | + Default: 32, |
| 78 | + ValidateFunc: validation.IntAtLeast(0), |
| 79 | + }, |
65 | 80 | "route": &schema.Schema{
|
66 | 81 | Type: schema.TypeList,
|
67 | 82 | Optional: true,
|
@@ -144,6 +159,8 @@ func fromResourceData(d *schema.ResourceData) (*Network, error) {
|
144 | 159 | Config: &Config{
|
145 | 160 | Name: d.Get("name").(string),
|
146 | 161 | Private: d.Get("private").(bool),
|
| 162 | + EnableBroadcast: d.Get("broadcast").(bool), |
| 163 | + MulticastLimit: d.Get("multicast_limit").(int), |
147 | 164 | V4AssignMode: V4AssignModeConfig{ZT: true},
|
148 | 165 | Routes: routes,
|
149 | 166 | IpAssignmentPools: pools,
|
@@ -186,6 +203,8 @@ func resourceNetworkRead(d *schema.ResourceData, m interface{}) error {
|
186 | 203 | d.Set("name", net.Config.Name)
|
187 | 204 | d.Set("description", net.Description)
|
188 | 205 | d.Set("private", net.Config.Private)
|
| 206 | + d.Set("broadcast", net.Config.EnableBroadcast) |
| 207 | + d.Set("multicast_limit", net.Config.MulticastLimit) |
189 | 208 | d.Set("auto_assign_v4", net.Config.V4AssignMode.ZT)
|
190 | 209 | d.Set("rules_source", net.RulesSource)
|
191 | 210 |
|
|
0 commit comments