The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions | Variables
uri.c File Reference

Functions for dealing with URIs. More...

#include <freeradius-devel/util/sbuff.h>
#include <freeradius-devel/util/table.h>
#include <freeradius-devel/util/value.h>
#include "uri.h"
+ Include dependency graph for uri.c:

Go to the source code of this file.

Functions

return fr_table_value_by_longest_prefix (NULL, schemes, fr_sbuff_start(&sbuff), fr_sbuff_used(&sbuff), def)
 
int fr_uri_escape (fr_value_box_t *uri_vb, void *uctx)
 Escapes an individual value box that's part of a URI, advancing the pointer to uri_parts. More...
 
int fr_uri_escape_list (fr_value_box_list_t *uri, fr_uri_part_t const *uri_parts, void *uctx)
 Parse a list of value boxes representing a URI. More...
 
int fr_uri_has_scheme (fr_value_box_list_t *uri, fr_table_num_sorted_t const *schemes, size_t schemes_len, int def)
 Searches for a matching scheme in the table of schemes, using a list of value boxes representing the URI. More...
 

Variables

 return
 

Detailed Description

Functions for dealing with URIs.

Definition in file uri.c.

Function Documentation

◆ fr_table_value_by_longest_prefix()

return fr_table_value_by_longest_prefix ( NULL  ,
schemes  ,
fr_sbuff_start sbuff,
fr_sbuff_used sbuff,
def   
)
+ Here is the caller graph for this function:

◆ fr_uri_escape()

int fr_uri_escape ( fr_value_box_t uri_vb,
void *  uctx 
)

Escapes an individual value box that's part of a URI, advancing the pointer to uri_parts.

Note
This function has a signature compatible with fr_uri_escape_func_t.
This function may modify the type of boxes, as all boxes in the list are cast to strings before parsing.
Parameters
[in,out]uri_vbto escape
[in]uctxA fr_uri_escape_ctx_t containing the initial fr_uri_part_t and the uctx to pass to the escaping function.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 45 of file uri.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_uri_escape_list()

int fr_uri_escape_list ( fr_value_box_list_t *  uri,
fr_uri_part_t const *  uri_parts,
void *  uctx 
)

Parse a list of value boxes representing a URI.

Reads a URI from a list of value boxes and parses it according to the definition in uri_parts. Tainted values, where allowed, are escaped using the function specified for the uri part.

Note
This function may modify the type of boxes, as all boxes in the list are cast to strings before parsing.
Parameters
urito parse. A list of string type value boxes containing fragments of a URI.
uri_partsdefinition of URI structure. Should point to the start of the array of uri parts.
uctxto pass to escaping function
Returns
  • 0 on success
  • -1 on failure

Definition at line 141 of file uri.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_uri_has_scheme()

int fr_uri_has_scheme ( fr_value_box_list_t *  uri,
fr_table_num_sorted_t const *  schemes,
size_t  schemes_len,
int  def 
)

Searches for a matching scheme in the table of schemes, using a list of value boxes representing the URI.

Note
Unlikel
Parameters
urito parse. A list of string type value boxes containing fragments of a URI.
schemesTable of schemes to search.
schemes_lenNumber of schemes in the table.
defDefault scheme to use if none is found.
Returns
The matching scheme, or def if none is found.

Definition at line 168 of file uri.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ return

return

Definition at line 154 of file uri.c.