* limitations under the License.
*/
#include <vppinfra/sparse_vec.h>
-#include <vnet/sctp/sctp.h>
-#include <vnet/sctp/sctp_packet.h>
-#include <vnet/sctp/sctp_debug.h>
+#include <sctp/sctp.h>
+#include <sctp/sctp_packet.h>
+#include <sctp/sctp_debug.h>
#include <vnet/session/session.h>
#include <math.h>
static char *sctp_error_strings[] = {
#define sctp_error(n,s) s,
-#include <vnet/sctp/sctp_error.def>
+#include <sctp/sctp_error.def>
#undef sctp_error
};
return sctp_conn->sub_conn[idx].enqueue_state;
}
- vnet_buffer (b)->sctp.sid = sctp_data_chunk->stream_id;
- vnet_buffer (b)->sctp.ssn = sctp_data_chunk->stream_seq;
+ sctp_buffer_opaque (b)->sctp.sid = sctp_data_chunk->stream_id;
+ sctp_buffer_opaque (b)->sctp.ssn = sctp_data_chunk->stream_seq;
u32 tsn = clib_net_to_host_u32 (sctp_data_chunk->tsn);
- vlib_buffer_advance (b, vnet_buffer (b)->sctp.data_offset);
+ vlib_buffer_advance (b, sctp_buffer_opaque (b)->sctp.data_offset);
u32 chunk_len = vnet_sctp_get_chunk_length (&sctp_data_chunk->chunk_hdr) -
(sizeof (sctp_payload_data_chunk_t) - sizeof (sctp_header_t));
- ASSERT (vnet_buffer (b)->sctp.data_len);
+ ASSERT (sctp_buffer_opaque (b)->sctp.data_len);
ASSERT (chunk_len);
/* Padding was added: see RFC 4096 section 3.3.1 */
- if (vnet_buffer (b)->sctp.data_len > chunk_len)
+ if (sctp_buffer_opaque (b)->sctp.data_len > chunk_len)
{
/* Let's change the data_len to the right amount calculated here now.
* We cannot do that in the generic sctp46_input_dispatcher node since
* that is common to all CHUNKS handling.
*/
- vnet_buffer (b)->sctp.data_len = chunk_len;
+ sctp_buffer_opaque (b)->sctp.data_len = chunk_len;
/* We need to change b->current_length so that downstream calls to
* session_enqueue_stream_connection (called by sctp_session_enqueue_data)
* push the correct amount of data to be enqueued.
*/
b->current_length = chunk_len;
}
- n_data_bytes = vnet_buffer (b)->sctp.data_len;
+ n_data_bytes = sctp_buffer_opaque (b)->sctp.data_len;
sctp_is_connection_gapping (sctp_conn, tsn, &is_gapping);
* will come from the half-open connections pool.
*/
sctp_conn =
- sctp_half_open_connection_get (vnet_buffer (b0)->
+ sctp_half_open_connection_get (sctp_buffer_opaque (b0)->
sctp.connection_index);
if (PREDICT_FALSE (sctp_conn == 0))
b0 = vlib_get_buffer (vm, bi0);
sctp_conn =
- sctp_connection_get (vnet_buffer (b0)->sctp.connection_index,
- my_thread_index);
+ sctp_connection_get (sctp_buffer_opaque (b0)->
+ sctp.connection_index, my_thread_index);
if (PREDICT_FALSE (sctp_conn == 0))
{
b0 = vlib_get_buffer (vm, bi0);
sctp_listener =
- sctp_listener_get (vnet_buffer (b0)->sctp.connection_index);
+ sctp_listener_get (sctp_buffer_opaque (b0)->
+ sctp.connection_index);
if (is_ip4)
{
b0 = vlib_get_buffer (vm, bi0);
sctp_conn =
- sctp_connection_get (vnet_buffer (b0)->sctp.connection_index,
- my_thread_index);
+ sctp_connection_get (sctp_buffer_opaque (b0)->
+ sctp.connection_index, my_thread_index);
if (PREDICT_FALSE (sctp_conn == 0))
{
n_left_to_next -= 1;
b0 = vlib_get_buffer (vm, bi0);
- vnet_buffer (b0)->sctp.flags = 0;
+ sctp_buffer_opaque (b0)->sctp.flags = 0;
fib_index0 = vnet_buffer (b0)->ip.fib_index;
/* Checksum computed by ipx_local no need to compute again */
goto done;
}
- vnet_buffer (b0)->sctp.hdr_offset =
+ sctp_buffer_opaque (b0)->sctp.hdr_offset =
(u8 *) sctp_hdr - (u8 *) vlib_buffer_get_current (b0);
/* Session exists */
if (PREDICT_TRUE (0 != sctp_conn))
{
/* Save connection index */
- vnet_buffer (b0)->sctp.connection_index = trans_conn->c_index;
- vnet_buffer (b0)->sctp.data_offset = n_advance_bytes0;
- vnet_buffer (b0)->sctp.data_len = n_data_bytes0;
+ sctp_buffer_opaque (b0)->sctp.connection_index
+ = trans_conn->c_index;
+ sctp_buffer_opaque (b0)->sctp.data_offset = n_advance_bytes0;
+ sctp_buffer_opaque (b0)->sctp.data_len = n_data_bytes0;
next0 = tm->dispatch_table[sctp_conn->state][chunk_type].next;
error0 = tm->dispatch_table[sctp_conn->state][chunk_type].error;