Metadata-Version: 2.4
Name: scapy-cdp
Version: 0.1.0
Summary: Send Cisco Discovery Protocol packets with Scapy
Author: CDP Maintainers
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: scapy

# CDP Sender Module
[![CI](https://github.com/cappern/scapy_CDP/actions/workflows/ci.yml/badge.svg)](https://github.com/cappern/scapy_CDP/actions/workflows/ci.yml)
## Overview
`scapy-cdp` provides a small command line utility to send Cisco Discovery Protocol (CDP) packets using [Scapy](https://scapy.net/). It installs a `cdp-sender` command that transmits a CDP packet every 60 seconds. The module works well on Linux systems, including Raspberry Pi.

## Installation
Install the package with `pip`:

```bash
sudo pip3 install scapy-cdp
```

This creates the `/usr/local/bin/cdp-sender` executable.

## Usage
Display available options:

```bash
sudo cdp-sender --help
```

Example:

```bash
sudo cdp-sender --interface eth0 --device-id MyDevice --software-version "1.2.3" --platform "MyPlatform"
```

Settings can also come from a JSON configuration file:

```json
{
  "interface": "eth0",
  "device_id": "MyDevice",
  "software_version": "1.2.3",
  "platform": "MyPlatform",
  "ttl": 120,
  "capabilities": "0x0038"
}
```

Run with the configuration file:

```bash
sudo cdp-sender --config config.json
```

## Systemd Service
Create `/etc/systemd/system/cdp_sender.service`:

```ini
[Unit]
Description=CDP Sender Service
After=network.target

[Service]
ExecStart=/usr/local/bin/cdp-sender
Restart=always
User=root

[Install]
WantedBy=multi-user.target
```

Then enable and start the service:

```bash
sudo systemctl daemon-reload
sudo systemctl enable cdp_sender
sudo systemctl start cdp_sender
```

## Cron Alternative
To run the script every minute with cron:

```bash
sudo crontab -e
```

Add this line:

```bash
* * * * * /usr/local/bin/cdp-sender
```

## License
MIT
