unlang(5) FreeRADIUS Processing un-language unlang(5) (NAME) unlang - FreeRADIUS (un-language) (DESCRIPTION) FreeRADIUS . <> . rlm_perl rlm_python . . . ( ) "authorize" "authenticate" "post-auth" "preacct" "accounting" "pre-proxy" "post-proxy" "session" . . (KEYWORDS) . . . . . . . . module-name[.section-name] . . "unlang" . . " " CONDITIONS MODULE RETURN CODES . (section- name) . chap # CHAP sql # SQL ... if . (true) . . CONDITIONS . if (condition) { ... } else "if" (false) . else { ... } elsif "if" (false) (true) . elsif (condition) { ... } foreach (attribute) . . "break" . "break" << >> << >>. "break" . "break" "foreach" . "foreach" "Foreach-Variable-#" "#" "0" "Foreach- Variable-0". (8) . foreach &Attribute-Reference { ... } switch "switch" "case" . "switch" "switch" "case" . "case" . "case" . "case" . ( "%{exec:1 + 2}") DATA TYPES . . ( &User-Name) . . "case" "switch" . switch { ... } case "switch" . "case" "switch" . ( "%{exec:1 + 2}") DATA TYPES . . ( &User-Name) . . case { ... } . "case" . "switch" . case { ... } update . update { &Attribute-Reference = value ... } "request" "reply" "proxy-request" "proxy- reply" "coa" "disconnect" "session-state" "control" . "request" . "control" . "control" . EAP ( PEAP EAP-TTLS) "outer.request" "outer.reply" "outer.control" . . "coa" "disconnect" Access-Request Accounting-Request . CoA-Request Disconnect- Request "coa" "request" "reply" . "coa" "disconnect" CoA-Request Disconnect-Request . Access- Request Accounting-Request NAS . raddb/sites- available/originate-coa . "session-state" EAP . "session- state" . . "update" . "update" ATTRIBUTE REFERENCE ATTRIBUTE ASSIGNMENT . redundant . . . . . Redundant (if else ) . redundant { sql1 # sql2 # sql1 . ... } load-balance . . ( ldap sql). load-balance . Load-balance (if else ) . load-balance { ldap1 # ldap2 # } "load-balance" "redundant-load-balance" . redundant-load-balance . . . . . ( ldap sql). load-balance . Load-balance (if else ) . "instantiate" raddb/radiusd.conf . redundant-load-balance { ldap1 # ldap2 ldap2 # ldap1 } return "authorize" "authenticate" . "if" "else" . authorize { if (...) { ... return } ... # "if" ... # } (ATTRIBUTE REFERENCES) : &Attribute-Name &Attribute-Name:TAG &Attribute-Name[NUM] &:Attribute-Name &:Attribute-Name:TAG[NUM] "update" "request" "reply" "control" "proxy-request" "proxy-reply" "outer.request" "outer.reply" "outer.control" "outer.proxy-request" "outer.proxy-reply" . ":" "request" . TAG . RFC 2868 . "has_tag" . NUM . "Attribute-Name" . . NUM '*' . NUM 'n' . . : User-Name request:User-Name # reply:User-Name Tunnel-Password:1 Cisco-AVPAir[2] outer.request:User-Name # TTLS/PEAP C . . . . . . . . (CONDITIONS) C . (foo) 'foo' ( ) (true) . 'foo' . "0000" . . 'foo' . << >> . (true) . 'foo' . . MODULE RETURN CODES . (Negation) (!foo) 'foo' . (Short- circuit) (foo || bar) (foo && bar) "&&" "||" . "&&" . "||" . (Comparisons) (foo == bar) 'foo' 'bar' . "==" "!=" "<" "<=" ">" ">=" "=~" "!~" . ":=" "^=" "=" . "<" "<=" ">" ">=" IP . : if (192.0.2.1 < 192.0.2.0/24) { 192.0.2.1 192.0.2.0/24 . (Attribute Comparisons) . (&User-Name == "foo") User-Name 'foo' . (&Framed-IP-Address == 192.0.2.1) Framed-IP-Address IP 192.0.2.1 . IP . (Inter-Attribute Comparisons) (&User-Name == &Filter-Id) User-Name Filter-Id . (type-safe) . IP 1.2.3.4 127.0.0.1 IP . "&" Filter-Id <<>> . User-Name "Filter-Id" . "&" . "(&User-Name == &Filter-Id)" . (User-Name == "%{Filter-Id}"). . . : (&Attribute-Name[*] == "foo") "[*]" . . (Casts) (foo == bar) <<>> (cast) . "integer" "ipaddr" . << >> . . . . . . . ( ) . (DATA TYPES) : . " " . ( ) . (numbers) . . . (word) . . . : if (&User-Name == "bob") { ... if (&Framed-IP-Address > 127.0.0.1) { ... if (&Service-Type == Login-User) { " (strings)" ( ATTRIBUTE REFERENCES ) . . . ("!like \"this\""). '' . . `` . (sub-shell) . . . . (CPU) . . . /regex/im "=~" "!~" . (regular expressions) . (Posix) . 'i' . 'm' '^' '$' . "=~" ATTRIBUTE REFERENCES . (EXPANSIONS) ATTRIBUTE REFERENCE "%{...}" . %{Attribute-Reference} . . %{0} . %{1} %{32} (capture group) . . libpcre "%{regex:capture group}" . . . . . %{module: string ...} . . . %{%{Foo}:-bar} %{Foo} . "bar" . %{%{Foo}:-%{Bar}} %{Foo} . %{Bar} . %{%{One}:-%{%{Two}:-%{Three}}} . . %{strlen:string} "string". "string" . "string" . %{integer:Attribute-Name} Attribute-Name . "Service-Type = Login-User" %{integer:Service- Type} "1" . %{hex:Attribute-Name} Attribute- Name . "Framed-IP-Address = 127.0.0.1" %{hex:Framed-IP- Address} "0x7f000001" . %{Attribute-Name[#]} Attribute-Name. "User-Name = bob" %{User-Name[#]} "1" . %{Attribute-Name[*]} Attribute-Name (',') . %{List-Name:[#]} . %{List-Name:[*]} (',') . %{pairs:} xlat . "Reply-Message = 'Hello', Reply-Message = 'bob'" "%{reply:Reply-Message[*]}" "Hello\nbob" . (ATTRIBUTE ASSIGNMENTS) "update" . ATTRIBUTE REFERENCES . "update" . . . Attribute-Reference = value Attribute-Reference ( ) . . (Operators) . = . := . . += . . ^= . . (Enforcement and Filtering Operators) . . -= . . == . . '=' ! != . < . . "+=" . <= . . "+=" . > . . "+=" . >= . . "+=" . !* . =~ . . !~ . . (Values) . "&Attribute-Name" . "&" . "Attribute-Name" "User-Name" "request:User- Name". . "User-Name := &NAS- Port" "User- Name" "NAS-Port" . "Attribute-1 = "%{Attribute-2}" "Attribute-1 = &Attribute-2" . . Attribute-2 Attribute-1 . . IP . DATA TYPES . "Framed-IP-Address = 127.0.0.1" "Framed-IP-Address" IP "127.0.0.1" . " IP . . . 8k ( SQL). SQL . (OTHER KEYWORDS) . . : fail . noop . (failover) . ok . . reject . (MODULE RETURN CODES) "unlang" . notfound noop ok updated fail reject userlock invalid handled CONDITIONS . doc/configurable_failover . (FILES) /etc/raddb/radiusd.conf (SEE ALSO) radiusd.conf(5), dictionary(5) (AUTHOR) Alan DeKok 16 February 2021 unlang(5)