version 1.15, 1997/06/29 21:46:06 |
version 1.16, 1997/07/13 23:02:42 |
|
|
{ |
{ |
if (Aflag) |
if (Aflag) |
printf("%-*s ", PLEN, "Address"); |
printf("%-*s ", PLEN, "Address"); |
printf("%-15s %-15s %-5s %-15s %-15s %-5s %-5s %-15s %-8s %s\n", |
printf("%-30s %-5s %-30s %-5s %-5s %-26s\n", |
"Source address", "Source mask", "Port", "Dest. address", |
"Source address/netmask", "Port", "Destination address/netmask", |
"Dest. mask", "Port", "Proto", "Tunnel exit", |
"Port", "Proto", "SA(Address/SPI/Proto)"); |
"SPI", "Use"); |
|
} |
} |
|
|
static struct sockaddr * |
static struct sockaddr * |
|
|
register struct rtentry *rt; |
register struct rtentry *rt; |
{ |
{ |
struct sockaddr_encap sen1, sen2, sen3; |
struct sockaddr_encap sen1, sen2, sen3; |
|
u_char buffer[31]; |
|
int i; |
|
|
bcopy(kgetsa(rt_key(rt)), &sen1, sizeof(sen1)); |
bcopy(kgetsa(rt_key(rt)), &sen1, sizeof(sen1)); |
bcopy(kgetsa(rt_mask(rt)), &sen2, sizeof(sen2)); |
bcopy(kgetsa(rt_mask(rt)), &sen2, sizeof(sen2)); |
bcopy(kgetsa(rt->rt_gateway), &sen3, sizeof(sen3)); |
bcopy(kgetsa(rt->rt_gateway), &sen3, sizeof(sen3)); |
|
|
printf("%-15s ", inet_ntoa(sen1.sen_ip_src)); |
bzero(buffer, 31); |
printf("%-15s %-5u ", inet_ntoa(sen2.sen_ip_src), sen1.sen_sport); |
strncpy(buffer, inet_ntoa(sen1.sen_ip_src), 15); |
printf("%-15s ", inet_ntoa(sen1.sen_ip_dst)); |
i = strlen(buffer); |
printf("%-15s %-5u %-5u ", inet_ntoa(sen2.sen_ip_dst), |
strncpy(buffer + i, "/", 1); |
sen1.sen_dport, sen1.sen_proto); |
i++; |
printf("%-15s %08x %-lu\n", inet_ntoa(sen3.sen_ipsp_dst), |
strncpy(buffer + i, inet_ntoa(sen2.sen_ip_src), 15); |
ntohl(sen3.sen_ipsp_spi), rt->rt_use); |
|
|
printf("%-30s %-5u ", buffer, sen1.sen_sport); |
|
|
|
bzero(buffer, 31); |
|
strncpy(buffer, inet_ntoa(sen1.sen_ip_dst), 15); |
|
i = strlen(buffer); |
|
strncpy(buffer + i, "/", 1); |
|
i++; |
|
strncpy(buffer + i, inet_ntoa(sen2.sen_ip_dst), 15); |
|
|
|
printf("%-30s %-5u %-5u ", buffer, sen1.sen_dport, sen1.sen_proto); |
|
printf("%s/%08x/%-lu\n", inet_ntoa(sen3.sen_ipsp_dst), |
|
ntohl(sen3.sen_ipsp_spi), sen3.sen_ipsp_sproto); |
} |
} |
|
|
void |
void |