Skip to content

Commit

Permalink
Move go/sig/internal/disp to go/lib (scionproto#3671)
Browse files Browse the repository at this point in the history
  • Loading branch information
sustrik authored and stygerma committed Mar 18, 2020
1 parent af7a108 commit 43a978d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["disp.go"],
importpath = "github.com/scionproto/scion/go/sig/internal/disp",
importpath = "github.com/scionproto/scion/go/lib/sigdisp",
visibility = ["//visibility:public"],
deps = [
"//go/lib/addr:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion go/sig/internal/disp/disp.go → go/lib/sigdisp/disp.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package disp
package sigdisp

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion go/sig/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ go_library(
"//go/lib/log:go_default_library",
"//go/lib/prom:go_default_library",
"//go/lib/serrors:go_default_library",
"//go/lib/sigdisp:go_default_library",
"//go/sig/config:go_default_library",
"//go/sig/egress:go_default_library",
"//go/sig/internal/base:go_default_library",
"//go/sig/internal/disp:go_default_library",
"//go/sig/internal/ingress:go_default_library",
"//go/sig/internal/metrics:go_default_library",
"//go/sig/internal/sigcmn:go_default_library",
Expand Down
2 changes: 1 addition & 1 deletion go/sig/egress/session/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ go_library(
"//go/lib/pathmgr:go_default_library",
"//go/lib/pktdisp:go_default_library",
"//go/lib/ringbuf:go_default_library",
"//go/lib/sigdisp:go_default_library",
"//go/lib/snet:go_default_library",
"//go/lib/spath/spathmeta:go_default_library",
"//go/sig/egress/iface:go_default_library",
"//go/sig/egress/siginfo:go_default_library",
"//go/sig/egress/worker:go_default_library",
"//go/sig/internal/disp:go_default_library",
"//go/sig/internal/metrics:go_default_library",
"//go/sig/internal/sigcmn:go_default_library",
],
Expand Down
12 changes: 6 additions & 6 deletions go/sig/egress/session/sessmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"github.com/scionproto/scion/go/lib/ctrl/sig_mgmt"
"github.com/scionproto/scion/go/lib/infra"
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/sigdisp"
"github.com/scionproto/scion/go/sig/egress/iface"
"github.com/scionproto/scion/go/sig/egress/siginfo"
"github.com/scionproto/scion/go/sig/internal/disp"
"github.com/scionproto/scion/go/sig/internal/metrics"
"github.com/scionproto/scion/go/sig/internal/sigcmn"
)
Expand Down Expand Up @@ -81,9 +81,9 @@ func (sm *sessMonitor) run() {
pathExpiryTick := time.NewTicker(pathExpiryLen)
defer pathExpiryTick.Stop()
// Register with SIG ctrl dispatcher
regc := make(disp.RegPldChan, 1)
disp.Dispatcher.Register(disp.RegPollRep,
disp.MkRegPollKey(sm.sess.IA(), sm.sess.SessId, 0), regc)
regc := make(sigdisp.RegPldChan, 1)
sigdisp.Dispatcher.Register(sigdisp.RegPollRep,
sigdisp.MkRegPollKey(sm.sess.IA(), sm.sess.SessId, 0), regc)
sm.lastReply = time.Now()
// Start by querying for the remote SIG instance.
sm.smRemote = &iface.RemoteInfo{
Expand All @@ -108,7 +108,7 @@ Top:
sm.sessPathPool.ExpireFails()
}
}
err := disp.Dispatcher.Unregister(disp.RegPollRep, disp.MkRegPollKey(sm.sess.IA(),
err := sigdisp.Dispatcher.Unregister(sigdisp.RegPollRep, sigdisp.MkRegPollKey(sm.sess.IA(),
sm.sess.SessId, 0))
if err != nil {
log.Error("sessMonitor: unable to unregister from ctrl dispatcher", "err", err)
Expand Down Expand Up @@ -292,7 +292,7 @@ func (sm *sessMonitor) sendReq() {
metrics.SessionProbes.WithLabelValues(sm.sess.IA().String(), sm.sess.SessId.String()).Inc()
}

func (sm *sessMonitor) handleRep(rpld *disp.RegPld) {
func (sm *sessMonitor) handleRep(rpld *sigdisp.RegPld) {
pollRep, ok := rpld.P.(*sig_mgmt.PollRep)
if !ok {
sm.Error("sessMonitor: non-SIGPollRep payload received",
Expand Down
2 changes: 1 addition & 1 deletion go/sig/internal/base/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ go_library(
"//go/lib/ctrl/sig_mgmt:go_default_library",
"//go/lib/infra:go_default_library",
"//go/lib/log:go_default_library",
"//go/lib/sigdisp:go_default_library",
"//go/lib/snet:go_default_library",
"//go/sig/internal/disp:go_default_library",
"//go/sig/internal/sigcmn:go_default_library",
],
)
4 changes: 2 additions & 2 deletions go/sig/internal/base/pollhdlr.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (
"github.com/scionproto/scion/go/lib/ctrl/sig_mgmt"
"github.com/scionproto/scion/go/lib/infra"
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/sigdisp"
"github.com/scionproto/scion/go/lib/snet"
"github.com/scionproto/scion/go/sig/internal/disp"
"github.com/scionproto/scion/go/sig/internal/sigcmn"
)

func PollReqHdlr() {
log.Info("PollReqHdlr: starting")
for rpld := range disp.Dispatcher.PollReqC {
for rpld := range sigdisp.Dispatcher.PollReqC {
req, ok := rpld.P.(*sig_mgmt.PollReq)
if !ok {
log.Error("PollReqHdlr: non-SIGPollReq payload received",
Expand Down
4 changes: 2 additions & 2 deletions go/sig/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import (
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/prom"
"github.com/scionproto/scion/go/lib/serrors"
"github.com/scionproto/scion/go/lib/sigdisp"
"github.com/scionproto/scion/go/sig/config"
"github.com/scionproto/scion/go/sig/egress"
"github.com/scionproto/scion/go/sig/internal/base"
"github.com/scionproto/scion/go/sig/internal/disp"
"github.com/scionproto/scion/go/sig/internal/ingress"
"github.com/scionproto/scion/go/sig/internal/metrics"
"github.com/scionproto/scion/go/sig/internal/sigcmn"
Expand Down Expand Up @@ -93,7 +93,7 @@ func realMain() int {
log.Info("reloadOnSIGHUP: reload done", "success", success)
},
)
disp.Init(sigcmn.CtrlConn, false)
sigdisp.Init(sigcmn.CtrlConn, false)
// Parse sig config
if loadConfig(cfg.Sig.SIGConfig) != true {
log.Crit("Unable to load sig config on startup")
Expand Down

0 comments on commit 43a978d

Please sign in to comment.