言語/C++/サンプルプログラム/RAWソケット
RAWソケット受信プログラム
トラブルシューティング
error: `inet_ntoa' was not declared in this scope
対処方法
#include <arpa/inet.h>
error: conversion from `in_addr_t' to non-scalar type `in_addr' requested
error: conversion from `in_addr_t' to non-scalar type `in_addr' requested
対処法
printf("Source IP : %s\n", inet_ntoa(_ip->iph.ip_src.s_addr)); printf("Destination IP : %s\n", inet_ntoa(_ip->iph.ip_dst.s_addr));
⇒
printf("Source IP : %s\n", inet_ntoa(_ip->iph.ip_src)); printf("Destination IP : %s\n", inet_ntoa(_ip->iph.ip_dst));
- 最終更新:2013-10-01 17:52:49