python / python/cpython

the socket module should include `getifaddrs` because it is necessary to translate the output of `if_nameindex` into addresses

未關閉
#126,713 5 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

topic-socket type-feature
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

Feature or enhancement

Proposal:

socket.if_nameindex, socket.if_nametoindex and socket.if_indextoname all work in terms of interface names and indexes. But in order to do much of use with these values, you need to know what addresses they have, and as far as I can tell the socket module does not provide a means to do so.

This function exists in psutil, in netifaces, and there are various recipes lying around on Stack Overflow and elsewhere for accessing this function.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

未指定來源檔案或測試。先檢查 socket.if_nameindex、socket.if_nametoindex 和 socket.if_indextoname,接著比較所參考的 psutil 與 netifaces 實作,以定義 getifaddrs 的行為與平台涵蓋範圍;當 socket 模組能一致地提供介面位址時即完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
networking
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。