Deleting a Route

Deleting a route is similar to adding a route, except that you pass a smaller request structure.

The route delete parameters are as follows:

struct ssd_rt_delete_parms {
         ssd_sockaddr_un *rtd_dest;                 /* Route address */
         u_int16_t        rtd_prefixlen;            /* Prefix length */
         ssd_rt_tableid   rtd_rtt;                  /* Routing table */
         u_int32_t        rtd_gw_handle;            /* Protocol */
     };

To delete a route, you need the socket address, the prefix length, and the routing table ID. You obtain these values in the same way as for adding a route. The application populates the detail parameters and calls the route delete function as follows:

int
ssd_rt_del (route_t *rt)
{
    struct ssd_rt_delete_parms params;

    bzero(&params, sizeof(params));
    params.rtd_dest = &rt->dst_addr;
    params.rtd_prefixlen = rt->prefix_len;
    params.rtd_rtt = nh_pool[rt->rtt_id].idx;

    if (ssd_request_route_delete(ssd_fd, &params, (unsigned int)rt) < 0) {
        return -1;
    } else {
        return 0;
    }
}

2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:47 2010 for Juniper Networks Partner Solution Development Platform JUNOS SDK 10.2R1 by Doxygen 1.4.5