diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-09-21 22:11:53 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-09-21 22:11:53 +0000 |
| commit | 844ec28cee41395cdd1cc0cdf8cf0168f9dc1adf (patch) | |
| tree | f2fe0a9a71bb075a5f6f43cd992b89f46b95574f /lib/network.c | |
| parent | d0bfb22c223d645e554290ca82581eb06f94ac3b (diff) | |
| parent | 039dc61292de5f3ed5f46316b1940ab6bb184c3f (diff) | |
Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Conflicts:
lib/.gitignore
lib/command.c
lib/command.h
Diffstat (limited to 'lib/network.c')
| -rw-r--r-- | lib/network.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/network.c b/lib/network.c index 3373983b3c..5379ecb5a6 100644 --- a/lib/network.c +++ b/lib/network.c @@ -93,3 +93,21 @@ set_nonblocking(int fd) } return 0; } + +float +htonf (float host) +{ + u_int32_t lu1, lu2; + float convert; + + memcpy (&lu1, &host, sizeof (u_int32_t)); + lu2 = htonl (lu1); + memcpy (&convert, &lu2, sizeof (u_int32_t)); + return convert; +} + +float +ntohf (float net) +{ + return htonf (net); +} |
