mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
ips: add ProfileID field to AllocatedIP definition
This commit is contained in:
committed by
Dan Christian Bogos
parent
3f107a5c18
commit
0dee8bac04
21
utils/ips.go
21
utils/ips.go
@@ -381,9 +381,10 @@ func (a *PoolAllocation) Clone() *PoolAllocation {
|
||||
|
||||
// AllocatedIP represents one IP allocated on a pool, together with the message.
|
||||
type AllocatedIP struct {
|
||||
PoolID string
|
||||
Message string
|
||||
Address netip.Addr
|
||||
ProfileID string
|
||||
PoolID string
|
||||
Message string
|
||||
Address netip.Addr
|
||||
}
|
||||
|
||||
// IPAllocations represents IP allocations with usage tracking and TTL management.
|
||||
@@ -461,9 +462,10 @@ func (a *IPAllocations) AllocateIPOnPool(allocID string, pool *IPPool,
|
||||
}
|
||||
a.TTLIndex = append(a.TTLIndex, allocID)
|
||||
return &AllocatedIP{
|
||||
PoolID: pool.ID,
|
||||
Message: pool.Message,
|
||||
Address: poolAlloc.Address,
|
||||
ProfileID: a.ID,
|
||||
PoolID: pool.ID,
|
||||
Message: pool.Message,
|
||||
Address: poolAlloc.Address,
|
||||
}, nil
|
||||
}
|
||||
poolRange := a.poolRanges[pool.ID]
|
||||
@@ -478,9 +480,10 @@ func (a *IPAllocations) AllocateIPOnPool(allocID string, pool *IPPool,
|
||||
}
|
||||
}
|
||||
allocIP := &AllocatedIP{
|
||||
PoolID: pool.ID,
|
||||
Message: pool.Message,
|
||||
Address: addr,
|
||||
ProfileID: a.ID,
|
||||
PoolID: pool.ID,
|
||||
Message: pool.Message,
|
||||
Address: addr,
|
||||
}
|
||||
if dryRun {
|
||||
return allocIP, nil
|
||||
|
||||
Reference in New Issue
Block a user