# Eggdrop 1.8.1 Botnet Core

**Category:** Eggdrop_Bot
**Original Author:** Robey Pointer (and Eggheads Development Team)

## Description
Eggdrop 1.8.1 is a full-featured IRC bot designed to automate tasks, manage channels, and handle user interactions on an IRC network.

## Key Features
- **Botnet Management**: Tracks connected bots and manages the botnet structure.
- **Channel Operations**: Handles channel name associations, pings, and leaf status checks.
- **User Interaction**: Manages user commands via DCC (Direct Client Connection) for file transfers and updates.
- **Security**: Implements flags and access levels to control bot behavior.

## File Analysis
- **bg.c** — Handles moving the process to the background while keeping threads happy.
- **bg.h** — Header file for `bg.c`.
- **botcmd.c** — Manages commands from users via DCC, including userfile transfer and update commands.
- **botmsg.c** — Formats messages sent on the botnet and sends different messages to different versioned bots.
- **botnet.c** — Tracks connected bots in the chain, dumps lists of bots or a bot tree, and handles channel name associations.
- **chan.h** — Common header file for channel-related functions.
- **chanprog.c** — Manages server list maintenance, revenge punishment, timers, and tcl script initialization.
- **cmds.c** — Handles commands from users via DCC that are not IRC-based.
- **cmdt.h** — Header file for built-in commands.
- **dcc.c** — Manages activity on a dcc socket, including disconnects.
- **dccutil.c** — Provides functions to send formatted text over various connections and manages dcc structures.
- **dns.c** — Handles DNS resolve calls and events, providing fallback code if the DNS module is not loaded.
- **eggdrop.h** — Compile-time settings for Eggdrop.
- **flags.c** — Implements flag matching and conversion functions.
- **flags.h** — Header file for `flags.c`.
- **language.c** — Handles language support code.
- **main.c** — Core event handling, signal handling, command line arguments, and context debugging.
- **match.c** — Provides wildcard matching functions, hostmask matching, and CIDR matching.
- **mem.c** — Manages memory allocation and deallocation.
- **misc.c** — Handles logging, queueing output for the bot, resync buffers, help system, motd display, and variable substitution.
- **modules.c** — Supports modules in Eggdrop.
- **net.c** — Handles all raw network I/O.
- **proto.h** — Prototypes for functions used outside their own module.
- **rfc1459.c** — Implements the RFC 1459 protocol, with some deviations from full compliance.
- **stat.h** — File attributes handling.
- **tcl.c** — Manages Tcl commands and initialization.
- **tclegg.h** — Header file for `tcl.c` and `tclhash.c`.
- **tclhash.c** — Handles binding and unbinding, checking and triggering bindings, and adding/removing new binding tables.
- **tls.c** — Provides TLS support functions, certificate handling, and OpenSSL initialization/shutdown.
- **userent.c** — Manages user-entry handling for the new style of more versatile records.
- **userrec.c** — Implements functions to find and change user records, including changing and checking user flags.
- **users.c** — Tests and enforces ignores, adds/removes ignores, lists ignores, auto-links bots, sends/receives a userfile from a bot, and lists users.
- **users.h** — Structures and definitions used by `users.c` and `userrec.c`.
- **version.h** — Controls version strings used by Eggdrop.