setkey(8): print out SA sw/hw offload counters
Sponsored by: NVIDIA networking
This commit is contained in:
@@ -1713,6 +1713,8 @@ pfkey_align(struct sadb_msg *msg, caddr_t *mhp)
|
|||||||
case SADB_X_EXT_SA_REPLAY:
|
case SADB_X_EXT_SA_REPLAY:
|
||||||
case SADB_X_EXT_NEW_ADDRESS_SRC:
|
case SADB_X_EXT_NEW_ADDRESS_SRC:
|
||||||
case SADB_X_EXT_NEW_ADDRESS_DST:
|
case SADB_X_EXT_NEW_ADDRESS_DST:
|
||||||
|
case SADB_X_EXT_LFT_CUR_SW_OFFL:
|
||||||
|
case SADB_X_EXT_LFT_CUR_HW_OFFL:
|
||||||
mhp[ext->sadb_ext_type] = (caddr_t)ext;
|
mhp[ext->sadb_ext_type] = (caddr_t)ext;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ pfkey_sadump(struct sadb_msg *m)
|
|||||||
caddr_t mhp[SADB_EXT_MAX + 1];
|
caddr_t mhp[SADB_EXT_MAX + 1];
|
||||||
struct sadb_sa *m_sa;
|
struct sadb_sa *m_sa;
|
||||||
struct sadb_x_sa2 *m_sa2;
|
struct sadb_x_sa2 *m_sa2;
|
||||||
struct sadb_lifetime *m_lftc, *m_lfth, *m_lfts;
|
struct sadb_lifetime *m_lftc, *m_lfth, *m_lfts, *m_lft_sw, *m_lft_hw;
|
||||||
struct sadb_address *m_saddr, *m_daddr, *m_paddr;
|
struct sadb_address *m_saddr, *m_daddr, *m_paddr;
|
||||||
struct sadb_key *m_auth, *m_enc;
|
struct sadb_key *m_auth, *m_enc;
|
||||||
struct sadb_ident *m_sid, *m_did;
|
struct sadb_ident *m_sid, *m_did;
|
||||||
@@ -240,7 +240,8 @@ pfkey_sadump(struct sadb_msg *m)
|
|||||||
natt_dport = (struct sadb_x_nat_t_port *)mhp[SADB_X_EXT_NAT_T_DPORT];
|
natt_dport = (struct sadb_x_nat_t_port *)mhp[SADB_X_EXT_NAT_T_DPORT];
|
||||||
natt_oai = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAI];
|
natt_oai = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAI];
|
||||||
natt_oar = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAR];
|
natt_oar = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAR];
|
||||||
|
m_lft_sw = (struct sadb_lifetime *)mhp[SADB_X_EXT_LFT_CUR_SW_OFFL];
|
||||||
|
m_lft_hw = (struct sadb_lifetime *)mhp[SADB_X_EXT_LFT_CUR_HW_OFFL];
|
||||||
|
|
||||||
/* source address */
|
/* source address */
|
||||||
if (m_saddr == NULL) {
|
if (m_saddr == NULL) {
|
||||||
@@ -381,7 +382,23 @@ pfkey_sadump(struct sadb_msg *m)
|
|||||||
/* XXX DEBUG */
|
/* XXX DEBUG */
|
||||||
printf("refcnt=%u\n", m->sadb_msg_reserved);
|
printf("refcnt=%u\n", m->sadb_msg_reserved);
|
||||||
|
|
||||||
return;
|
if (m_lft_sw != NULL) {
|
||||||
|
printf("\tsw offl use: %s",
|
||||||
|
str_time(m_lft_sw->sadb_lifetime_usetime));
|
||||||
|
printf("\tsw offl allocated: %lu",
|
||||||
|
(unsigned long)m_lft_sw->sadb_lifetime_allocations);
|
||||||
|
str_lifetime_byte(m_lft_sw, "sw offl");
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_lft_hw != NULL) {
|
||||||
|
printf("\thw offl use: %s",
|
||||||
|
str_time(m_lft_hw->sadb_lifetime_usetime));
|
||||||
|
printf("\thw offl allocated: %lu",
|
||||||
|
(unsigned long)m_lft_hw->sadb_lifetime_allocations);
|
||||||
|
str_lifetime_byte(m_lft_hw, "hw offl");
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user