Fortinet white logo
Fortinet white logo

Script Reference Guide

Ntohs(int)

Ntohs(int)

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

Syntax

ntohs(int);

Arguments

Name Description

int

An integer which will be calculated.

Events

Applicable in all events.

Example

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

Supported Version

FortiADC version 4.8.x and later.

Ntohs(int)

Ntohs(int)

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

Syntax

ntohs(int);

Arguments

Name Description

int

An integer which will be calculated.

Events

Applicable in all events.

Example

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

Supported Version

FortiADC version 4.8.x and later.