📄 socktohost.c
字号:
/* * socktoa - return a numeric host name from a sockaddr_storage structure */#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <stdio.h>#include "ntp_fp.h"#include "lib_strbuf.h"#include "ntp_stdlib.h"#include "ntp.h"char *socktohost( struct sockaddr_storage* sock ){ register char *buffer; LIB_GETBUF(buffer); if (getnameinfo((struct sockaddr *)sock, SOCKLEN(sock), buffer, LIB_BUFLENGTH /* NI_MAXHOST*/, NULL, 0, 0)) return stoa(sock); return buffer;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -