-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from Galileo-Suite/master
AIX support and build tag fixes
- Loading branch information
Showing
4 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//go:build aix | ||
|
||
package sockaddr | ||
|
||
import ( | ||
"errors" | ||
"os/exec" | ||
) | ||
|
||
var cmds map[string][]string = map[string][]string{ | ||
"route": {"/usr/sbin/route", "-n", "get", "default"}, | ||
} | ||
|
||
// NewRouteInfo returns a BSD-specific implementation of the RouteInfo | ||
// interface. | ||
func NewRouteInfo() (routeInfo, error) { | ||
return routeInfo{ | ||
cmds: cmds, | ||
}, nil | ||
} | ||
|
||
// GetDefaultInterfaceName returns the interface name attached to the default | ||
// route on the default interface. | ||
func (ri routeInfo) GetDefaultInterfaceName() (string, error) { | ||
out, err := exec.Command(cmds["route"][0], cmds["route"][1:]...).Output() | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
var ifName string | ||
if ifName, err = parseDefaultIfNameFromRoute(string(out)); err != nil { | ||
return "", errors.New("No default interface found") | ||
} | ||
return ifName, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build solaris | ||
|
||
package sockaddr | ||
|
||
import ( | ||
|