EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

NetworkPkg/Ip6Dxe/Ip6If.h

Go to the documentation of this file.
00001 
00016 #ifndef __EFI_IP6_IF_H__
00017 #define __EFI_IP6_IF_H__
00018 
00019 #define IP6_LINK_RX_SIGNATURE   SIGNATURE_32 ('I', 'P', '6', 'R')
00020 #define IP6_LINK_TX_SIGNATURE   SIGNATURE_32 ('I', 'P', '6', 'T')
00021 #define IP6_INTERFACE_SIGNATURE SIGNATURE_32 ('I', 'P', '6', 'I')
00022 #define IP6_ADDR_INFO_SIGNATURE SIGNATURE_32 ('I', 'P', 'A', 'I')
00023 
00024 //
00025 // This prototype is used by both receive and transmission.
00026 // When receiving Netbuf is allocated by IP6_INTERFACE, and
00027 // released by IP6. Flag shows whether the frame is received
00028 // as unicast/multicast/anycast...
00029 //
00030 // When transmitting, the Netbuf is from IP6, and provided
00031 // to the callback as a reference. Flag isn't used.
00032 //
00033 // IpInstance can be NULL which means that it is the IP6 driver
00034 // itself sending the packets. IP6 driver may send packets that
00035 // don't belong to any instance, such as ICMP errors, ICMP
00036 // informational packets. IpInstance is used as a tag in
00037 // this module.
00038 //
00039 typedef
00040 VOID
00041 (*IP6_FRAME_CALLBACK) (
00042   NET_BUF                   *Packet,
00043   EFI_STATUS                IoStatus,
00044   UINT32                    LinkFlag,
00045   VOID                      *Context
00046   );
00047 
00048 //
00049 // Each receive request is wrapped in an IP6_LINK_RX_TOKEN.
00050 // Upon completion, the Callback will be called. Only one
00051 // receive request is send to MNP. IpInstance is always NULL.
00052 // Reference MNP's spec for information.
00053 //
00054 typedef struct {
00055   UINT32                                Signature;
00056   IP6_FRAME_CALLBACK                    CallBack;
00057   VOID                                  *Context;
00058   EFI_MANAGED_NETWORK_COMPLETION_TOKEN  MnpToken;
00059 } IP6_LINK_RX_TOKEN;
00060 
00061 //
00062 // Each transmit request is wrapped in an IP6_LINK_TX_TOKEN.
00063 // Upon completion, the Callback will be called.
00064 //
00065 typedef struct {
00066   UINT32                                Signature;
00067   LIST_ENTRY                            Link;
00068 
00069   IP6_PROTOCOL                          *IpInstance;
00070   IP6_FRAME_CALLBACK                    CallBack;
00071   NET_BUF                               *Packet;
00072   VOID                                  *Context;
00073 
00074   EFI_MAC_ADDRESS                       DstMac;
00075   EFI_MAC_ADDRESS                       SrcMac;
00076 
00077   EFI_MANAGED_NETWORK_COMPLETION_TOKEN  MnpToken;
00078   EFI_MANAGED_NETWORK_TRANSMIT_DATA     MnpTxData;
00079 } IP6_LINK_TX_TOKEN;
00080 
00081 struct _IP6_ADDRESS_INFO {
00082   UINT32                  Signature;
00083   LIST_ENTRY              Link;
00084   EFI_IPv6_ADDRESS        Address;
00085   BOOLEAN                 IsAnycast;
00086   UINT8                   PrefixLength;
00087   UINT32                  ValidLifetime;
00088   UINT32                  PreferredLifetime;
00089 };
00090 
00091 //
00092 // Callback to select which frame to cancel. Caller can cancel a
00093 // single frame, or all the frame from an IP instance.
00094 //
00095 typedef
00096 BOOLEAN
00097 (*IP6_FRAME_TO_CANCEL) (
00098   IP6_LINK_TX_TOKEN       *Frame,
00099   VOID                    *Context
00100   );
00101 
00102 struct _IP6_INTERFACE {
00103   UINT32                        Signature;
00104   LIST_ENTRY                    Link;
00105   INTN                          RefCnt;
00106 
00107   //
00108   // IP address and prefix length of the interface.  The fileds
00109   // are invalid if (Configured == FALSE)
00110   //
00111   LIST_ENTRY                    AddressList;
00112   UINT32                        AddressCount;
00113   BOOLEAN                       Configured;
00114 
00115   IP6_SERVICE                   *Service;
00116 
00117   EFI_HANDLE                    Controller;
00118   EFI_HANDLE                    Image;
00119 
00120 
00121   //
00122   // Queues to keep the frames sent and waiting ARP request.
00123   //
00124   LIST_ENTRY                    ArpQues;
00125   LIST_ENTRY                    SentFrames;
00126 
00127 
00128   //
00129   // The interface's configuration variables
00130   //
00131   UINT32                        DupAddrDetect;
00132   LIST_ENTRY                    DupAddrDetectList;
00133   LIST_ENTRY                    DelayJoinList;
00134 
00135   //
00136   // All the IP instances that have the same IP/SubnetMask are linked
00137   // together through IpInstances. If any of the instance enables
00138   // promiscuous receive, PromiscRecv is true.
00139   //
00140   LIST_ENTRY                    IpInstances;
00141   BOOLEAN                       PromiscRecv;
00142 };
00143 
00154 IP6_INTERFACE *
00155 Ip6CreateInterface (
00156   IN IP6_SERVICE            *IpSb,
00157   IN BOOLEAN                LinkLocal
00158   );
00159 
00172 VOID
00173 Ip6CleanInterface (
00174   IN  IP6_INTERFACE         *Interface,
00175   IN  IP6_PROTOCOL          *IpInstance           OPTIONAL
00176   );
00177 
00185 VOID
00186 Ip6FreeLinkTxToken (
00187   IN IP6_LINK_TX_TOKEN      *Token
00188   );
00189 
00197 VOID
00198 EFIAPI
00199 Ip6OnFrameReceived (
00200   IN EFI_EVENT                Event,
00201   IN VOID                     *Context
00202   );
00203 
00215 EFI_STATUS
00216 Ip6ReceiveFrame (
00217   IN  IP6_FRAME_CALLBACK    CallBack,
00218   IN  IP6_SERVICE           *IpSb
00219   );
00220 
00241 EFI_STATUS
00242 Ip6SendFrame (
00243   IN  IP6_INTERFACE         *Interface,
00244   IN  IP6_PROTOCOL          *IpInstance      OPTIONAL,
00245   IN  NET_BUF               *Packet,
00246   IN  EFI_IPv6_ADDRESS      *NextHop,
00247   IN  IP6_FRAME_CALLBACK    CallBack,
00248   IN  VOID                  *Context
00249   );
00250 
00260 VOID
00261 EFIAPI
00262 Ip6TimerTicking (
00263   IN EFI_EVENT              Event,
00264   IN VOID                   *Context
00265   );
00266 
00267 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines