Skip to content

Commit

Permalink
feat: add function to generate wireguard subnet cidr
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmoysrt committed Jan 25, 2025
1 parent ef4a679 commit 4982747
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/ipam/address_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ func GenerateWireguardIP(template string, serverId int) (string, error) {
return binaryFormatToIP(templateString)
}

func GenerateWireguardSubnetCIDR(template string) (int, error) {
t, err := parseTemplate(template)
if err != nil {
return 0, err
}
return t.ServerBitsStartIndex, nil
}

func GenerateWireguardSubnet(template string) (string, error) {
t, err := parseTemplate(template)
if err != nil {
Expand Down

0 comments on commit 4982747

Please sign in to comment.