unsigned char* CreateEthernetHeader(char *src_mac, char *dst_mac, int protocol) { struct ethhdr *ethernet_header; ethernet_header = (struct ethhdr *)malloc(sizeof(struct ethhdr)); ----> memcpy(ethernet_header->h_source, (void *)ether_aton(src_mac), 6); ----> memcpy(ethernet_header->h_dest, (void *)ether_aton(dst_mac), 6); ethernet_header->h_proto = htons(protocol); return ((unsigned char *)ethernet_header); }
unsigned char*
void*
ether_aton
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)