You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
844 B
Go

1 year ago
package common
type NetIdentity struct {
SSI uint32
MNC uint16
MCC uint16
}
func (identity *NetIdentity) IsValid() bool {
return identity.SSI > 0
}
type TetraFlexAddressKind byte
const (
SSI TetraFlexAddressKind = 0
UserNo TetraFlexAddressKind = 1
)
type TetraFlexAddress struct {
Kind TetraFlexAddressKind
UserNo string
TSI NetIdentity
}
func NewAddress() (addr *TetraFlexAddress) {
return &TetraFlexAddress{
Kind: SSI,
UserNo: "",
TSI: NetIdentity{
SSI: 0,
MNC: 0,
MCC: 0,
},
}
}
1 year ago
func NewAddressFromSSINumber(ssi uint32) (addr *TetraFlexAddress) {
1 year ago
return &TetraFlexAddress{
Kind: SSI,
UserNo: "",
TSI: NetIdentity{
1 year ago
SSI: ssi,
1 year ago
MNC: 0,
MCC: 0,
},
}
}
var TetraFlexAddressEmpty = TetraFlexAddress{
Kind: SSI,
UserNo: "",
TSI: NetIdentity{
SSI: 0,
MNC: 0,
MCC: 0,
},
}