2018-06-26 02:41:28 +08:00
|
|
|
/****************************************************************************
|
|
|
|
* net/udp/udp_setsockopt.c
|
|
|
|
*
|
2021-02-19 19:45:37 +08:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you 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
|
2018-06-26 02:41:28 +08:00
|
|
|
*
|
2021-02-19 19:45:37 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2018-06-26 02:41:28 +08:00
|
|
|
*
|
2021-02-19 19:45:37 +08:00
|
|
|
* 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.
|
2018-06-26 02:41:28 +08:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
2021-04-29 04:18:16 +08:00
|
|
|
#include <net/if.h>
|
2018-06-26 02:41:28 +08:00
|
|
|
#include <netinet/udp.h>
|
|
|
|
|
|
|
|
#include <nuttx/net/net.h>
|
2021-04-29 04:18:16 +08:00
|
|
|
#include <nuttx/net/netdev.h>
|
2018-06-26 02:41:28 +08:00
|
|
|
#include <nuttx/net/udp.h>
|
|
|
|
|
|
|
|
#include "socket/socket.h"
|
|
|
|
#include "utils/utils.h"
|
2018-06-26 05:07:53 +08:00
|
|
|
#include "netdev/netdev.h"
|
2018-06-26 02:41:28 +08:00
|
|
|
#include "udp/udp.h"
|
|
|
|
|
|
|
|
#ifdef CONFIG_NET_UDPPROTO_OPTIONS
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: udp_setsockopt
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* udp_setsockopt() sets the UDP-protocol option specified by the
|
|
|
|
* 'option' argument to the value pointed to by the 'value' argument for
|
|
|
|
* the socket specified by the 'psock' argument.
|
|
|
|
*
|
|
|
|
* See <netinet/udp.h> for the a complete list of values of UDP protocol
|
|
|
|
* options.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* psock Socket structure of socket to operate on
|
|
|
|
* option identifies the option to set
|
|
|
|
* value Points to the argument value
|
|
|
|
* value_len The length of the argument value
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Returns zero (OK) on success. On failure, it returns a negated errno
|
|
|
|
* value to indicate the nature of the error. See psock_setcockopt() for
|
|
|
|
* the list of possible error values.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int udp_setsockopt(FAR struct socket *psock, int option,
|
|
|
|
FAR const void *value, socklen_t value_len)
|
|
|
|
{
|
|
|
|
return -ENOPROTOOPT;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CONFIG_NET_UDPPROTO_OPTIONS */
|