[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.2.8 Interacting with Radius Servers

Radtest provides two commands for interaction with remote RADIUS servers.

Command send sends request to the server specified in `raddb/client.conf'. Its syntax is:

 
send [flags] port-type code [expr-or-pair-list]

Optional flags can be used for fine-tuning the internals of send. You will seldom need to use these, unless you are developing GNU Radius. See section send, for the detailed description of these.

The first obligatory argument, port-type, specifies which RADIUS port to send the request to. Specifying `auth' will send the request to the authentication port (see section auth-port); specifying `acct' will send it to the accounting port (see section acct-port).

Argument code gives the request code. It is either a number or a symbolic request code name (see section 13.2.2.1 Numeric Values).

The last argument, expr-or-pair-list is either a radtest expression evaluating to avlist or a list of A/V pairs. These pairs will be included in the request.

Here are several examples:

 
# Send a Status-Server request without attributes.
send auth Status-Server

# Send an Access-Request with two attributes
send auth Access-Request User-Name = "foo" User-Password = "bar"

# Send an Accounting-Request, taking attributes from the variable
# attr
send acct Accounting-Request $attr

Command send stores the reply code into the variable REPLY_CODE and reply pairs into the variable REPLY (see section 13.2.4.6 Built-in Variables). <FIXME> How do I know if send has failed? </>

Another primitive is expect. Expect takes at most two arguments: a request code (either numeric or symbolic, (see section 13.2.2.1 Numeric Values)) and optional list of A/V pairs (similar to send expr-or-pair-list argument). Expect check if these match current REPLY_CODE and REPLY values and if so, prints the string `PASS'. Otherwise, it prints `FAIL'. This command is designed primarily for use in GNU Radius testsuite.

Expect is usually used right after send, as shown in the example below:

 
send auth Access-Request User-Name = "foo" User-Password = "bar"
expect Access-Accept Reply-Message = "Access allowed"


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Sergey Poznyakoff on November, 20 2004 using texi2html