Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SCTP support #3108

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 258 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3630,6 +3630,264 @@ pub const J1939_EE_INFO_RX_ABORT: ::c_int = 4;

pub const J1939_FILTER_MAX: ::c_int = 512;

pub const SCTP_RTOINFO: ::c_int = 0x00000001;
pub const SCTP_ASSOCINFO: ::c_int = 0x00000002;
pub const SCTP_INITMSG: ::c_int = 0x00000003;
pub const SCTP_NODELAY: ::c_int = 0x00000004;
pub const SCTP_AUTOCLOSE: ::c_int = 0x00000005;
pub const SCTP_SET_PEER_PRIMARY_ADDR: ::c_int = 0x00000006;
pub const SCTP_PRIMARY_ADDR: ::c_int = 0x00000007;
pub const SCTP_ADAPTATION_LAYER: ::c_int = 0x00000008;
pub const SCTP_ADAPTION_LAYER: ::c_int = 0x00000008;
pub const SCTP_DISABLE_FRAGMENTS: ::c_int = 0x00000009;
pub const SCTP_PEER_ADDR_PARAMS: ::c_int = 0x0000000a;
pub const SCTP_DEFAULT_SEND_PARAM: ::c_int = 0x0000000b;
pub const SCTP_I_WANT_MAPPED_V4_ADDR: ::c_int = 0x0000000d;
pub const SCTP_MAXSEG: ::c_int = 0x0000000e;
pub const SCTP_DELAYED_SACK: ::c_int = 0x0000000f;
pub const SCTP_FRAGMENT_INTERLEAVE: ::c_int = 0x00000010;
pub const SCTP_PARTIAL_DELIVERY_POINT: ::c_int = 0x00000011;
pub const SCTP_AUTH_CHUNK: ::c_int = 0x00000012;
pub const SCTP_AUTH_KEY: ::c_int = 0x00000013;
pub const SCTP_HMAC_IDENT: ::c_int = 0x00000014;
pub const SCTP_AUTH_ACTIVE_KEY: ::c_int = 0x00000015;
pub const SCTP_AUTH_DELETE_KEY: ::c_int = 0x00000016;
pub const SCTP_USE_EXT_RCVINFO: ::c_int = 0x00000017;
pub const SCTP_EXPLICIT_EOR: ::c_int = 0x0000001b;
pub const SCTP_AUTH_DEACTIVATE_KEY: ::c_int = 0x0000001d;
pub const SCTP_EVENT: ::c_int = 0x0000001e;
pub const SCTP_RECVRCVINFO: ::c_int = 0x0000001f;
pub const SCTP_RECVNXTINFO: ::c_int = 0x00000020;
pub const SCTP_DEFAULT_SNDINFO: ::c_int = 0x00000021;
pub const SCTP_DEFAULT_PRINFO: ::c_int = 0x00000022;
pub const SCTP_PEER_ADDR_THLDS: ::c_int = 0x00000023;
pub const SCTP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 0x00000024;
pub const SCTP_ECN_SUPPORTED: ::c_int = 0x00000025;
pub const SCTP_PR_SUPPORTED: ::c_int = 0x00000026;
pub const SCTP_AUTH_SUPPORTED: ::c_int = 0x00000027;
pub const SCTP_ASCONF_SUPPORTED: ::c_int = 0x00000028;
pub const SCTP_RECONFIG_SUPPORTED: ::c_int = 0x00000029;
pub const SCTP_NRSACK_SUPPORTED: ::c_int = 0x00000030;
pub const SCTP_PKTDROP_SUPPORTED: ::c_int = 0x00000031;
pub const SCTP_MAX_CWND: ::c_int = 0x00000032;
pub const SCTP_STATUS: ::c_int = 0x00000100;
pub const SCTP_GET_PEER_ADDR_INFO: ::c_int = 0x00000101;
pub const SCTP_PEER_AUTH_CHUNKS: ::c_int = 0x00000102;
pub const SCTP_LOCAL_AUTH_CHUNKS: ::c_int = 0x00000103;
pub const SCTP_TIMEOUTS: ::c_int = 0x00000106;
pub const SCTP_PR_STREAM_STATUS: ::c_int = 0x00000107;
pub const SCTP_PR_ASSOC_STATUS: ::c_int = 0x00000108;
pub const SCTP_ENABLE_RESET_STREAM_REQ: ::c_int = 0x00000001;
pub const SCTP_ENABLE_RESET_ASSOC_REQ: ::c_int = 0x00000002;
pub const SCTP_ENABLE_CHANGE_ASSOC_REQ: ::c_int = 0x00000004;
pub const SCTP_ENABLE_VALUE_MASK: ::c_int = 0x00000007;
pub const SCTP_STREAM_RESET_INCOMING: ::c_int = 0x00000001;
pub const SCTP_STREAM_RESET_OUTGOING: ::c_int = 0x00000002;
pub const SCTP_SET_DEBUG_LEVEL: ::c_int = 0x00001005;
pub const SCTP_CLR_STAT_LOG: ::c_int = 0x00001007;
pub const SCTP_CMT_ON_OFF: ::c_int = 0x00001200;
pub const SCTP_CMT_USE_DAC: ::c_int = 0x00001201;
pub const SCTP_PLUGGABLE_CC: ::c_int = 0x00001202;
pub const SCTP_PLUGGABLE_SS: ::c_int = 0x00001203;
pub const SCTP_SS_VALUE: ::c_int = 0x00001204;
pub const SCTP_GET_SNDBUF_USE: ::c_int = 0x00001101;
pub const SCTP_GET_STAT_LOG: ::c_int = 0x00001103;
pub const SCTP_PCB_STATUS: ::c_int = 0x00001104;
pub const SCTP_GET_NONCE_VALUES: ::c_int = 0x00001105;
pub const SCTP_SET_DYNAMIC_PRIMARY: ::c_int = 0x00002001;
pub const SCTP_VRF_ID: ::c_int = 0x00003001;
pub const SCTP_ADD_VRF_ID: ::c_int = 0x00003002;
pub const SCTP_GET_VRF_IDS: ::c_int = 0x00003003;
pub const SCTP_GET_ASOC_VRF: ::c_int = 0x00003004;
pub const SCTP_DEL_VRF_ID: ::c_int = 0x00003005;
pub const SCTP_GET_PACKET_LOG: ::c_int = 0x00004001;
pub const SCTP_BINDX_ADD_ADDR: ::c_int = 0x00008001;
pub const SCTP_BINDX_REM_ADDR: ::c_int = 0x00008002;
pub const SCTP_GET_PEER_ADDRESSES: ::c_int = 0x00008003;
pub const SCTP_GET_LOCAL_ADDRESSES: ::c_int = 0x00008004;
pub const SCTP_GET_LOCAL_ADDR_SIZE: ::c_int = 0x00008005;
pub const SCTP_GET_REMOTE_ADDR_SIZE: ::c_int = 0x00008006;
pub const SCTP_CONNECT_X: ::c_int = 0x00008007;
pub const SCTP_CONNECT_X_DELAYED: ::c_int = 0x00008008;
pub const SCTP_CONNECT_X_COMPLETE: ::c_int = 0x00008009;
pub const SCTP_PEELOFF: ::c_int = 0x0000800a;
pub const SCTP_GET_ADDR_LEN: ::c_int = 0x0000800b;
pub const SCTP_LISTEN_FIX: ::c_int = 0x0000800c;
pub const SCTP_GET_HANDLE: ::c_int = 0x0000800d;
pub const SCTP_SET_INITIAL_DBG_SEQ: ::c_int = 0x00009f00;
pub const SCTP_CC_RFC2581: ::c_int = 0x00000000;
pub const SCTP_CC_HSTCP: ::c_int = 0x00000001;
pub const SCTP_CC_HTCP: ::c_int = 0x00000002;
pub const SCTP_CC_RTCC: ::c_int = 0x00000003;
pub const SCTP_CC_OPT_RTCC_SETMODE: ::c_int = 0x00002000;
pub const SCTP_CC_OPT_USE_DCCC_ECN: ::c_int = 0x00002001;
pub const SCTP_CC_OPT_STEADY_STEP: ::c_int = 0x00002002;
pub const SCTP_CMT_OFF: ::c_int = 0;
pub const SCTP_CMT_BASE: ::c_int = 1;
pub const SCTP_CMT_RPV1: ::c_int = 2;
pub const SCTP_CMT_RPV2: ::c_int = 3;
pub const SCTP_CMT_MPTCP: ::c_int = 4;
// pub const SCTP_CMT_MAX: :: = SCTP_CMT_MPTCP;
pub const SCTP_SS_DEFAULT: ::c_int = 0x00000000;
pub const SCTP_SS_ROUND_ROBIN: ::c_int = 0x00000001;
pub const SCTP_SS_ROUND_ROBIN_PACKET: ::c_int = 0x00000002;
pub const SCTP_SS_PRIORITY: ::c_int = 0x00000003;
pub const SCTP_SS_FAIR_BANDWITH: ::c_int = 0x00000004;
pub const SCTP_SS_FIRST_COME: ::c_int = 0x00000005;
pub const SCTP_FRAG_LEVEL_0: ::c_int = 0x00000000;
pub const SCTP_FRAG_LEVEL_1: ::c_int = 0x00000001;
pub const SCTP_FRAG_LEVEL_2: ::c_int = 0x00000002;
pub const SCTP_CLOSED: ::c_int = 0x0000;
pub const SCTP_BOUND: ::c_int = 0x1000;
pub const SCTP_LISTEN: ::c_int = 0x2000;
pub const SCTP_COOKIE_WAIT: ::c_int = 0x0002;
pub const SCTP_COOKIE_ECHOED: ::c_int = 0x0004;
pub const SCTP_ESTABLISHED: ::c_int = 0x0008;
pub const SCTP_SHUTDOWN_SENT: ::c_int = 0x0010;
pub const SCTP_SHUTDOWN_RECEIVED: ::c_int = 0x0020;
pub const SCTP_SHUTDOWN_ACK_SENT: ::c_int = 0x0040;
pub const SCTP_SHUTDOWN_PENDING: ::c_int = 0x0080;
pub const SCTP_CAUSE_NO_ERROR: ::c_int = 0x0000;
pub const SCTP_CAUSE_INVALID_STREAM: ::c_int = 0x0001;
pub const SCTP_CAUSE_MISSING_PARAM: ::c_int = 0x0002;
pub const SCTP_CAUSE_STALE_COOKIE: ::c_int = 0x0003;
pub const SCTP_CAUSE_OUT_OF_RESC: ::c_int = 0x0004;
pub const SCTP_CAUSE_UNRESOLVABLE_ADDR: ::c_int = 0x0005;
pub const SCTP_CAUSE_UNRECOG_CHUNK: ::c_int = 0x0006;
pub const SCTP_CAUSE_INVALID_PARAM: ::c_int = 0x0007;
pub const SCTP_CAUSE_UNRECOG_PARAM: ::c_int = 0x0008;
pub const SCTP_CAUSE_NO_USER_DATA: ::c_int = 0x0009;
pub const SCTP_CAUSE_COOKIE_IN_SHUTDOWN: ::c_int = 0x000a;
pub const SCTP_CAUSE_RESTART_W_NEWADDR: ::c_int = 0x000b;
pub const SCTP_CAUSE_USER_INITIATED_ABT: ::c_int = 0x000c;
pub const SCTP_CAUSE_PROTOCOL_VIOLATION: ::c_int = 0x000d;
pub const SCTP_CAUSE_DELETING_LAST_ADDR: ::c_int = 0x00a0;
pub const SCTP_CAUSE_RESOURCE_SHORTAGE: ::c_int = 0x00a1;
pub const SCTP_CAUSE_DELETING_SRC_ADDR: ::c_int = 0x00a2;
pub const SCTP_CAUSE_ILLEGAL_ASCONF_ACK: ::c_int = 0x00a3;
pub const SCTP_CAUSE_REQUEST_REFUSED: ::c_int = 0x00a4;
pub const SCTP_CAUSE_NAT_COLLIDING_STATE: ::c_int = 0x00b0;
pub const SCTP_CAUSE_NAT_MISSING_STATE: ::c_int = 0x00b1;
pub const SCTP_CAUSE_UNSUPPORTED_HMACID: ::c_int = 0x0105;
pub const SCTP_DATA: ::c_int = 0x00;
pub const SCTP_INITIATION: ::c_int = 0x01;
pub const SCTP_INITIATION_ACK: ::c_int = 0x02;
pub const SCTP_SELECTIVE_ACK: ::c_int = 0x03;
pub const SCTP_HEARTBEAT_REQUEST: ::c_int = 0x04;
pub const SCTP_HEARTBEAT_ACK: ::c_int = 0x05;
pub const SCTP_ABORT_ASSOCIATION: ::c_int = 0x06;
pub const SCTP_SHUTDOWN: ::c_int = 0x07;
pub const SCTP_SHUTDOWN_ACK: ::c_int = 0x08;
pub const SCTP_OPERATION_ERROR: ::c_int = 0x09;
pub const SCTP_COOKIE_ECHO: ::c_int = 0x0a;
pub const SCTP_COOKIE_ACK: ::c_int = 0x0b;
pub const SCTP_ECN_ECHO: ::c_int = 0x0c;
pub const SCTP_ECN_CWR: ::c_int = 0x0d;
pub const SCTP_SHUTDOWN_COMPLETE: ::c_int = 0x0e;
pub const SCTP_AUTHENTICATION: ::c_int = 0x0f;
pub const SCTP_NR_SELECTIVE_ACK: ::c_int = 0x10;
pub const SCTP_ASCONF_ACK: ::c_int = 0x80;
pub const SCTP_PACKET_DROPPED: ::c_int = 0x81;
pub const SCTP_STREAM_RESET: ::c_int = 0x82;
pub const SCTP_PAD_CHUNK: ::c_int = 0x84;
pub const SCTP_FORWARD_CUM_TSN: ::c_int = 0xc0;
pub const SCTP_ASCONF: ::c_int = 0xc1;
pub const SCTP_HAD_NO_TCB: ::c_int = 0x01;
// pub const SCTP_FROM_MIDDLE_BOX: :: = SCTP_HAD_NO_TCB;
pub const SCTP_BADCRC: ::c_int = 0x02;
pub const SCTP_PACKET_TRUNCATED: ::c_int = 0x04;
pub const SCTP_CWR_REDUCE_OVERRIDE: ::c_int = 0x01;
pub const SCTP_CWR_IN_SAME_WINDOW: ::c_int = 0x02;
pub const SCTP_DATA_FRAG_MASK: ::c_int = 0x03;
pub const SCTP_DATA_MIDDLE_FRAG: ::c_int = 0x00;
pub const SCTP_DATA_LAST_FRAG: ::c_int = 0x01;
pub const SCTP_DATA_FIRST_FRAG: ::c_int = 0x02;
pub const SCTP_DATA_NOT_FRAG: ::c_int = 0x03;
pub const SCTP_DATA_UNORDERED: ::c_int = 0x04;
pub const SCTP_DATA_SACK_IMMEDIATELY: ::c_int = 0x08;
pub const SCTP_SACK_NONCE_SUM: ::c_int = 0x01;
pub const SCTP_SACK_CMT_DAC: ::c_int = 0x80;
pub const SCTP_PCB_FLAGS_UDPTYPE: ::c_int = 0x00000001;
pub const SCTP_PCB_FLAGS_TCPTYPE: ::c_int = 0x00000002;
pub const SCTP_PCB_FLAGS_BOUNDALL: ::c_int = 0x00000004;
pub const SCTP_PCB_FLAGS_ACCEPTING: ::c_int = 0x00000008;
pub const SCTP_PCB_FLAGS_UNBOUND: ::c_int = 0x00000010;
pub const SCTP_PCB_FLAGS_CLOSE_IP: ::c_int = 0x00040000;
pub const SCTP_PCB_FLAGS_WAS_CONNECTED: ::c_int = 0x00080000;
pub const SCTP_PCB_FLAGS_WAS_ABORTED: ::c_int = 0x00100000;
pub const SCTP_PCB_FLAGS_CONNECTED: ::c_int = 0x00200000;
pub const SCTP_PCB_FLAGS_IN_TCPPOOL: ::c_int = 0x00400000;
pub const SCTP_PCB_FLAGS_DONT_WAKE: ::c_int = 0x00800000;
pub const SCTP_PCB_FLAGS_WAKEOUTPUT: ::c_int = 0x01000000;
pub const SCTP_PCB_FLAGS_WAKEINPUT: ::c_int = 0x02000000;
pub const SCTP_PCB_FLAGS_BOUND_V6: ::c_int = 0x04000000;
pub const SCTP_PCB_FLAGS_BLOCKING_IO: ::c_int = 0x08000000;
pub const SCTP_PCB_FLAGS_SOCKET_GONE: ::c_int = 0x10000000;
pub const SCTP_PCB_FLAGS_SOCKET_ALLGONE: ::c_int = 0x20000000;
pub const SCTP_PCB_FLAGS_SOCKET_CANT_READ: ::c_int = 0x40000000;
pub const SCTP_PCB_FLAGS_BOUND_CONN: ::c_int = 0x80000000;
// pub const SCTP_PCB_COPY_FLAGS: :: = (SCTP_PCB_FLAGS_BOUNDALL|\;
// pub const SCTP_PCB_COPY_FLAGS: :: = (SCTP_PCB_FLAGS_BOUNDALL|\;
pub const SCTP_PCB_FLAGS_DO_NOT_PMTUD: ::c_ulong = 0x0000000000000001;
pub const SCTP_PCB_FLAGS_DONOT_HEARTBEAT: ::c_ulong = 0x0000000000000004;
pub const SCTP_PCB_FLAGS_FRAG_INTERLEAVE: ::c_ulong = 0x0000000000000008;
pub const SCTP_PCB_FLAGS_INTERLEAVE_STRMS: ::c_ulong = 0x0000000000000010;
pub const SCTP_PCB_FLAGS_DO_ASCONF: ::c_ulong = 0x0000000000000020;
pub const SCTP_PCB_FLAGS_AUTO_ASCONF: ::c_ulong = 0x0000000000000040;
pub const SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE: ::c_ulong = 0x0000000000000080;
pub const SCTP_PCB_FLAGS_NODELAY: ::c_ulong = 0x0000000000000100;
pub const SCTP_PCB_FLAGS_AUTOCLOSE: ::c_ulong = 0x0000000000000200;
pub const SCTP_PCB_FLAGS_RECVASSOCEVNT: ::c_ulong = 0x0000000000000800;
pub const SCTP_PCB_FLAGS_RECVPADDREVNT: ::c_ulong = 0x0000000000001000;
pub const SCTP_PCB_FLAGS_RECVPEERERR: ::c_ulong = 0x0000000000002000;
pub const SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT: ::c_ulong = 0x0000000000008000;
pub const SCTP_PCB_FLAGS_ADAPTATIONEVNT: ::c_ulong = 0x0000000000010000;
pub const SCTP_PCB_FLAGS_PDAPIEVNT: ::c_ulong = 0x0000000000020000;
pub const SCTP_PCB_FLAGS_AUTHEVNT: ::c_ulong = 0x0000000000040000;
pub const SCTP_PCB_FLAGS_STREAM_RESETEVNT: ::c_ulong = 0x0000000000080000;
pub const SCTP_PCB_FLAGS_NO_FRAGMENT: ::c_ulong = 0x0000000000100000;
pub const SCTP_PCB_FLAGS_EXPLICIT_EOR: ::c_ulong = 0x0000000000400000;
pub const SCTP_PCB_FLAGS_NEEDS_MAPPED_V4: ::c_ulong = 0x0000000000800000;
pub const SCTP_PCB_FLAGS_MULTIPLE_ASCONFS: ::c_ulong = 0x0000000001000000;
pub const SCTP_PCB_FLAGS_PORTREUSE: ::c_ulong = 0x0000000002000000;
pub const SCTP_PCB_FLAGS_DRYEVNT: ::c_ulong = 0x0000000004000000;
pub const SCTP_PCB_FLAGS_RECVRCVINFO: ::c_ulong = 0x0000000008000000;
pub const SCTP_PCB_FLAGS_RECVNXTINFO: ::c_ulong = 0x0000000010000000;
pub const SCTP_PCB_FLAGS_ASSOC_RESETEVNT: ::c_ulong = 0x0000000020000000;
pub const SCTP_PCB_FLAGS_STREAM_CHANGEEVNT: ::c_ulong = 0x0000000040000000;
pub const SCTP_PCB_FLAGS_RECVNSENDFAILEVNT: ::c_ulong = 0x0000000080000000;
pub const SCTP_MOBILITY_BASE: ::c_int = 0x00000001;
pub const SCTP_MOBILITY_FASTHANDOFF: ::c_int = 0x00000002;
pub const SCTP_MOBILITY_PRIM_DELETED: ::c_int = 0x00000004;
pub const SCTP_PACKET_LOG_SIZE: ::c_int = 65536;
pub const SCTP_BLK_LOGGING_ENABLE: ::c_int = 0x00000001;
pub const SCTP_CWND_MONITOR_ENABLE: ::c_int = 0x00000002;
pub const SCTP_CWND_LOGGING_ENABLE: ::c_int = 0x00000004;
pub const SCTP_FLIGHT_LOGGING_ENABLE: ::c_int = 0x00000020;
pub const SCTP_FR_LOGGING_ENABLE: ::c_int = 0x00000040;
pub const SCTP_LOCK_LOGGING_ENABLE: ::c_int = 0x00000080;
pub const SCTP_MAP_LOGGING_ENABLE: ::c_int = 0x00000100;
pub const SCTP_MBCNT_LOGGING_ENABLE: ::c_int = 0x00000200;
pub const SCTP_MBUF_LOGGING_ENABLE: ::c_int = 0x00000400;
pub const SCTP_NAGLE_LOGGING_ENABLE: ::c_int = 0x00000800;
pub const SCTP_RECV_RWND_LOGGING_ENABLE: ::c_int = 0x00001000;
pub const SCTP_RTTVAR_LOGGING_ENABLE: ::c_int = 0x00002000;
pub const SCTP_SACK_LOGGING_ENABLE: ::c_int = 0x00004000;
pub const SCTP_SACK_RWND_LOGGING_ENABLE: ::c_int = 0x00008000;
pub const SCTP_SB_LOGGING_ENABLE: ::c_int = 0x00010000;
pub const SCTP_STR_LOGGING_ENABLE: ::c_int = 0x00020000;
pub const SCTP_WAKE_LOGGING_ENABLE: ::c_int = 0x00040000;
pub const SCTP_LOG_MAXBURST_ENABLE: ::c_int = 0x00080000;
pub const SCTP_LOG_RWND_ENABLE: ::c_int = 0x00100000;
pub const SCTP_LOG_SACK_ARRIVALS_ENABLE: ::c_int = 0x00200000;
pub const SCTP_LTRACE_CHUNK_ENABLE: ::c_int = 0x00400000;
pub const SCTP_LTRACE_ERROR_ENABLE: ::c_int = 0x00800000;
pub const SCTP_LAST_PACKET_TRACING: ::c_int = 0x01000000;
pub const SCTP_THRESHOLD_LOGGING: ::c_int = 0x02000000;
pub const SCTP_LOG_AT_SEND_2_SCTP: ::c_int = 0x04000000;
pub const SCTP_LOG_AT_SEND_2_OUTQ: ::c_int = 0x08000000;
pub const SCTP_LOG_TRY_ADVANCE: ::c_int = 0x10000000;

f! {
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
Expand Down