Skip to content

Commit

Permalink
fix uint32 type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Nov 1, 2020
1 parent 9924ac9 commit c211d53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ var release = "devel" // This is set by go build

// Peer contains all information specific to a single peer network
type Peer struct {
Asn uint32 `yaml:"asn" toml:"ASN" json:"asn"`
Asn uint `yaml:"asn" toml:"ASN" json:"asn"`
Type string `yaml:"type" toml:"Type" json:"type"`
Prepends uint32 `yaml:"prepends" toml:"Prepends" json:"prepends"`
LocalPref uint32 `yaml:"local-pref" toml:"LocalPref" json:"local-pref"`
Prepends uint `yaml:"prepends" toml:"Prepends" json:"prepends"`
LocalPref uint `yaml:"local-pref" toml:"LocalPref" json:"local-pref"`
Multihop bool `yaml:"multihop" toml:"Multihop" json:"multihop"`
Passive bool `yaml:"passive" toml:"Passive" json:"passive"`
Disabled bool `yaml:"disabled" toml:"Disabled" json:"disabled"`
Expand All @@ -49,7 +49,7 @@ type Peer struct {

// Config contains global configuration about this router and BCG instance
type Config struct {
Asn uint32 `yaml:"asn" toml:"ASN" json:"asn"`
Asn uint `yaml:"asn" toml:"ASN" json:"asn"`
RouterId string `yaml:"router-id" toml:"Router-ID" json:"router-id"`
Prefixes []string `yaml:"prefixes" toml:"Prefixes" json:"prefixes"`
Peers map[string]*Peer `yaml:"peers" toml:"Peers" json:"peers"`
Expand Down Expand Up @@ -90,7 +90,7 @@ var (
)

// Query PeeringDB for an ASN
func getPeeringDbData(asn uint32) PeeringDbData {
func getPeeringDbData(asn uint) PeeringDbData {
httpClient := http.Client{Timeout: time.Second * 5}
req, err := http.NewRequest(http.MethodGet, "https://peeringdb.com/api/net?asn="+strconv.Itoa(int(asn)), nil)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions templates/peer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ protocol bgp {{ $peer.Name }}v{{ $af }}_{{ $i }} {
{{- if not (eq $peer.Prepends 0) }}
{{- range $i := Iterate $peer.Prepends }}
bgp_path.prepend(ASN);
{{- end -}}
{{- end -}}
{{ if eq $peer.Type "upstream" -}}
{{ end }}
{{ end }}
{{- if eq $peer.Type "upstream" -}}
bgp_large_community.add((ASN,0,101)); # Learned from upstream
accept;
{{ else if eq $peer.Type "peer" -}}
Expand Down

0 comments on commit c211d53

Please sign in to comment.