Files
Stefan Pratter 2e8788b595 Support 202210 (#1286)
* Allow REALPEER to overwrite GHOSTPEER netixlan entry, if asn and IPv6/v4 addresses matches the IX-F Members Export information #983

* Lightweight user notification mechanism #758

* do not allow affiliation with a deleted organisation #953

* Improve readability when users have special permissions #659

* fix advanced search export when api-cache exist and no filters were supplied #1153

* Ops: Throttle strings with "Response size" should be renamed "Repeated request" #1168

* allow ixlan prefix to be changed / deleted regardless of existence of netixlans in the address space #924

* linting

* poetry relock

* remove debug code

* linting

* fixed Reset IX-F suggestions link non-functional #1253

* solved UI shows own email when viewing affiliation requests for an organization #1250

* Adjust "Add Facility" menu to include newly defined fields #1091

* Footer "Global System Statistics" should be cached within django instance, not updated with every page load #1283

* linting

* django-handleref to 1.1.0 and relock poetry

* GLOBAL_STATS_CACHE_DURATION default to 900 seconds

* remove vscode and idea

* remove Ctl/dev/docker-compose.debug.yml

* remove unsused variable

* rename STATS to __STATS

* linting

* regen docs
2022-11-08 11:25:32 -06:00

157 lines
2.6 KiB
Markdown

Generated from inet.py on 2022-11-08 14:31:50.933987
# peeringdb_server.inet
RDAP lookup and validation.
Network validation.
Prefix renumbering.
# Functions
---
## asn_is_bogon
`def asn_is_bogon(asn)`
Test if an asn is bogon by being either in the documentation
or private asn ranges.
Arguments:
- asn<int>
Return:
- bool: True if in bogon range
---
## asn_is_in_ranges
`def asn_is_in_ranges(asn, ranges)`
Test if an asn falls within any of the ranges provided.
Arguments:
- asn<int>
- ranges<list[tuple(min,max)]>
Return:
- bool
---
## get_prefix_protocol
`def get_prefix_protocol(prefix)`
Take a network address space prefix string and return
a string describing the protocol.
Will raise a ValueError if it cannot determine protocol.
Returns:
str: IPv4 or IPv6
---
## network_is_bogon
`def network_is_bogon(network)`
Return if the passed ipaddress network is a bogon.
Arguments:
- network <ipaddress.IPv4Network|ipaddress.IPv6Network>
Return:
- bool
---
## network_is_pdb_valid
`def network_is_pdb_valid(network)`
Return if the passed ipaddress network is in pdb valid
address space.
Arguments:
- network <ipaddress.IPv4Network|ipaddress.IPv6Network>
Return:
- bool
---
## rdap_pretty_error_message
`def rdap_pretty_error_message(exc)`
Take an RdapException instance and return a customer friendly
error message (str).
---
## renumber_ipaddress
`def renumber_ipaddress(ipaddr, old_prefix, new_prefix)`
Renumber an ipaddress from old prefix to new prefix.
Arguments:
- ipaddr (ipaddress.ip_address)
- old_prefix (ipaddress.ip_network)
- new_prefix (ipaddress.ip_network)
Returns:
- ipaddress.ip_address: renumbered ip address
---
# Classes
---
## BogonAsn
```
BogonAsn(rdap.objects.RdapAsn)
```
On tutorial mode environments, return an instance
of this to provide an rdapasn result for asns in the
private and documentation ranges.
### Methods
#### \__init__
`def __init__(self, asn)`
Initialize self. See help(type(self)) for accurate signature.
---
## RdapInvalidRange
```
RdapInvalidRange(rdap.exceptions.RdapException)
```
Base exception used by this module.
## RdapLookup
```
RdapLookup(rdap.client.RdapClient)
```
Does RDAP lookups against defined URL.
### Methods
#### \__init__
`def __init__(self)`
Initialize an RdapClient.
config is a dict or rdap.config.Config object
config_dir is a string pointing to a config directory
---
#### get_asn
`def get_asn(self, asn)`
Handle asns that fall into the private/documentation ranges
manually - others are processed normally through rdap lookup.
---