tst_inet6_rth_init - Initializes the buffer pointed to by bp to contain a Routing header of the specified type
To check that inet6_rth_init() can be used to initializes the buffer pointed to by bp to contain a Routing header of the specified type.
./tst_inet6_rth_init [-tooloption ...] -tooloption : v6api tool option
1. Initializes the buffer with segments set to zero 2. Check A: routing header is initialized with correct type and length 3. Initializes the buffer with segments set to 1 4. Check B: routing header is initialized with correct type and length
None
RFC 3542
7.2. inet6_rth_init
void *inet6_rth_init(void *bp, socklen_t bp_len, int type, int segments);
This function initializes the buffer pointed to by bp to contain a Routing header of the specified type and sets ip6r_len based on the segments parameter. bp_len is only used to verify that the buffer is large enough. The ip6r_segleft field is set to zero; inet6_rth_add() will increment it.
When the application uses ancillary data the application must initialize any cmsghdr fields.
The caller must allocate the buffer and its size can be determined by calling inet6_rth_space().
Upon success the return value is the pointer to the buffer (bp), and this is then used as the first argument to the inet6_rth_add() function. Upon an error the return value is NULL.