ຮຽນຮູ້ Linux command-ntohs

ຊື່

htonl, htons, ntohl, ntohs - ແປງຄ່າລະຫວ່າງໂຮດແລະເຄືອຂ່າຍ byte order

Synopsis

#include uint32_t htonl (uint32_t hostlong ) uint16_t htons (uint16_t hostshort ) uint32_t ntohl (uint32_t netlong ) uint16_t ntohs (uint16_t netshort )

ລາຍລະອຽດ

ຟັງຊັນ htonl () ປ່ຽນແປງຈໍານວນ integer ທີ່ບໍ່ໄດ້ເຂົ້າ ສູ່ລະບົບ ຈາກລໍາດັບ byte ຂອງໂຮດກັບລໍາດັບ byte ເຄືອຂ່າຍ.

ຟັງຊັນ htons () ປ່ຽນຊື່ hostshort integer ສັ້ນທີ່ບໍ່ໄດ້ເຊັນຈາກລໍາດັບ byte ຂອງໂຮດກັບລໍາດັບ byte ເຄືອຂ່າຍ.

ຟັງຊັນ ntohl () ປ່ຽນແປງຈໍານວນເຕັມ unsigned netlong ຈາກຄໍາສັ່ງ byte ເຄືອຂ່າຍເພື່ອໂຮດສັ່ງ byte.

ຟັງຊັນ ntohs () ປ່ຽນແປງ netshort integer ສັ້ນທີ່ບໍ່ໄດ້ເຊັນອອກຈາກຄໍາສັ່ງ byte ເຄືອຂ່າຍເພື່ອໂຮດສັ່ງ byte.

ໃນ i80x86 ການສັ່ງຊື້ byte ຂອງໂຮດມີລັກສະນະເບື້ອງຕົ້ນທີ່ສຸດ, ໃນຂະນະທີ່ຄໍາສັ່ງ byte ເຄືອຂ່າຍ, ທີ່ຖືກນໍາໃຊ້ໃນອິນເຕີເນັດ, ແມ່ນ Most Significant Byte ທໍາອິດ.

ສອດຄ່ອງກັບ

BSD 43