---
title: "Discussion on \"如何用C语言操作arp cache\" | Hashnode"
description: "Discussion on \"如何用C语言操作arp cache\". arp cache中存放着局域网内IP地址和MAC地址的对应关系，对socket通信是至关重要的，arp cache由Linux内核进行维护，本文介绍如何用ioctl获取arp cache记录，添加新记录到arp cache中，删除arp cache中记录，每一种操作均给出了完整的源程序，本文程序在ubuntu 20.4中编译运行成功，gcc版本9.4.0，阅读本文需要有基本的socket编程和ioctl的知识，并对ARP协议有所了解，本文对网络编程的初学者难度不大。\n\n1. ARP cache..."
url: "https://hashnode.com/posts/180014-handling-arp-cache/63d0f1dcee24826ed4a8f766"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [如何用C语言操作arp cache](https://whowin.cn/180014-handling-arp-cache?utm_source=hashnode&utm_medium=feed)

arp cache中存放着局域网内IP地址和MAC地址的对应关系，对socket通信是至关重要的，arp cache由Linux内核进行维护，本文介绍如何用ioctl获取arp cache记录，添加新记录到arp cache中，删除arp cache中记录，每一种操作均给出了完整的源程序，本文程序在ubuntu 20.4中编译运行成功，gcc版本9.4.0，阅读本文需要有基本的socket编程和ioctl的知识，并对ARP协议有所了解，本文对网络编程的初学者难度不大。 1. ARP cache...

Jan 12, 2023 · 3 min read · whowin.cn  
Updated Oct 17, 2024  
Read the article

-   [#linux](https://hashnode.com/tag/linux)
-   [#socket](https://hashnode.com/tag/socket)
-   [#arp](https://hashnode.com/tag/arp)
-   [#ioctl](https://hashnode.com/tag/ioctl)

## Written by

[whowin](https://hashnode.com/@whowin)

@whowin · Beijing, China

  
[View profile](https://hashnode.com/@whowin)

一枚有30多年经验的退休程序员，主要从事嵌入式软件开发

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
