Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
Macros | Functions
udtlib.c File Reference

Library of UDT functions for SIP messages. More...

#include <stdio.h>
#include "../../library/lib.h"
#include "./sip-1.h"
Include dependency graph for udtlib.c:

Go to the source code of this file.

Macros

#define isalphanum(c)   (((c) >= 97 && (c) <= 122) || ((c) >= 48 && (c) <= 57) || ((c) >= 65 && (c) <= 90))
 
#define ishexdigit(c)   (((c) >= 48 && (c) <= 57) || ((c) >= 65 && (c) <= 70) || ((c) >= 97 && (c) <= 102))
 

Functions

void u_Digit (callback_data *spData)
 
void u_Digit1 (callback_data *spData)
 
void u_DomainLabel (callback_data *spData)
 Evaluates the lower elements of a host name. More...
 
void e_MessageBody (callback_data *spData)
 Evaluates the message body. More...
 
void u_CRLF (callback_data *spData)
 Evaluates the line end character sequence. More...
 
void u_LWS (callback_data *spData)
 Linear white space. White space with possible line breaks allowed. More...
 
void e_SWS (callback_data *spData)
 Optional linear white space. (See u_LWS.) More...
 
void u_WSP (callback_data *spData)
 
void e_Alphanum0 (callback_data *spData)
 
void u_Alphanum1 (callback_data *spData)
 
void u_alphanum (callback_data *spData)
 
void u_ALPHA (callback_data *spData)
 
void u_paramchar1 (callback_data *spData)
 
void u_unreserved (callback_data *spData)
 
void vSip1UdtCallbacks (void *vpParserCtx)
 Set the UDT callback functions for the SIP2.bnf grammar to their respective parse tree nodes. More...
 

Detailed Description

Library of UDT functions for SIP messages.

A few of the rules most often "hit" or evaluated during the parsing of a SIP message are have been hand written as UDTs. Those functions are defined here.

Definition in file udtlib.c.

Macro Definition Documentation

◆ isalphanum

#define isalphanum (   c)    (((c) >= 97 && (c) <= 122) || ((c) >= 48 && (c) <= 57) || ((c) >= 65 && (c) <= 90))

Definition at line 48 of file udtlib.c.

◆ ishexdigit

#define ishexdigit (   c)    (((c) >= 48 && (c) <= 57) || ((c) >= 65 && (c) <= 70) || ((c) >= 97 && (c) <= 102))

Definition at line 49 of file udtlib.c.

Function Documentation

◆ e_Alphanum0()

void e_Alphanum0 ( callback_data spData)

Definition at line 315 of file udtlib.c.

◆ e_MessageBody()

void e_MessageBody ( callback_data spData)

Evaluates the message body.

Note that this function never fails and simply accepts the remainder of the input string, no matter what it is.

Parameters
spDatathe callback_data passed to the function by the parser
Returns
none

Definition at line 195 of file udtlib.c.

◆ e_SWS()

void e_SWS ( callback_data spData)

Optional linear white space. (See u_LWS.)

Parameters
spDatathe callback_data passed to the function by the parser
Returns
none

Definition at line 296 of file udtlib.c.

◆ u_ALPHA()

void u_ALPHA ( callback_data spData)

Definition at line 366 of file udtlib.c.

◆ u_alphanum()

void u_alphanum ( callback_data spData)

Definition at line 354 of file udtlib.c.

◆ u_Alphanum1()

void u_Alphanum1 ( callback_data spData)

Definition at line 332 of file udtlib.c.

◆ u_CRLF()

void u_CRLF ( callback_data spData)

Evaluates the line end character sequence.

CRLF = CR LF / LF / CR
The line end sequence has been modified from the original ABNF to be forgiving.

Parameters
spDatathe callback_data passed to the function by the parser
Returns
none

Definition at line 207 of file udtlib.c.

◆ u_Digit()

void u_Digit ( callback_data spData)

Definition at line 99 of file udtlib.c.

◆ u_Digit1()

void u_Digit1 ( callback_data spData)

Definition at line 111 of file udtlib.c.

◆ u_DomainLabel()

void u_DomainLabel ( callback_data spData)

Evaluates the lower elements of a host name.

hostname = *( domainlabel "." &(alphanum/"-")) toplabel [ "." ] domainlabel = 1*alphanum *(1*"-" 1*alphanum)

eg. my.example.com
"my" and "example" are domain labels

Parameters
spDatathe callback_data passed to the function by the parser
Returns
none

Definition at line 141 of file udtlib.c.

◆ u_LWS()

void u_LWS ( callback_data spData)

Linear white space. White space with possible line breaks allowed.

LWS = [*WSP u_CRLF] 1*WSP

Parameters
spDatathe callback_data passed to the function by the parser
Returns
none

Definition at line 238 of file udtlib.c.

◆ u_paramchar1()

void u_paramchar1 ( callback_data spData)

Definition at line 379 of file udtlib.c.

◆ u_unreserved()

void u_unreserved ( callback_data spData)

Definition at line 409 of file udtlib.c.

◆ u_WSP()

void u_WSP ( callback_data spData)

Definition at line 303 of file udtlib.c.

◆ vSip1UdtCallbacks()

void vSip1UdtCallbacks ( void *  vpParserCtx)

Set the UDT callback functions for the SIP2.bnf grammar to their respective parse tree nodes.

Parameters
vpParserCtx- the context of the parser
Returns
none

Definition at line 447 of file udtlib.c.

APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.