SOHtoNl / SOHtoNs / SONtoHl / SONtoHs

Syntax

#include <cafe.h>
#include <cafe/network.h>

u32 SOHtoNl (u32 val);
u16 SOHtoNs (u16 val);
u32 SONtoHl (u32 val);
u16 SONtoHs (u16 val);

Parameters

val SOHtoNl: A 32-bit host byte order value.
SOHtoNs: A 16-bit host byte order value.
SONtoHl: A 32-bit network byte order value.
SONtoHs: A 16-bit network byte order value.

Return Values

The SOHtoNl and SOHtoNs functions return the argument value converted from host to network byte order. The SONtoHl and SONtoHs functions return the argument value converted from network to host byte order.

Description

These functions convert 16-bit and 32-bit values between network byte order and host byte order.

NOTE:
The network byte order and the host byte order are same on Cafe (big-endian).

Do Not Call From

SOHtoNl

Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

SOHtoNs

Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

SONtoHl

Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

SONtoHs

Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

Revision History

2012-08-16 Cleanup pass.
2011-07-18 Initial version.


CONFIDENTIAL