- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Using ioctl() to add an entry to TCPIP routing tab...
Operating System - OpenVMS
1753518
Members
5078
Online
108795
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2008 11:20 AM
12-12-2008 11:20 AM
Using ioctl() to add an entry to TCPIP routing table
Is anyone familiar with using ioctl() in C to add or delete an entry in the TCPIP routing table? I have the call set as follows:
status = ioctl( sock_id, SIOCADDRT, &rt_entry)
rt_entry is a structure I found in TCPIP$EXAMPLES. I am not sure if it is the correct structure to use since I did not find it anywhere else defined. When I call the ioctl() function I get "Invalid argument". Could someone please tell me what the correct format of the structure is suppose to be. Also is there a way to specify the network mask for the routing IP address in the ioctl function?
status = ioctl( sock_id, SIOCADDRT, &rt_entry)
rt_entry is a structure I found in TCPIP$EXAMPLES. I am not sure if it is the correct structure to use since I did not find it anywhere else defined. When I call the ioctl() function I get "Invalid argument". Could someone please tell me what the correct format of the structure is suppose to be. Also is there a way to specify the network mask for the routing IP address in the ioctl function?
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2008 01:01 PM
12-12-2008 01:01 PM
Re: Using ioctl() to add an entry to TCPIP routing table
I've not had occasion to have to add an entry to the routing table but it appears that your rt_entry structure should look like the rtentry structure in SYS$COMMON:[SYSHLP.EXAMPLES.TCPIP.LIBPCAP]ROUTE.H. The mask is defined by rt_mask field within this structure.
struct rtentry {
struct radix_node rt_nodes[2]; /* tree glue, and other values */
#define rt_key(r) ((struct sockaddr *)((r)->rt_nodes->rn_key))
#define rt_mask(r) ((struct sockaddr *)((r)->rt_nodes->rn_mask))
struct sockaddr *rt_gateway; /* value */
int rt_flags; /* up/down?, host/net */
int rt_refcnt; /* # held references */
u_long rt_use; /* raw # packets forwarded */
struct ifnet *rt_ifp; /* the answer: interface to use */
struct ifaddr *rt_ifa; /* the answer: interface to use */
struct sockaddr *rt_genmask; /* for generation of cloned routes */
caddr_t rt_llinfo; /* pointer to link level info cache */
struct rt_metrics rt_rmx; /* metrics used by rx'ing protocols */
short rt_idle; /* easy to tell llayer still live */
short rt_aliasid; /* cluster aliasid id of dst */
u_int rt_precedence; /* precedence */
#if SEC_NET
struct tnrh_rem_host *rt_host; /* Remote host structure. */
#endif
struct rtentry *rt_gwroute; /* entry for gateway route */
struct mip6_binding_cache *rt_mip6cache;/* ptr to Mobile IPv6 binding */
u_long rt_reserved[5]; /* reserved for future use */
};
struct rtentry {
struct radix_node rt_nodes[2]; /* tree glue, and other values */
#define rt_key(r) ((struct sockaddr *)((r)->rt_nodes->rn_key))
#define rt_mask(r) ((struct sockaddr *)((r)->rt_nodes->rn_mask))
struct sockaddr *rt_gateway; /* value */
int rt_flags; /* up/down?, host/net */
int rt_refcnt; /* # held references */
u_long rt_use; /* raw # packets forwarded */
struct ifnet *rt_ifp; /* the answer: interface to use */
struct ifaddr *rt_ifa; /* the answer: interface to use */
struct sockaddr *rt_genmask; /* for generation of cloned routes */
caddr_t rt_llinfo; /* pointer to link level info cache */
struct rt_metrics rt_rmx; /* metrics used by rx'ing protocols */
short rt_idle; /* easy to tell llayer still live */
short rt_aliasid; /* cluster aliasid id of dst */
u_int rt_precedence; /* precedence */
#if SEC_NET
struct tnrh_rem_host *rt_host; /* Remote host structure. */
#endif
struct rtentry *rt_gwroute; /* entry for gateway route */
struct mip6_binding_cache *rt_mip6cache;/* ptr to Mobile IPv6 binding */
u_long rt_reserved[5]; /* reserved for future use */
};
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP