mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add SrcName() method to return interface name
This method returns the name of the interface from the perspective of the host OS pre-container. This will be required later for finding matching a sandbox's interface name to an endpoint which is, in turn, requied for adding an IP alias to a load balancer endpoint. Signed-off-by: Chris Telfer <ctelfer@docker.com>
This commit is contained in:
parent
31d3de0994
commit
f2c6009583
1 changed files with 7 additions and 0 deletions
|
@ -49,6 +49,9 @@ type InterfaceInfo interface {
|
|||
|
||||
// LinkLocalAddresses returns the list of link-local (IPv4/IPv6) addresses assigned to the endpoint.
|
||||
LinkLocalAddresses() []*net.IPNet
|
||||
|
||||
// SrcName returns the name of the interface w/in the container
|
||||
SrcName() string
|
||||
}
|
||||
|
||||
type endpointInterface struct {
|
||||
|
@ -272,6 +275,10 @@ func (epi *endpointInterface) LinkLocalAddresses() []*net.IPNet {
|
|||
return epi.llAddrs
|
||||
}
|
||||
|
||||
func (epi *endpointInterface) SrcName() string {
|
||||
return epi.srcName
|
||||
}
|
||||
|
||||
func (epi *endpointInterface) SetNames(srcName string, dstPrefix string) error {
|
||||
epi.srcName = srcName
|
||||
epi.dstPrefix = dstPrefix
|
||||
|
|
Loading…
Reference in a new issue