Mercurial > hg > waaad
changeset 131:5875067526ff
Added support for sctp_streams overwrite per peer
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 19 Aug 2008 11:26:43 +0900 |
parents | 641999eb7a1d |
children | 9dfac05e0e48 |
files | doc/waaad.conf.sample include/waaad/peer-api.h waaad/conf-gram.y |
diffstat | 3 files changed, 28 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/waaad.conf.sample Tue Aug 19 11:14:09 2008 +0900 +++ b/doc/waaad.conf.sample Tue Aug 19 11:26:43 2008 +0900 @@ -99,19 +99,21 @@ # the connexion will be closed. # # The format is: -# "peer_fqdn" = { uri="peer_uri"; }; +# "peer_fqdn" = { uri="peer_uri"; sctp_streams=30; }; # where: # peer_fqdn is the Diameter-Id of the remote peer. # peer_uri is optional. If provided, it must comply to this format: -# scheme "://" node [ ":" port] [ ";transport=" transport ] -# where: -# scheme : "aaa" (no security) or "aaas" (default security). Do not use "aaa" unless you have some other security mechanism deployed (IKEv2, ...). Default is "aaas". -# node : a name or address that resolves to the peer (dns name, alias, ip, [ipv6], ...). This string is passed to getaddrinfo. Default is to resolve the "peer_fqdn". -# port : an integer to specify the port to connect to. Default is the Diameter port 3868. -# transport: either "sctp" or "tcp". Default is "sctp". +# scheme "://" node [ ":" port] [ ";transport=" transport ] +# where: +# scheme : "aaa" (no security) or "aaas" (default security). Do not use "aaa" unless you have some other security mechanism deployed (IKEv2, ...). Default is "aaas". +# node : a name or address that resolves to the peer (dns name, alias, ip, [ipv6], ...). This string is passed to getaddrinfo. Default is to resolve the "peer_fqdn". +# port : an integer to specify the port to connect to. Default is the Diameter port 3868. +# transport: either "sctp" or "tcp". Default is "sctp". +# sctp_streams is optional. If provided, it overwrites the value from [general] section for this peer. # "peer1.localdomain" = { uri = "aaas://192.168.2.24"; + sctp_streams = 500; }; "peer2.localdomain" = {
--- a/include/waaad/peer-api.h Tue Aug 19 11:14:09 2008 +0900 +++ b/include/waaad/peer-api.h Tue Aug 19 11:26:43 2008 +0900 @@ -89,6 +89,8 @@ /* Connection informations : struct sockaddr, transport protocol, ... */ + /* number of sctp streams */ + /* other TBD */ } peer_add_t;
--- a/waaad/conf-gram.y Tue Aug 19 11:14:09 2008 +0900 +++ b/waaad/conf-gram.y Tue Aug 19 11:26:43 2008 +0900 @@ -227,8 +227,9 @@ static struct _peer_detail { char * locator; uint16_t port; + uint16_t sctp_streams; char flags; -} peer_detail={NULL, 0, 0}; +} peer_detail={NULL, 0, 0, 0}; /* Flags values; 0 is default behavior */ #define PEER_NO_SEC 0x1 @@ -593,9 +594,10 @@ /* Initialize the peer details */ if (peer_detail.locator ) { free(peer_detail.locator); peer_detail.locator = NULL; } peer_detail.port = 3868; + peer_detail.sctp_streams = 0; peer_detail.flags = 0; } - FQDN '=' '{' peer_uri '}' ';' + FQDN '=' '{' peer_content '}' ';' { int ret = 0; peer_add_t data; @@ -607,6 +609,7 @@ /* The remaining of information is located in the peer_detail variable, filled during peer_uri rule */ + /* Now add the peer with its information */ ret = peer_add(&data); if (ret != 0) { @@ -620,8 +623,12 @@ } ; -peer_uri: /* May be empty */ - | PEER_URI '=' '"' peer_scheme peer_locator peer_port peer_transport '"' ';' +peer_content: /* empty is allowed */ + | peer_content peer_uri + | peer_content peer_sctp_streams + ; + +peer_uri: PEER_URI '=' '"' peer_scheme peer_locator peer_port peer_transport '"' ';' { } @@ -661,3 +668,9 @@ peer_detail.flags |= PEER_TCP; } ; + +peer_sctp_streams: GEN_SCTP_STREAMS '=' gen_sctp_streams_val ';' + { + peer_detail.sctp_streams = $3; + } + ;