Code Documentation¶
ancp¶
Python ANCP Client
ancp/client.py¶
ANCP Client
Copyright (C) 2017-2021, Christian Giese (GIC-de) SPDX-License-Identifier: MIT
-
class
ancp.client.
Client
(address, port=6068, tech_type=5, timer=25.0, source_address=None)[source]¶ ANCP Client
Parameters: - address (str) – ANCP server address (IPv4)
- port (int) – ANCP port (default: 6086)
- tech_type (ancp.client.TechTypes) – tech type (default=DSL)
- timer (int) – adjacency timer (default=25.0)
- source_address (str) – optional source address
-
port_down
(subscribers)[source]¶ send port-down message
For backwards compability single value ANCP subscribers are accepted.
Parameters: subscriber ([ancp.subscriber.Subscriber]) – collection of ANCP subscribers
-
port_up
(subscribers)[source]¶ send port-up message
For backwards compability single value ANCP subscribers are accepted.
Parameters: subscriber ([ancp.subscriber.Subscriber]) – collection of ANCP subscribers
ancp/subscriber.py¶
ANCP Subscribers
Copyright (C) 2017-2021, Christian Giese (GIC-de) SPDX-License-Identifier: MIT
-
class
ancp.subscriber.
DataLink
[source]¶ Access-Loop-Encapsulation - Data Link
-
ATM_AAL5
= 0¶
-
ETHERNET
= 1¶
-
-
class
ancp.subscriber.
DslType
[source]¶ DSL Types
-
ADSL
= 1¶
-
ADSL2
= 2¶
-
ADSL2P
= 3¶
-
OTHER
= 0¶
-
SDSL
= 6¶
-
VDSL1
= 4¶
-
VDSL2
= 5¶
-
-
class
ancp.subscriber.
Encap1
[source]¶ Access-Loop-Encapsulation - Encapsulation 1
-
DOUBLE_TAGGED_ETHERNET
= 3¶
-
NA
= 0¶
-
SINGLE_TAGGED_ETHERNET
= 2¶
-
UNTAGGED_ETHERNET
= 1¶
-
-
class
ancp.subscriber.
Encap2
[source]¶ Access-Loop-Encapsulation - Encapsulation 2
-
EOAAL5_LLC
= 6¶
-
EOAAL5_LLC_FCS
= 5¶
-
EOAAL5_NULL
= 8¶
-
EOAAL5_NULL_FCS
= 7¶
-
IPOA_LLC
= 3¶
-
IPOA_Null
= 4¶
-
PPPOA_LLC
= 1¶
-
PPPOA_NULL
= 2¶
-
-
class
ancp.subscriber.
Subscriber
(aci, **kwargs)[source]¶ ANCP Subscriber
Parameters: - aci (str) – Access-Loop-Circuit-ID
- ari (str) – Access-Loop-Remote-ID
- aaci_bin (int or tuple) – Access-Aggregation-Circuit-ID-Binary
- aaci_ascii (str) – Access-Aggregation-Circuit-ID-ASCII
- state (ancp.subscriber.LineState) – DSL-Line-State
- up (int) – Actual-Net-Data-Rate-Upstream
- down (int) – Actual-Net-Data-Rate-Downstream
- min_up (int) – Minimum-Net-Data-Rate-Upstream
- min_down (int) – Minimum-Net-Data-Rate-Downstream
- att_up (int) – Attainable-Net-Data-Rate-Upstream
- att_down (int) – Attainable-Net-Data-Rate-Downstream
- max_up (int) – Maximum-Net-Data-Rate-Upstream
- max_down (int) – Maximum-Net-Data-Rate-Downstream
- dsl_type (ancp.subscriber.DslType) – DSL-Type
- data_link (ancp.subscriber.DataLink) – Access-Loop-Encapsulation - Data Link
- encap1 (ancp.subscriber.Encap1) – Access-Loop-Encapsulation - Encapsulation 1
- encap2 (ancp.subscriber.Encap2) – Access-Loop-Encapsulation - Encapsulation 2
-
aaci_bin
¶
-
tlvs
¶
-
class
ancp.subscriber.
TlvType
[source]¶ TLV Types
-
AACI_ASCII
= 3¶
-
AACI_BIN
= 6¶
-
ACC_LOOP_ENC
= 144¶
-
ACI
= 1¶
-
ARI
= 2¶
-
ATT_DOWN
= 134¶
-
ATT_UP
= 133¶
-
DOWN
= 130¶
-
LINE
= 4¶
-
MAX_DOWN
= 136¶
-
MAX_UP
= 135¶
-
MIN_DOWN
= 132¶
-
MIN_UP
= 131¶
-
STATE
= 143¶
-
TYPE
= 145¶
-
UP
= 129¶
-
-
ancp.subscriber.
access_loop_enc
(data_link, encap1, encap2)[source]¶ Create the Access Loop Tlv
Parameters: - data_link (ancp.subscriber.DataLink) – The Data link type
- encap1 (ancp.subscriber.Encap1) – The first Encapsulation type
- encap2 (ancp.subscriber.Encap2) – The second Encapsulation type
Return type: