Fortinet white logo
Fortinet white logo

Script Reference Guide

Htons(int)

Htons(int)

Converts a 16 bit short integer from host byte order to network byte order.

Syntax

htons(int);

Arguments

Name Description

int

An integer which will be calculated.

Events

Applicable in all events.

Example

when HTTP_REQUEST {
str="0x12345678"
test=htons(str)
debug("return : %x \n", test)
}
Result
Return: 7856

Supported Version

FortiADC version 4.8.x and later.

Htons(int)

Htons(int)

Converts a 16 bit short integer from host byte order to network byte order.

Syntax

htons(int);

Arguments

Name Description

int

An integer which will be calculated.

Events

Applicable in all events.

Example

when HTTP_REQUEST {
str="0x12345678"
test=htons(str)
debug("return : %x \n", test)
}
Result
Return: 7856

Supported Version

FortiADC version 4.8.x and later.