flow_hooks.php¶
Flow hooks module for managing network traffic, DDoS protection status, and MAC address monitoring.
API Methods¶
| Method | Action | Description |
|---|---|---|
check_traffic_flow | get traffic flow data | Returns the last update data for traffic ticks, including delay and location. |
ddos_blackhole | trigger ddos blackhole | Triggers a blackhole action for an IP address if traffic thresholds are exceeded or after multiple warning attempts. |
ddos_protect | activate ddos protection | Activates DDoS protection for a specific IP address and notifies the customer. |
ddos_unblock | remove ddos block | Removes the blackhole/DDoS protection for a specific IP address. |
ddos_unprotect | deactivate ddos protection | Removes DDoS protection for a specific CIDR range. |
ddos_warning | trigger ddos warning | Sends a DDoS traffic warning to the server owner and logs the event. |
mac_change | update mac address | Updates the MAC address for a specific IP. |
mac_check | validate mac-ip records | Validates MAC-IP bindings by checking ARP records, network activity via nmap, and server status. |
mac_report | group reports for static MACs | Adds a list of IP:MAC pairs to the mac_flow table. |
traffic_tick | process traffic tick | Records a traffic measurement for an IP or processes a group of traffic data. |
flow_hooks/check_traffic_flow¶
Returns the last update data for traffic ticks, including delay and location.
HTTP method: GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: check_traffic_flow |
Request example
flow_hooks/ddos_protect¶
Activates DDoS protection for a specific IP address and notifies the customer.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: ddos_protect |
Request example
flow_hooks/ddos_unprotect¶
Removes DDoS protection for a specific CIDR range.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: ddos_unprotect |
Request example
flow_hooks/mac_change¶
Updates the MAC address for a specific IP.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: mac_change |
| ip | ✅ | string | The IP address for which the MAC address will be changed. |
| new_mac | ✅ | string | The new MAC address to be assigned. |
Request example
flow_hooks/mac_check¶
Validates MAC-IP bindings by checking ARP records, network activity via nmap, and server status.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: mac_check |
Request example
Success response example
flow_hooks/mac_report¶
Adds a list of IP:MAC pairs to the mac_flow table.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: mac_report |
| ip | ✅ | string | IP address to associate with the MAC address. |
| macs | ✅ | array<string> | List of MAC addresses to add to the mac_flow table. |
Request example
flow_hooks/traffic_tick¶
Records a traffic measurement for an IP or processes a group of traffic data.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: traffic_tick |
| ip | ❌ | integer | IP address of the source or destination. |
| direction | ❌ | string | Traffic direction indicator. |
| volume | ❌ | integer | Volume of traffic transferred. |
| data | ❌ | string | Grouped traffic data for processing. |
Request example
flow_hooks/ddos_blackhole¶
Triggers a blackhole action for an IP address if traffic thresholds are exceeded or after multiple warning attempts.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: ddos_blackhole |
| token | ✅ | string | Authentication token |
| ip | ❌ | string | IP address to be blackholed |
| rate | ❌ | number | Traffic rate in Mbps |
| pps | ❌ | integer | Packets per second |
Request example
Success response example
flow_hooks/ddos_unblock¶
Removes the blackhole/DDoS protection for a specific IP address.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: ddos_unblock |
| token | ✅ | string | Authentication token |
| ip | ❌ | string | IP address to unblock. Can be a string or a numeric IP representation. |
Request example
flow_hooks/ddos_warning¶
Sends a DDoS traffic warning to the server owner and logs the event.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: ddos_warning |
| token | ✅ | string | Authentication token |
Request example