| 1 | /* SCTP kernel Implementation: User API extensions. |
| 2 | * |
| 3 | * opt_info.c |
| 4 | * |
| 5 | * Distributed under the terms of the LGPL v2.1 as described in |
| 6 | * http://www.gnu.org/copyleft/lesser.txt |
| 7 | * |
| 8 | * This file is part of the user library that offers support for the |
| 9 | * SCTP kernel Implementation. The main purpose of this |
| 10 | * code if to provide the SCTP Socket API mappings for user |
| 11 | * application to interface with the SCTP in kernel. |
| 12 | * |
| 13 | * This implementation is based on the Socket API Extensions for SCTP |
| 14 | * defined in <draft-ietf-tsvwg-sctpsocket-10.txt. |
| 15 | * |
| 16 | * (C) Copyright IBM Corp. 2003 |
| 17 | * Copyright (c) 2002 Intel Corporation. |
| 18 | * |
| 19 | * Written or modified by: |
| 20 | * Ardelle Fan <[email protected]> |
| 21 | */ |
| 22 | |
| 23 | #include <sys/socket.h> /* struct sockaddr_storage, setsockopt() */ |
| 24 | #include <netinet/sctp.h>cxx . . $ `<file>/src/include/netinet/sctp.h`/ /* SCTP_SOCKOPT_BINDX_* */ |
| 25 | #include <errno.h> |
| 26 | |
| 27 | /* Support the sctp_opt_info() interface. |
| 28 | * |
| 29 | * See Sockets API Extensions for SCTP. Section 7. |
| 30 | * |
| 31 | * Pass sctp option information pass both in to and out of the SCTP stack. |
| 32 | * This is a new SCTP API described in the section 7 of the Sockets API |
| 33 | * Extensions for SCTP. This is implemented using the getsockopt() interface. |
| 34 | */ |
| 35 | int |
| 36 | sctp_opt_infocxx . . $ sctp_opt_info(b79d9f11efef15f9).(int sd, sctp_assoc_tcxx . . $ sctp_assoc_t# id, int opt, void *arg, socklen_tcxx . . $ socklen_t# *size) |
| 37 | { |
| 38 | switch (opt) { |
| 39 | case SCTP_RTOINFOcxx . . $ `<external>/17169092326581286071/sctp.h:69:9`!: |
| 40 | case SCTP_ASSOCINFOcxx . . $ `<external>/17169092326581286071/sctp.h:70:9`!: |
| 41 | case SCTP_INITMSGcxx . . $ `<external>/17169092326581286071/sctp.h:71:9`!: |
| 42 | case SCTP_NODELAYcxx . . $ `<external>/17169092326581286071/sctp.h:72:9`!: |
| 43 | case SCTP_AUTOCLOSEcxx . . $ `<external>/17169092326581286071/sctp.h:73:9`!: |
| 44 | case SCTP_PRIMARY_ADDRcxx . . $ `<external>/17169092326581286071/sctp.h:75:9`!: |
| 45 | case SCTP_DISABLE_FRAGMENTScxx . . $ `<external>/17169092326581286071/sctp.h:77:9`!: |
| 46 | case SCTP_PEER_ADDR_PARAMScxx . . $ `<external>/17169092326581286071/sctp.h:78:9`!: |
| 47 | case SCTP_DEFAULT_SEND_PARAMcxx . . $ `<external>/17169092326581286071/sctp.h:79:9`!: |
| 48 | case SCTP_EVENTScxx . . $ `<external>/17169092326581286071/sctp.h:80:9`!: |
| 49 | case SCTP_I_WANT_MAPPED_V4_ADDRcxx . . $ `<external>/17169092326581286071/sctp.h:81:9`!: |
| 50 | case SCTP_MAXSEGcxx . . $ `<external>/17169092326581286071/sctp.h:82:9`!: |
| 51 | case SCTP_STATUScxx . . $ `<external>/17169092326581286071/sctp.h:83:9`!: |
| 52 | case SCTP_GET_PEER_ADDR_INFOcxx . . $ `<external>/17169092326581286071/sctp.h:84:9`!: |
| 53 | case SCTP_AUTH_ACTIVE_KEYcxx . . $ `<external>/17169092326581286071/sctp.h:95:9`!: |
| 54 | case SCTP_PEER_AUTH_CHUNKScxx . . $ `<external>/17169092326581286071/sctp.h:97:9`!: |
| 55 | case SCTP_LOCAL_AUTH_CHUNKScxx . . $ `<external>/17169092326581286071/sctp.h:98:9`!: |
| 56 | *(sctp_assoc_tcxx . . $ sctp_assoc_t# *)arg = id; |
| 57 | return getsockoptcxx . . $ getsockopt(b79d9f11efef15f9).(sd, IPPROTO_SCTPcxx . . $ `src/include/netinet/sctp.h:52:9`!, opt, arg, size); |
| 58 | default: |
| 59 | return ENOTSUPcxx . . $ `<external>/1531017962457201737/errno.h:30:11`!; |
| 60 | } |
| 61 | |
| 62 | } /* sctp_opt_info() */ |