struct protoent相關

來源:互聯網
上載者:User
在snort.c中的函數void InitProtoNames()的作用是取得協議名放在protocol_names[256]      
struct protoent {
        char *       p_name; //名稱
        char *               p_aliases; //別名
        short *       p_proto; //編號
       }  
getprotobyname():依照通訊協定 (protocol) 的名稱來擷取該通訊協定的其他資料。
  格 式: struct protoent * getprotobyname( const char *name );
  參 數: name   通訊協定名稱
  傳回值: 成功 - 一指向 struct protoent 的指標

       失敗 - NULL  說明: 利用通訊協定的名稱來得知該通訊協定的別名、編號等資料。 
getprotobynumber():依照通訊協定的編號來擷取該通訊協定的其他資料。
  格 式: struct protoent * getprotobynumber( int number );
  參 數: number  以 host 相片順序的通訊協定編號
  傳回值: 成功 - 一指向 struct protoent 的指標
       失敗 - NULL 
  說明: 利用通訊協定的編號來得知該通訊協定的名稱、別名等資料。

另外,:-)
toupper(char c)將字元c轉換為大寫英文字母。
d = strdup(char * s)複製字串s到d,返回指向被複製的字串的指標,所需空間由malloc()分配且可以由free()釋放。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.