]> git.tuebingen.mpg.de Git - paraslash.git/commit
10_set-client-ccid.diff
authorGerrit Renker <grenker@cscs.ch>
Thu, 25 Feb 2010 16:05:46 +0000 (17:05 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 25 Feb 2010 16:05:46 +0000 (17:05 +0100)
commitc37a24b653b5a3834eecd8e6f95a88a95379c005
tree3331dc85ac4cb4609cb854d498bbdccdee06bdbd
parent818d1a3aa98121ec2d5339d11dece7bc2f5aa6af
10_set-client-ccid.diff

This adds a commandline option to either
 * select the CCID in use for the sender-receiver half-connection or
 * advertise the (para_)client's priorities for the CCID;
 * the feature is optional and can be used to fine-tune a connection.

The arguments are both range-checked by gengetopt, and against the CCIDs
available on the host. Currently known CCIDs are 2-4, 248-254. Trying a
CCID which is not supported by the host exits via the following route:

 dccp_recv_ccid_support_check: 'CCID-253' not supported on this host.
 main: parse failed
 main: recv syntax error

The CCID negotiation can be watched in wireshark, between the 'Request'
packet sent by the para_client and the corresponding 'Response' packet of
the para_server. Here are some example negotiations:

     +-------------+---------------+----------------+
     | client-list |  server-list  | resulting CCID |
     +-------------+---------------+----------------+
     |  3, 2       |   2, 3, 4     |       2        |
     |  4, 3, 2, 4 |   3, 2, 4     |       3        |
     |  2, 4       |   2, 3, 4     |       2        |
     |  4, 3, 2, 4 |   2, 3, 4     |       2        |
     |  2          |   2, 3, 4     |       2        |
     |  3          |   2, 3, 4     |       3        |
     |  4          |   2, 3, 4     |       4        |
     +-------------+---------------+----------------+

The server list of (2, 3, 4) is the unaltered default, it can be changed on
the server using the same mechanism.

As shown, the easiest way is to use just a single '--ccid <n>' argument;
when passing multiple values, the outcome is determined by the algorithm
described in RFC 4340, 6.3.1:
 * 'server-priority' means that the server overrids the result;
 * the server traverses its list of preferences in order of priority and
 * uses the first entry which also appears in the client-list;
 * resets connection with negotiation failure when there is no common value.

Applying this algorithm on the above lists can be used to verify the
table. This also illustrates that repetition of CCID values has no effect
on the outcome: if the repeated value is first in the server list, it will
be chosen; otherwise all instances of that value are ignored.
dccp_recv.c
ggo/dccp_recv.ggo