/*
 * Copyright (c) 2018 SUSE LLC.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

option version = "1.0.0";
 
/** \brief Configure SCTP source addresses, for active-open SCTP sessions

    SCTP src/dst ports are 16 bits
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_ipv6 - 1 for ipv6, 0 for ipv4
    @param vrf_id - fib table / vrf id for local adjacencies
    @param src_address - src address that SCTP will use for this sub-conn
    @param dst_address - dst address that SCTP will use for this sub-conn
*/
autoreply define sctp_add_src_dst_connection {
    u32 client_index;
    u32 context;
    u8 is_ipv6;
    u32 vrf_id;
    u8 src_address[16];
    u8 dst_address[16];
 };
 
autoreply define sctp_del_src_dst_connection {
    u32 client_index;
    u32 context;
    u8 is_ipv6;
    u32 vrf_id;
    u8 src_address[16];
    u8 dst_address[16];
 };
 
autoreply define sctp_config {
    u32 client_index;
    u32 context;
    u8 never_delay_sack;
    u8 never_bundle;
 };