icmpv6_poll.c 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /****************************************************************************
  2. * net/icmpv6/icmpv6_poll.c
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one or more
  5. * contributor license agreements. See the NOTICE file distributed with
  6. * this work for additional information regarding copyright ownership. The
  7. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance with the
  9. * License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. * License for the specific language governing permissions and limitations
  17. * under the License.
  18. *
  19. ****************************************************************************/
  20. /****************************************************************************
  21. * Included Files
  22. ****************************************************************************/
  23. #include <nuttx/config.h>
  24. #if defined(CONFIG_NET_ICMPv6_SOCKET) || defined(CONFIG_NET_ICMPv6_NEIGHBOR)
  25. #include <debug.h>
  26. #include <nuttx/net/netconfig.h>
  27. #include <nuttx/net/netdev.h>
  28. #include <nuttx/net/icmpv6.h>
  29. #include "devif/devif.h"
  30. #include "icmpv6/icmpv6.h"
  31. /****************************************************************************
  32. * Public Functions
  33. ****************************************************************************/
  34. /****************************************************************************
  35. * Name: icmpv6_poll
  36. *
  37. * Description:
  38. * Poll a UDP "connection" structure for availability of TX data
  39. *
  40. * Input Parameters:
  41. * dev - The device driver structure to use in the send operation
  42. * conn - A pointer to the ICMPv6 connection structure
  43. *
  44. * Returned Value:
  45. * None
  46. *
  47. * Assumptions:
  48. * The network is locked.
  49. *
  50. ****************************************************************************/
  51. void icmpv6_poll(FAR struct net_driver_s *dev,
  52. FAR struct icmpv6_conn_s *conn)
  53. {
  54. /* Setup for the application callback */
  55. dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPICMPv6_HDRLEN];
  56. dev->d_len = 0;
  57. dev->d_sndlen = 0;
  58. /* Perform the application callback */
  59. devif_conn_event(dev, conn, ICMPv6_POLL,
  60. conn ? conn->list : dev->d_conncb);
  61. }
  62. #endif /* CONFIG_NET_ICMPv6_SOCKET || CONFIG_NET_ICMPv6_NEIGHBOR */