* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <vnet/sctp/sctp.h>
-#include <vnet/sctp/sctp_debug.h>
+#include <sctp/sctp.h>
+#include <sctp/sctp_debug.h>
#include <vppinfra/random.h>
#include <openssl/hmac.h>
b->current_data = 0;
b->current_length = 0;
b->total_length_not_including_first_buffer = 0;
- vnet_buffer (b)->sctp.flags = 0;
- vnet_buffer (b)->sctp.subconn_idx = MAX_SCTP_CONNECTIONS;
+ sctp_buffer_opaque (b)->sctp.flags = 0;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = MAX_SCTP_CONNECTIONS;
/* Leave enough space for headers */
return vlib_buffer_make_headroom (b, TRANSPORT_MAX_HDRS_LEN);
ASSERT ((b->flags & VLIB_BUFFER_NEXT_PRESENT) == 0);
b->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
b->total_length_not_including_first_buffer = 0;
- vnet_buffer (b)->sctp.flags = 0;
- vnet_buffer (b)->sctp.subconn_idx = MAX_SCTP_CONNECTIONS;
+ sctp_buffer_opaque (b)->sctp.flags = 0;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = MAX_SCTP_CONNECTIONS;
VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b);
/* Leave enough space for headers */
return vlib_buffer_make_headroom (b, TRANSPORT_MAX_HDRS_LEN);
sctp_conn->local_tag = init_chunk->initiate_tag;
- vnet_buffer (b)->sctp.connection_index = sub_conn->c_c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.connection_index = sub_conn->c_c_index;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
SCTP_DBG_STATE_MACHINE ("CONN_INDEX = %u, CURR_CONN_STATE = %u (%s), "
"CHUNK_TYPE = %s, "
vnet_sctp_set_chunk_type (&cookie_ack_chunk->chunk_hdr, COOKIE_ACK);
vnet_sctp_set_chunk_length (&cookie_ack_chunk->chunk_hdr, chunk_len);
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
void
clib_memcpy_fast (&(cookie_echo_chunk->cookie), &sctp_conn->cookie_param,
sizeof (sctp_state_cookie_param_t));
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
vnet_sctp_set_chunk_type (&err_chunk->chunk_hdr, OPERATION_ERROR);
vnet_sctp_set_chunk_length (&err_chunk->chunk_hdr, chunk_len);
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
/**
vnet_sctp_set_chunk_type (&abort_chunk->chunk_hdr, ABORT);
vnet_sctp_set_chunk_length (&abort_chunk->chunk_hdr, chunk_len);
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
/**
init_ack_chunk->outbound_streams_count =
clib_host_to_net_u16 (OUTBOUND_STREAMS_COUNT);
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
/**
sctp_conn->local_tag = init_ack_chunk->initiate_tag;
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
/**
shutdown_chunk->cumulative_tsn_ack = sctp_conn->last_rcvd_tsn;
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
/*
vnet_sctp_set_chunk_type (&shutdown_ack_chunk->chunk_hdr, SHUTDOWN_ACK);
vnet_sctp_set_chunk_length (&shutdown_ack_chunk->chunk_hdr, chunk_len);
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
/*
sctp_conn->ack_state = 0;
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
/**
vnet_sctp_set_chunk_type (&hb_ack->chunk_hdr, HEARTBEAT_ACK);
vnet_sctp_set_chunk_length (&hb_ack->chunk_hdr, chunk_len);
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
/**
vnet_sctp_set_chunk_type (&hb_req->chunk_hdr, HEARTBEAT);
vnet_sctp_set_chunk_length (&hb_req->chunk_hdr, chunk_len);
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
void
vnet_sctp_set_chunk_type (&shutdown_complete->chunk_hdr, SHUTDOWN_COMPLETE);
vnet_sctp_set_chunk_length (&shutdown_complete->chunk_hdr, chunk_len);
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
void
sctp_conn->sub_conn[idx].last_data_ts = sctp_time_now ();
- vnet_buffer (b)->sctp.connection_index =
+ sctp_buffer_opaque (b)->sctp.connection_index =
sctp_conn->sub_conn[idx].connection.c_index;
- vnet_buffer (b)->sctp.subconn_idx = idx;
+ sctp_buffer_opaque (b)->sctp.subconn_idx = idx;
}
u32