The VxWorks IPNET protocol stack provides five functions for allocating the header space and the header space, which can help to understand how this function is implemented.
pkt * ipcom_pkt_malloc(int size,int flag) //size=sizeof(IP_HEADER)+sizeof(TCP)+sizeof(payLoad) but except for linklayer header
void* ipcom_pkt_push_back(Ipcom_pkt *pkt,int data_len)
void* ipcom_pkt_push_front(Ipcom_pkt *pkt,int data_len)
void* ipcom_pkt_pop_front(Ipcom_pkt *pkt,int data_len)
void *ipcom_pkt_pop_back(Ipcom_pkt *pkt, int data_len)