Operating System - HP-UX
1836546 Members
2471 Online
110102 Solutions
New Discussion

socket programming in hpux platform by using AF_ROUTE family.

 
jgobbur
Advisor

socket programming in hpux platform by using AF_ROUTE family.

Hi,
In hpux I am unable to use AF_ROUTE family yo create socket.
i.e.
cc -I. -I../mDNSCore -I../mDNSShared -DPID_FILE=mdnsPosixOracleGetPidFile\(\"/tmp/.oracle/mdnsd.pid
\"\) -DMDNS_UDS_SERVERPATH=mdnsPosixOracleGetUDSServerPath\(\"/tmp/.oracle/mdnsd\"\) -DNOT_HAVE_DAEM
ON -DNOT_HAVE_SA_LEN -DNOT_HAVE_IF_NAMETOINDEX -DLOG_PERROR=0 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROK
EN_RECVIF_NAME -DMDNS_DEBUGMSGS=0 -c -o objects/prod/mDNSPosix.c.o mDNSPosix.c
cc: "mDNSPosix.c", line 1283: error 1588: "AF_ROUTE" undefined.
cc: "mDNSPosix.c", line 1283: warning 563: Argument #1 is not the correct type.
cc: "mDNSPosix.c", line 1317: error 1594: The sizeof operator cannot be applied to types with unknow
n size.
cc: "mDNSPosix.c", line 1325: error 1530: Undefined struct or union.
cc: "mDNSPosix.c", line 1325: error 1588: "RTM_NEWADDR" undefined.
cc: "mDNSPosix.c", line 1325: error 1530: Undefined struct or union.
cc: "mDNSPosix.c", line 1325: error 1588: "RTM_DELADDR" undefined.
cc: "mDNSPosix.c", line 1326: error 1530: Undefined struct or union.
cc: "mDNSPosix.c", line 1326: error 1588: "RTM_IFINFO" undefined.
cc: "mDNSPosix.c", line 1325: error 1563: Expression in if must be scalar.
cc: "mDNSPosix.c", line 1328: error 1530: Undefined struct or union.
cc: "mDNSPosix.c", line 1328: error 1563: Expression in if must be scalar.
cc: "mDNSPosix.c", line 1329: error 1530: Undefined struct or union.
cc: "mDNSPosix.c", line 1331: error 1530: Undefined struct or union.
gmake: *** [objects/prod/mDNSPosix.c.o] Error 1

9 REPLIES 9
jgobbur
Advisor

Re: socket programming in hpux platform by using AF_ROUTE family.

It is failing at socket create.
i.e.
*pFD = socket( AF_ROUTE, SOCK_RAW, 0);

Torsten.
Acclaimed Contributor

Re: socket programming in hpux platform by using AF_ROUTE family.

Hard to suggest without the source, but did you check if you have all includes?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
jgobbur
Advisor

Re: socket programming in hpux platform by using AF_ROUTE family.

error related source code:
// Open a socket that will receive interface change notifications
1281 mDNSlocal mStatus OpenIfNotifySocket( int *pFD)
1282 {
1283 *pFD = socket( AF_ROUTE, SOCK_RAW, 0);
1284
1285 if ( *pFD < 0)
1286 return mStatus_UnknownErr;
1287
1288 // Configure read to be non-blocking because inbound msg size is not known in advanc
e
1289 (void) fcntl( *pFD, F_SETFL, O_NONBLOCK);
1290
1291 return mStatus_NoError;
1292 }

But in /usr/include/sys/socket.h header file we don't AF_ROUTE family in hpux machine.
jgobbur
Advisor

Re: socket programming in hpux platform by using AF_ROUTE family.

Already header files included
328 #include
329 #include
330 #include
331 #include
332 #include
333 #include
334 #include
Laurent Menase
Honored Contributor

Re: socket programming in hpux platform by using AF_ROUTE family.

It is only available on 11.31 (11iv3)
and according to man 7p route:
#include
#include
#include
#include
jgobbur
Advisor

Re: socket programming in hpux platform by using AF_ROUTE family.

How to do it in 11.23 version.
jgobbur
Advisor

Re: socket programming in hpux platform by using AF_ROUTE family.

IS there equivalent program to write in 11.23 OS version.
Laurent Menase
Honored Contributor

Re: socket programming in hpux platform by using AF_ROUTE family.

there is no routing events mechanisms on 11.23
you can only poll the routing table periodically
using ioctl over AF_INET/SOCK_RAW sockets
or popen("netstat -nr") or popen("ndd -get /dev/ip ip_ire_status")

or using the private api libnm.
Laurent Menase
Honored Contributor

Re: socket programming in hpux platform by using AF_ROUTE family.

supported ioctl() on 11.23 are:
SIOCADDRT
SIOCDELRT
SIOCADDRTEX
SIOCDELRTEX
SIOCFLUSHRT
SIOCGRTENTRY

over a AF_INET/SOCK_RAW socket,