-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into oncilla-patch-3
- Loading branch information
Showing
15 changed files
with
237 additions
and
18 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
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
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
25 changes: 25 additions & 0 deletions
25
private/path/combinator/testdata/00_core_core_invalid_peering.txt
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,25 @@ | ||
Path #0: | ||
Weight: 5 | ||
Fields: | ||
IF .. | ||
HF InIF=1613 OutIF=0 | ||
HF InIF=0 OutIF=1316 | ||
IF .. | ||
HF InIF=1311 OutIF=0 | ||
HF InIF=1121 OutIF=1113 | ||
HF InIF=2122 OutIF=2111 | ||
HF InIF=0 OutIF=2221 | ||
IF C. | ||
HF InIF=0 OutIF=2224 | ||
HF InIF=2422 OutIF=0 | ||
Interfaces: | ||
1-ff00:0:131#1613 | ||
1-ff00:0:130#1316 | ||
1-ff00:0:130#1311 | ||
1-ff00:0:110#1113 | ||
1-ff00:0:110#1121 | ||
2-ff00:0:210#2111 | ||
2-ff00:0:210#2122 | ||
2-ff00:0:220#2221 | ||
2-ff00:0:220#2224 | ||
2-ff00:0:221#2422 |
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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2024 ETH Zurich | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// In Windows, SetSockOptInt and GetSockOptInt require syscall.Handle instead of int. | ||
//go:build windows | ||
|
||
package sockctrl | ||
|
||
import ( | ||
"net" | ||
"syscall" | ||
|
||
"github.com/scionproto/scion/pkg/private/serrors" | ||
) | ||
|
||
func SockControl(c *net.UDPConn, f func(syscall.Handle) error) error { | ||
rawConn, err := c.SyscallConn() | ||
if err != nil { | ||
return serrors.Wrap("sockctrl: error accessing raw connection", err) | ||
} | ||
var ctrlErr error | ||
err = rawConn.Control(func(fd uintptr) { | ||
ctrlErr = f(syscall.Handle(fd)) | ||
}) | ||
if err != nil { | ||
return serrors.Wrap("sockctrl: RawConn.Control error", err) | ||
} | ||
if ctrlErr != nil { | ||
return serrors.Wrap("sockctrl: control function error", ctrlErr) | ||
} | ||
return 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2024 ETH Zurich | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// In Windows, SetSockOptInt and GetSockOptInt require syscall.Handle instead of int. | ||
//go:build windows | ||
|
||
package sockctrl | ||
|
||
import ( | ||
"net" | ||
"syscall" | ||
) | ||
|
||
func GetsockoptInt(c *net.UDPConn, level, opt int) (int, error) { | ||
var val int | ||
err := SockControl(c, func(fd syscall.Handle) error { | ||
var err error | ||
val, err = syscall.GetsockoptInt(fd, level, opt) | ||
return err | ||
}) | ||
return val, err | ||
} | ||
|
||
func SetsockoptInt(c *net.UDPConn, level, opt, value int) error { | ||
return SockControl(c, func(fd syscall.Handle) error { | ||
return syscall.SetsockoptInt(fd, level, opt, value) | ||
}) | ||
} |
Oops, something went wrong.