瀏覽代碼

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>
Chris Telfer 7 年之前
父節點
當前提交
f2c6009583
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      libnetwork/endpoint_info.go

+ 7 - 0
libnetwork/endpoint_info.go

@@ -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