IP_NAT_REGISTER_EDITOR (Windows CE 5.0)

Send Feedback

This structure allows the editor to register itself with the network address translation (NAT), and to obtain the entry points of helper functions provided by the NAT.

typedef struct {ULONGVersion;ULONGFlags;UCHARProtocol;USHORTPort;IP_NAT_DIRECTIONDirection;PVOIDEditorContext;PNAT_EDITOR_CREATE_HANDLERCreateHandler;PNAT_EDITOR_DELETE_HANDLERDeleteHandler;PNAT_EDITOR_DATA_HANDLERForwardDataHandler;PNAT_EDITOR_DATA_HANDLERReverseDataHandler;PVOIDEditorHandle;PNAT_EDITOR_CREATE_TICKETCreateTicket;PNAT_EDITOR_DELETE_TICKETDeleteTicket;PNAT_EDITOR_DEREGISTERDeregister;PNAT_EDITOR_DISSOCIATE_SESSIONDissociateSession;PNAT_EDITOR_EDIT_SESSIONEditSession;PNAT_EDITOR_QUERY_INFO_SESSIONQueryInfoSession;PNAT_EDITOR_TIMEOUT_SESSIONTimeoutSession;} IP_NAT_REGISTER_EDITOR;

Members

  • Version
    [in] Unsigned long integer that specifies the version of NAT. Set to IP_NAT_VERSION.

  • Flags
    [in] Unsigned long integer that specifies the flags. Set to IP_NAT_EDITOR_FLAGS_RESIZE if the editor potentially needs to change the size of packets.

    Note   If the IP_NAT_EDITOR_FLAGS_RESIZE flag is not set, the EditSession function resizes packets and the acknowledge number that the client returns to the server is not adjusted properly.

  • Protocol
    [in] Unsigned character that specifies the protocol field of the IP header. It is one of the following values.

    Value Description
    NAT_PROTOCOL_TCP Specifies the TCP protocol.
    NAT_PROTOCOL_UDP Specifies the UDP protocol.
  • Port
    [in] Unsigned short integer that specifies the TCP or UDP port that you want to edit, expressed as a hexadecimal value arranged in host byte order.

  • Direction
    [in] Value from the IP_NAT_DIRECTION enumeration that specifies whether editor is interested in inbound or outbound sessions. It is one of the following values.

    Value Description
    NatInboundDirection Specifies inbound sessions; in other words, sessions in which network traffic moves from the Internet to the home network.
    NatOutboundDirection Specifies outbound sessions; in other words, sessions in which network traffic moves from the home network to the Internet.
  • EditorContext
    [in] Pointer to a context to pass to the NAT editor functions.

  • CreateHandler
    [in] Pointer to a CreateHandler function to call on when a mapping is created. This parameter is optional.

  • DeleteHandler
    [in] Pointer to a DeleteHandler function to call when a mapping is deleted. This parameter is optional.

  • ForwardDataHandler
    [in] Pointer to a DataHandler function to call on each forward channel packet. This parameter is optional.

  • ReverseDataHandler
    [in] Pointer to a DataHandler function to call on each reverse channel packet. This parameter is optional.

  • EditorHandle
    [out] Pointer that receives a handle that identifies the editor to NAT module.

  • CreateTicket
    [out] Pointer that receives the address of the CreateTicket function.

  • DeleteTicket
    [out] Pointer that receives the address of the DeleteTicket function.

  • Deregister
    [out] Pointer that receives the address of the EditorDeregister function.

  • DissociateSession
    [out] Pointer that receives the address of the DisassociateSession function.

  • EditSession
    [out] Pointer that receives the address of the EditSession function.

  • QueryInfoSession
    [out] Pointer that receives the address of the QueryInfoSession function.

  • TimeoutSession
    [out] Pointer that receives the address of the TimeoutSession function.

Remarks

You should specify a value for EditorContext that the NAT can pass to the functions provided by the editor to serve as identification.

EditorHandle receives the handle that the editor should pass to the helper functions to identify itself.

The value of the Port parameter is interpreted as a hexadecimal number arranged in host byte order. Network byte order means that the bytes are stored in big-endian order. Host byte order means that the bytes are stored with the same byte ordering that the host uses. Windows CE–based computers are currently all little-endian, so host byte order stores the bytes in reverse order. For example, you would specify the bytes for port 42045 (0xA43D) in the order A4, 3D when using network byte order, and in the order 3D, A4 when using host byte order. You can change a value from network byte order to host byte order by calling the ntohs function, and you can change a value from host byte order to network byte order by calling the htons function.

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Natedit.h.

See Also

CreateHandler | CreateTicket | DataHandler | DeleteHandler | DeleteTicket | EditorDeregister | DisassociateSession | EditSession | htons | IP_NAT_DIRECTION | ntohs | QueryInfoSession | RegisterEditor | TimeoutSession

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.