@@ -23,49 +23,49 @@ import (
2323
2424// RFC 3261 compliant validation functions for SIP headers and messages
2525
26- type AllowedCharacters struct {
26+ type allowedCharacters struct {
2727 ascii [127 ]bool
2828 utf8 bool
2929}
3030
31- func NewAllowedCharacters () * AllowedCharacters {
32- return & AllowedCharacters {}
31+ func NewAllowedCharacters () * allowedCharacters {
32+ return & allowedCharacters {}
3333}
3434
35- func (a * AllowedCharacters ) AddUTF8 () error {
35+ func (a * allowedCharacters ) AddUTF8 () error {
3636 a .utf8 = true
3737 return nil
3838}
3939
40- func (a * AllowedCharacters ) AddNumbers () error {
40+ func (a * allowedCharacters ) AddNumbers () error {
4141 for r := '0' ; r <= '9' ; r ++ {
4242 a .ascii [r ] = true
4343 }
4444 return nil
4545}
4646
47- func (a * AllowedCharacters ) AddLowercaseASCII () error {
47+ func (a * allowedCharacters ) AddLowercaseASCII () error {
4848 for r := 'a' ; r <= 'z' ; r ++ {
4949 a .ascii [r ] = true
5050 }
5151 return nil
5252}
5353
54- func (a * AllowedCharacters ) AddUppercaseASCII () error {
54+ func (a * allowedCharacters ) AddUppercaseASCII () error {
5555 for r := 'A' ; r <= 'Z' ; r ++ {
5656 a .ascii [r ] = true
5757 }
5858 return nil
5959}
6060
61- func (a * AllowedCharacters ) AddPrintableLienarASCII () {
61+ func (a * allowedCharacters ) AddPrintableLienarASCII () {
6262 // Anything between 0x20 and 0x7E
6363 for i := 0x20 ; i <= 0x7E ; i ++ {
6464 a .ascii [i ] = true
6565 }
6666}
6767
68- func (a * AllowedCharacters ) Add (chars string ) error {
68+ func (a * allowedCharacters ) Add (chars string ) error {
6969 for _ , char := range chars {
7070 if int (char ) >= len (a .ascii ) {
7171 return fmt .Errorf ("char %d out of range, consider explicilty adding utf8 characters" , char )
@@ -75,7 +75,7 @@ func (a *AllowedCharacters) Add(chars string) error {
7575 return nil
7676}
7777
78- func (a * AllowedCharacters ) Remove (chars string ) error {
78+ func (a * allowedCharacters ) Remove (chars string ) error {
7979 for _ , char := range chars {
8080 if int (char ) >= len (a .ascii ) {
8181 return fmt .Errorf ("char %d out of range, consider explicilty adding utf8 characters" , char )
@@ -85,14 +85,14 @@ func (a *AllowedCharacters) Remove(chars string) error {
8585 return nil
8686}
8787
88- func (a * AllowedCharacters ) Copy () * AllowedCharacters {
89- return & AllowedCharacters {
88+ func (a * allowedCharacters ) Copy () * allowedCharacters {
89+ return & allowedCharacters {
9090 ascii : a .ascii ,
9191 utf8 : a .utf8 ,
9292 }
9393}
9494
95- func (a * AllowedCharacters ) Validate (target string ) error {
95+ func (a * allowedCharacters ) Validate (target string ) error {
9696 for _ , char := range target {
9797 if int (char ) >= len (a .ascii ) && ! a .utf8 {
9898 return fmt .Errorf ("char %d out of range, consider explicilty adding utf8 characters" , char )
@@ -104,9 +104,9 @@ func (a *AllowedCharacters) Validate(target string) error {
104104 return nil
105105}
106106
107- var tokenCharacters * AllowedCharacters
108- var displayNameCharacters * AllowedCharacters
109- var headerValuesCharacters * AllowedCharacters
107+ var tokenCharacters * allowedCharacters
108+ var displayNameCharacters * allowedCharacters
109+ var headerValuesCharacters * allowedCharacters
110110
111111func init () {
112112 // Per RFC 3261 Section 25.1
0 commit comments