Functions | |
VOID EFIAPI | Ip6OnFrameSent (IN EFI_EVENT Event, IN VOID *Context) |
BOOLEAN | Ip6CancelInstanceFrame (IN IP6_LINK_TX_TOKEN *Frame, IN VOID *Context) |
EFI_STATUS | Ip6SetAddress (IN IP6_INTERFACE *Interface, IN EFI_IPv6_ADDRESS *Ip6Addr, IN BOOLEAN IsAnycast, IN UINT8 PrefixLength, IN UINT32 ValidLifetime, IN UINT32 PreferredLifetime, IN IP6_DAD_CALLBACK DadCallback, IN VOID *Context) |
IP6_INTERFACE * | Ip6CreateInterface (IN IP6_SERVICE *IpSb, IN BOOLEAN LinkLocal) |
VOID | Ip6CleanInterface (IN IP6_INTERFACE *Interface, IN IP6_PROTOCOL *IpInstance) |
IP6_LINK_TX_TOKEN * | Ip6CreateLinkTxToken (IN IP6_INTERFACE *Interface, IN IP6_PROTOCOL *IpInstance, IN NET_BUF *Packet, IN IP6_FRAME_CALLBACK CallBack, IN VOID *Context) |
VOID | Ip6FreeLinkTxToken (IN IP6_LINK_TX_TOKEN *Token) |
VOID EFIAPI | Ip6RecycleFrame (IN VOID *Context) |
VOID EFIAPI | Ip6OnFrameReceivedDpc (IN VOID *Context) |
VOID EFIAPI | Ip6OnFrameReceived (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS | Ip6ReceiveFrame (IN IP6_FRAME_CALLBACK CallBack, IN IP6_SERVICE *IpSb) |
VOID EFIAPI | Ip6OnFrameSentDpc (IN VOID *Context) |
EFI_STATUS | Ip6SendFrame (IN IP6_INTERFACE *Interface, IN IP6_PROTOCOL *IpInstance, IN NET_BUF *Packet, IN EFI_IPv6_ADDRESS *NextHop, IN IP6_FRAME_CALLBACK CallBack, IN VOID *Context) |
VOID EFIAPI | Ip6TimerTicking (IN EFI_EVENT Event, IN VOID *Context) |
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
BOOLEAN Ip6CancelInstanceFrame | ( | IN IP6_LINK_TX_TOKEN * | Frame, | |
IN VOID * | Context | |||
) |
Fileter function to cancel all the frame related to an IP instance.
[in] | Frame | The transmit request to test whether to cancel. |
[in] | Context | The context which is the Ip instance that issued the transmit. |
TRUE | The frame belongs to this instance and is to be removed. | |
FALSE | The frame doesn't belong to this instance. |
Referenced by Ip6CleanInterface().
VOID Ip6CleanInterface | ( | IN IP6_INTERFACE * | Interface, | |
IN IP6_PROTOCOL * | IpInstance | |||
) |
Free the interface used by IpInstance. All the IP instance with the same Ip/prefix pair share the same interface. It is reference counted. All the frames that haven't been sent will be cancelled. Because the IpInstance is optional, the caller must remove IpInstance from the interface's instance list.
[in] | Interface | The interface used by the IpInstance. |
[in] | IpInstance | The IP instance that free the interface. NULL if the IP driver is releasing the default interface. |
References IP6_INTERFACE_SIGNATURE, Ip6CancelFrames(), Ip6CancelInstanceFrame(), and Ip6RemoveAddr().
Referenced by Ip6CleanProtocol(), and Ip6CleanService().
IP6_INTERFACE* Ip6CreateInterface | ( | IN IP6_SERVICE * | IpSb, | |
IN BOOLEAN | LinkLocal | |||
) |
Create an IP6_INTERFACE.
[in] | IpSb | The IP6 service binding instance. |
[in] | LinkLocal | If TRUE, the instance is created for link-local address. Otherwise, it is not for a link-local address. |
References _IP6_INTERFACE::AddressCount, _IP6_INTERFACE::AddressList, _IP6_INTERFACE::ArpQues, _IP6_INTERFACE::Configured, _IP6_INTERFACE::Controller, _IP6_INTERFACE::DelayJoinList, _IP6_INTERFACE::DupAddrDetect, _IP6_INTERFACE::DupAddrDetectList, _IP6_INTERFACE::Image, IP6_INFINIT_LIFETIME, IP6_INTERFACE_SIGNATURE, IP6_LINK_LOCAL_PREFIX_LENGTH, IP6_SERVICE_SIGNATURE, Ip6CreateLinkLocalAddr(), Ip6SetAddress(), _IP6_INTERFACE::IpInstances, _IP6_INTERFACE::PromiscRecv, _IP6_INTERFACE::RefCnt, _IP6_INTERFACE::SentFrames, _IP6_INTERFACE::Service, and _IP6_INTERFACE::Signature.
Referenced by Ip6CreateService().
IP6_LINK_TX_TOKEN* Ip6CreateLinkTxToken | ( | IN IP6_INTERFACE * | Interface, | |
IN IP6_PROTOCOL * | IpInstance, | |||
IN NET_BUF * | Packet, | |||
IN IP6_FRAME_CALLBACK | CallBack, | |||
IN VOID * | Context | |||
) |
Create and wrap a transmit request into a newly allocated IP6_LINK_TX_TOKEN.
[in] | Interface | The interface to send out from. |
[in] | IpInstance | The IpInstance that transmit the packet. NULL if the packet is sent by the IP6 driver itself. |
[in] | Packet | The packet to transmit |
[in] | CallBack | Call back function to execute if transmission finished. |
[in] | Context | Opaque parameter to the callback. |
References IP6_LINK_TX_TOKEN::CallBack, IP6_LINK_TX_TOKEN::Context, IP6_LINK_TX_TOKEN::DstMac, IP6_ETHER_PROTO, IP6_LINK_TX_SIGNATURE, Ip6OnFrameSent(), IP6_LINK_TX_TOKEN::IpInstance, IP6_LINK_TX_TOKEN::Link, IP6_LINK_TX_TOKEN::MnpToken, IP6_LINK_TX_TOKEN::MnpTxData, IP6_LINK_TX_TOKEN::Packet, IP6_LINK_TX_TOKEN::Signature, and IP6_LINK_TX_TOKEN::SrcMac.
Referenced by Ip6SendFrame().
VOID Ip6FreeLinkTxToken | ( | IN IP6_LINK_TX_TOKEN * | Token | ) |
Free the link layer transmit token. It will close the event, then free the memory used.
[in] | Token | Token to free. |
References IP6_LINK_TX_SIGNATURE.
Referenced by Ip6FreeNeighborEntry(), Ip6OnArpResolved(), Ip6OnFrameSentDpc(), and Ip6SendFrame().
VOID EFIAPI Ip6OnFrameReceived | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
Request Ip6OnFrameReceivedDpc as a DPC at TPL_CALLBACK.
Event | The receive event delivered to MNP for receive. | |
Context | Context for the callback. |
References Ip6OnFrameReceivedDpc().
Referenced by Ip6CreateService().
VOID EFIAPI Ip6OnFrameReceivedDpc | ( | IN VOID * | Context | ) |
Received a frame from MNP. Wrap it in net buffer then deliver it to IP's input function. The ownship of the packet also is transferred to IP. When Ip is finished with this packet, it will call NetbufFree to release the packet, NetbufFree will again call the Ip6RecycleFrame to signal MNP's event and free the token used.
[in] | Context | Context for the callback. |
References IP6_LINK_RX_TOKEN::CallBack, IP6_LINK_RX_TOKEN::Context, IP6_LINK_BROADCAST, IP6_LINK_MULTICAST, IP6_LINK_PROMISC, IP6_LINK_RX_SIGNATURE, IP6_MAX_HEADLEN, IP6_SERVICE_SIGNATURE, Ip6RecycleFrame(), and IP6_LINK_RX_TOKEN::MnpToken.
Referenced by Ip6OnFrameReceived().
VOID EFIAPI Ip6OnFrameSent | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
Request Ip6OnFrameSentDpc as a DPC at TPL_CALLBACK.
[in] | Event | The transmit token's event. |
[in] | Context | The Context which is pointed to the token. |
[in] | Event | The transmit token's event. |
[in] | Context | Context which points to the token. |
References Ip6OnFrameSentDpc().
Referenced by Ip6CreateLinkTxToken().
VOID EFIAPI Ip6OnFrameSentDpc | ( | IN VOID * | Context | ) |
Callback funtion when frame transmission is finished. It will call the frame owner's callback function to tell it the result.
[in] | Context | Context which points to the token. |
References IP6_LINK_TX_TOKEN::CallBack, IP6_LINK_TX_TOKEN::Context, IP6_LINK_TX_SIGNATURE, Ip6FreeLinkTxToken(), IP6_LINK_TX_TOKEN::Link, IP6_LINK_TX_TOKEN::MnpToken, and IP6_LINK_TX_TOKEN::Packet.
Referenced by Ip6OnFrameSent().
EFI_STATUS Ip6ReceiveFrame | ( | IN IP6_FRAME_CALLBACK | CallBack, | |
IN IP6_SERVICE * | IpSb | |||
) |
Request to receive the packet from the interface.
[in] | CallBack | Function to call when receive finished. |
[in] | IpSb | Points to IP6 service binding instance. |
EFI_ALREADY_STARTED | There is already a pending receive request. | |
EFI_OUT_OF_RESOURCES | Failed to allocate resource to receive. | |
EFI_SUCCESS | The recieve request has been started. |
References IP6_LINK_RX_TOKEN::CallBack, IP6_LINK_RX_TOKEN::Context, IP6_SERVICE_SIGNATURE, and IP6_LINK_RX_TOKEN::MnpToken.
Referenced by Ip6AcceptFrame(), and Ip6DriverBindingStart().
VOID EFIAPI Ip6RecycleFrame | ( | IN VOID * | Context | ) |
Callback function when the received packet is freed. Check Ip6OnFrameReceived for information.
[in] | Context | Points to EFI_MANAGED_NETWORK_RECEIVE_DATA. |
Referenced by Ip6OnFrameReceivedDpc().
EFI_STATUS Ip6SendFrame | ( | IN IP6_INTERFACE * | Interface, | |
IN IP6_PROTOCOL * | IpInstance, | |||
IN NET_BUF * | Packet, | |||
IN EFI_IPv6_ADDRESS * | NextHop, | |||
IN IP6_FRAME_CALLBACK | CallBack, | |||
IN VOID * | Context | |||
) |
Send a frame from the interface. If the next hop is a multicast address, it is transmitted immediately. If the next hop is a unicast, and the NextHop's MAC is not known, it will perform address resolution. If an error occurred, the CallBack won't be called. So, the caller must test the return value, and take action when there is an error.
[in] | Interface | The interface to send the frame from |
[in] | IpInstance | The IP child that request the transmission. NULL if it is the IP6 driver itself. |
[in] | Packet | The packet to transmit. |
[in] | NextHop | The immediate destination to transmit the packet to. |
[in] | CallBack | Function to call back when transmit finished. |
[in] | Context | Opaque parameter to the callback. |
EFI_OUT_OF_RESOURCES | Failed to allocate resource to send the frame. | |
EFI_NO_MAPPING | Can't resolve the MAC for the nexthop. | |
EFI_SUCCESS | The packet successfully transmitted. |
References _IP6_NEIGHBOR_ENTRY::ArpFree, _IP6_NEIGHBOR_ENTRY::ArpList, IP6_LINK_TX_TOKEN::DstMac, _IP6_NEIGHBOR_ENTRY::Frames, _IP6_NEIGHBOR_ENTRY::Interface, IP6_DELAY_FIRST_PROBE_TIME, IP6_GET_TICKS, IP6_SERVICE_SIGNATURE, Ip6CreateLinkTxToken(), Ip6FindNeighborEntry(), Ip6FreeLinkTxToken(), Ip6GetMulticastMac(), IP6_LINK_TX_TOKEN::Link, _IP6_NEIGHBOR_ENTRY::LinkAddress, _IP6_SERVICE::LinkLocalOk, _IP6_SERVICE::Mnp, IP6_LINK_TX_TOKEN::MnpToken, _IP6_SERVICE::SnpMode, _IP6_NEIGHBOR_ENTRY::State, and _IP6_NEIGHBOR_ENTRY::Ticks.
Referenced by Ip6Output().
EFI_STATUS Ip6SetAddress | ( | IN IP6_INTERFACE * | Interface, | |
IN EFI_IPv6_ADDRESS * | Ip6Addr, | |||
IN BOOLEAN | IsAnycast, | |||
IN UINT8 | PrefixLength, | |||
IN UINT32 | ValidLifetime, | |||
IN UINT32 | PreferredLifetime, | |||
IN IP6_DAD_CALLBACK | DadCallback, | |||
IN VOID * | Context | |||
) |
Set the interface's address. This will trigger the DAD process for the address to set. To set an already set address, the lifetimes wil be updated to the new value passed in.
[in] | Interface | The interface to set the address. |
[in] | Ip6Addr | The interface's to be assigned IPv6 address. |
[in] | IsAnycast | If TRUE, the unicast IPv6 address is anycast. Otherwise, it is not anycast. |
[in] | PrefixLength | The prefix length of the Ip6Addr. |
[in] | ValidLifetime | The valid lifetime for this address. |
[in] | PreferredLifetime | The preferred lifetime for this address. |
[in] | DadCallback | The caller's callback to trigger when DAD finishes. This is an optional parameter that may be NULL. |
[in] | Context | The context that will be passed to DadCallback. This is an optional parameter that may be NULL. |
EFI_SUCCESS | The interface is scheduled to be configured with the specified address. | |
EFI_OUT_OF_RESOURCES | Failed to set the interface's address due to lack of resources. |
References _IP6_ADDRESS_INFO::Address, _IP6_DELAY_JOIN_LIST::AddressInfo, _IP6_SERVICE::AutonomousPrefix, _IP6_DELAY_JOIN_LIST::Context, _IP6_DELAY_JOIN_LIST::DadCallback, _IP6_DELAY_JOIN_LIST::DelayTime, _IP6_DELAY_JOIN_LIST::Interface, IP6_ADDR_INFO_SIGNATURE, IP6_INTERFACE_SIGNATURE, IP6_LINK_LOCAL_PREFIX_LENGTH, IP6_ONE_SECOND_IN_MS, IP6_TIMER_INTERVAL_IN_MS, Ip6IsOneOfSetAddress(), _IP6_ADDRESS_INFO::IsAnycast, _IP6_DELAY_JOIN_LIST::Link, _IP6_SERVICE::OnlinkPrefix, _IP6_ADDRESS_INFO::PreferredLifetime, _IP6_PREFIX_LIST_ENTRY::Prefix, _IP6_PREFIX_LIST_ENTRY::PrefixLength, _IP6_ADDRESS_INFO::PrefixLength, _IP6_ADDRESS_INFO::Signature, and _IP6_ADDRESS_INFO::ValidLifetime.
Referenced by Ip6ConfigOnDhcp6Event(), Ip6ConfigSetMaunualAddress(), Ip6CreateInterface(), and Ip6ProcessRouterAdvertise().
VOID EFIAPI Ip6TimerTicking | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
The heartbeat timer of IP6 service instance. It times out all of its IP6 children's received-but-not-delivered and transmitted-but-not-recycle packets.
[in] | Event | The IP6 service instance's heartbeat timer. |
[in] | Context | The IP6 service instance. |
References IP6_SERVICE_SIGNATURE, Ip6MldTimerTicking(), Ip6NdTimerTicking(), and Ip6PacketTimerTicking().
Referenced by Ip6CreateService().