summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkRouting.h
blob: 3ed7e02564b4817a45ec4556fb7ad3fe54dfad47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**************************************************************************//**
  \file nwkRouting.h

  \brief Routing header file.

  \author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).

  \internal
   History:
    2007-06-14 V. Panov - Created.
    2008-09-06 M. Gekk  - Modified to support parallel processing.
    2009-09-08 M. Gekk  - Refactoring.
   Last change:
    $Id: nwkRouting.h 17448 2011-06-09 13:53:59Z ataradov $
 ******************************************************************************/
#if !defined _NWK_ROUTING_H
#define _NWK_ROUTING_H

/******************************************************************************
                               Includes section
 ******************************************************************************/
#include <nwkConfig.h>
#include <appFramework.h>
#include <nldeData.h>

/******************************************************************************
                              Prototypes section
 ******************************************************************************/
/**************************************************************************//**
  \brief Getting MAC short address of next hop by destination network address.

  \param[in] dstAddr - destination network address.
  \param[in] srcAddr - short address of node for that a next hop is searched.
  \param[in] prevHopAddr - address of previous hop.
  \param[in] isMulticast - 'true' if destination address is multicast group.
  \param[in] isMulticastMember - 'true' if destination address is multicast
                                 member address.
  \param[in] nextHop - pointer to short address of next hop node
                       or MAC_NO_SHORT_ADDR.
  \param[in] hops - number of hops that is equal to CS_MAX_NETWORK_DEPTH * 2.
                   It is not read in function to avoid unnecessary reading of
                   CS_MAX_NETWORK_DEPTH when not implementing routing of packet
                   from upper layer.

  \return Routing method used for searching the next hop node.
 ******************************************************************************/
NWK_PRIVATE NwkRouting_t nwkGetNextHop(const ShortAddr_t dstAddr,
  const ShortAddr_t srcAddr, const ShortAddr_t prevHopAddr,
  const bool isMulticast, const bool isMulticastMember,
  ShortAddr_t *const nextHop, NwkRadius_t hops);

/**************************************************************************//**
  \brief Process routing result.

     Update link state, the routing table and indicate to upper layer..

  \param[in] outPkt - pointer to output packet.
  \param[in] nwkStatus - status of transmission.
  \return None.
 ******************************************************************************/
NWK_PRIVATE void nwkRoutingIsCompleted(const NwkOutputPacket_t *const outPkt,
  const NWK_Status_t nwkStatus);

#endif /* _NWK_ROUTING_H */
/** eof nwkRouting.h */