簡體   English   中英

libpcap中的屬性錯誤

[英]Error with attribute in libpcap

我正在使用此處的代碼在監控模式下進行802.11嗅探。

#define ETH_HEADER_SIZE 14
#define AVS_HEADER_SIZE 64                 /* AVS capture header size */
#define DATA_80211_FRAME_SIZE 24           /* header for 802.11 data packet */
#define LLC_HEADER_SIZE 8                  /* LLC frame for encapsulation */
/* SNAP LLC header format */
struct snap_header           
{
  u_int8_t dsap; 
  u_int8_t ssap;
  u_int8_t ctl;
  u_int16_t org; 
  u_int8_t org2;
  u_int16_t ether_type;          /* ethernet type */              
} __attribute__ ((__packed_  _));

我不是有關c ++的專家,並且遇到了以下錯誤:

error: expected ‘)’ before ‘_’ warning: ‘__packed_’ attribute  
directive ignored [-Wattributes]  } __attribute__ ((__packed_  _));

獲得該代碼的頁面在__attribute__ ((__packed__))聲明中添加了一些虛假空格。 它應該與我在此處所寫的完全相同 ,下划線之間沒有空格。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM