Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implicit declaration of function 'ether_ntoa' is invalid in C99

It's part of a series of functions that retrieve IP & Mac addresses from the phone.

strcpy(temp, (char *)ether_ntoa((const struct ether_addr *)LLADDR(sdl)));

EDIT: No equivalent function needed, there were just a few missing headers.

EDIT: Added cast to LLADDR(sdl)

like image 979
Orchid Avatar asked Jun 28 '12 13:06

Orchid


1 Answers

As I read it, the error message isn't claiming that the function is missing, only that you don't include its declaration. (I don't know that it exists, only that the message has a different complaint.)

In case it helps, man ether_ntoa tells me:

#include <sys/types.h>
#include <sys/socket.h>
#include <net/ethernet.h>
like image 176
Phillip Mills Avatar answered Nov 07 '22 08:11

Phillip Mills