Skip to content

Commit

Permalink
Default port
Browse files Browse the repository at this point in the history
  • Loading branch information
louisroyer committed Feb 13, 2024
1 parent 2507d2a commit 9d05489
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pfcp-address: "10.0.60.3"
http-address: "10.0.61.2"
http-address: "192.0.2.2"
http-port: "8080"
debug: true
8 changes: 4 additions & 4 deletions json_api/control_url.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"net/url"
)

type ControlURL struct {
type ControlURI struct {
url.URL
}

func (u *ControlURL) UnmarshalText(text []byte) error {
func (u *ControlURI) UnmarshalText(text []byte) error {
if text[len(text)-1] == '/' {
return fmt.Errorf("Control URL should not contains trailing slash.")
return fmt.Errorf("Control URI should not contains trailing slash.")
}
if a, err := url.ParseRequestURI(string(text[:])); err != nil {
return err
Expand All @@ -25,6 +25,6 @@ func (u *ControlURL) UnmarshalText(text []byte) error {
}
return nil
}
func (u ControlURL) MarshalJSON() ([]byte, error) {
func (u ControlURI) MarshalJSON() ([]byte, error) {
return json.Marshal(u.String())
}
2 changes: 1 addition & 1 deletion json_api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ package json_api
type Router struct {
Locator Locator `json:"locator"` // locator (ipv6 prefix)
Backbone BackboneIP `json:"backbone"` // data plane backbone ipv6 address
Control ControlURL `json:"control"` // url used for control
Control ControlURI `json:"control"` // url used for control
}
2 changes: 1 addition & 1 deletion runtime/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ func ParseConf(file string) error {
type CtrlConfig struct {
PFCPAddress *string `yaml:"pfcp-address,omitempty"`
HTTPAddress *string `yaml:"http-address,omitempty"`
HTTPPort *string `yaml:http-port,omitempty"`
HTTPPort *string `yaml:http-port,omitempty"` // default: 80
Debug *bool `yaml:debug,omitempty"`
}
2 changes: 1 addition & 1 deletion runtime/upf.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func createHttpServer() error {
if Ctrl.HTTPAddress == nil {
return fmt.Errorf("Missing http address")
}
port := "8080"
port := "80" // default http port
if Ctrl.HTTPPort != nil {
port = *Ctrl.HTTPPort
}
Expand Down

0 comments on commit 9d05489

Please sign in to comment.