Sponsored Content
Special Forums IP Networking Cat /proc/sys/net/ipv4/ip_local_port_range Post 302924637 by Skrynesaver on Tuesday 11th of November 2014 08:25:39 AM
Old 11-11-2014
and when you
Code:
printf"%d", htons(ClientAddr.sin_port);

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cat /proc/ files

Hi, I need to write a shell script that should lists only the files that starts with alphabet from the /proc dir and then I have to cat those files and redirect to a file. But my below script is not working. It is reading the first file properly but not the subsequent files. Please throw a... (2 Replies)
Discussion started by: royalibrahim
2 Replies

2. UNIX for Dummies Questions & Answers

Difference between cat , cat > , cat >> and touch !!!

Hi Can anybody tell the difference between Difference between cat , cat > , cat >> and touch command in UNIX? Thanks (6 Replies)
Discussion started by: skyineyes
6 Replies

3. Shell Programming and Scripting

Parsing /proc/net/dev into key:value pairs (self-answered)

Hi all, I need some help with using sed/awk/other linux tools to meet the following goal: I'm trying to take the output of /proc/net/dev: Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes ... (0 Replies)
Discussion started by: felbane
0 Replies

4. Shell Programming and Scripting

cat in the command line doesn't match cat in the script

Hello, So I sorted my file as I was supposed to: sort -n -r -k 2 -k 1 file1 | uniq > file2 and when I wrote > cat file2 in the command line, I got what I was expecting, but in the script itself ... sort -n -r -k 2 -k 1 averages | uniq > temp cat file2 It wrote a whole... (21 Replies)
Discussion started by: shira
21 Replies

5. Linux

Kernal panic error& setuproot:error mounting /proc&/sys

Hi all, I am new to redhat/fedora linux. In fedora linux 6,we created one file system(hda3 - /fs). in this mount poing we were installed mounta vista os. while booting we are getting below error messages. 1) Booting 'mountaVisat(2.6.18_pro 500_pc_target-x86_586 smp)' root(hd0,1)... (2 Replies)
Discussion started by: arjunreddy3
2 Replies

6. UNIX for Dummies Questions & Answers

_/proc/stat vs /proc/uptime

Hi, I am trying to calculate the CPU Usage by getting the difference between the idle time reported by /proc/stat at 2 different intervals. Now the 4th entry in the first line of /proc/stat will give me the 'idle time'. But I also came across /proc/uptime that gives me 2 entries : 1st one as the... (0 Replies)
Discussion started by: coderd
0 Replies

7. UNIX for Advanced & Expert Users

echo 1 > /proc/sys/vm/drop_caches a good idea?

Hi folks. I work with several production servers, and I have seen in some Kernel Cache using most of the memory. See this pic: http://i51.tinypic.com/301nb6c.jpg Do you think this is a smart choice? Remember these are productions servers and it is extremely necesary this does not... (6 Replies)
Discussion started by: erick_tuk
6 Replies

8. Red Hat

Disable IPV4

Hi im using Redhat Ver 6.4 is it possible to disable IPV4 and use only IPV6? how can i do that? thanks Guy (2 Replies)
Discussion started by: guy3145
2 Replies

9. Programming

Interactive Python 3.5+ sys.stdout.write() AND sys.stderr.write() bug?

(Apologies for any typos.) OSX 10.12.3 AND Windows 10. This is for the serious Python experts on at least 3.5.x and above... In script format sys.stdout.write() AND sys.stderr.write() seems to work correctly. Have I found a serious bug in the interactive sys.stdout.write() AND... (2 Replies)
Discussion started by: wisecracker
2 Replies
htons(3)						     Library Functions Manual							  htons(3)

NAME
htons - Converts an unsigned short (16-bit) integer from host byte order to network byte order LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <arpa/inet.h> in_port_t htons ( in_port_t hostshort) ; STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: htons(): XNS4.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies a 16-bit integer in host byte order. DESCRIPTION
The htons() (host-to-network short) function converts an unsigned short (16-bit) integer from host byte order to Internet network-byte order. The Internet network requires address and port reference data in network-byte order. Use the htons() function to convert address and port short integers from host byte order to Internet network-byte order. RETURN VALUES
Upon successful completion, the htons() function returns a 16-bit short integer in Internet network-byte order. ERRORS
Current industry standards do not define error values for the htons() function. RELATED INFORMATION
Functions: endhostent(3), endservent(3), htonl(3), ntohl(3), ntohs(3). Standards: standards(5). Network Programmer's Guide delim off htons(3)
All times are GMT -4. The time now is 09:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy