Re: Mac addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



MLm> This may be a really stupid question, but can someone tell me how I
MLm> can get a mac address into char or string format from struct
MLm> nfqnl_msg_packet_hw?

MLm> Regards

struct nfq_data *nfa;
struct nfqnl_msg_packet_hw *hwh = NULL;
u_int8_t *mac;

hwh = nfq_get_packet_hw(nfa);
if (hwh) {
   mac = (u_int8_t *)hwh;
   snprintf(buffer,buffer_length,"%02X:%02X:%02X:%02X:%02X:%02X",mac[0],mac[1],mac[2],mac[3],mac[4],mac[5]);
}


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux