CFM

class os_ken.lib.packet.cfm.cc_message(md_lv=0, version=0, rdi=0, interval=4, seq_num=0, mep_id=1, md_name_format=4, md_name_length=0, md_name=b'0', short_ma_name_format=2, short_ma_name_length=0, short_ma_name=b'1', tlvs=None)

CFM (IEEE Std 802.1ag-2007) Continuity Check Message (CCM) encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

md_lv

Maintenance Domain Level.

version

The protocol version number.

rdi

RDI bit.

interval

CCM Interval.The default is 4 (1 frame/s)

seq_num

Sequence Number.

mep_id

Maintenance association End Point Identifier.

md_name_format

Maintenance Domain Name Format. The default is 4 (Character string)

md_name_length

Maintenance Domain Name Length. (0 means automatically-calculate when encoding.)

md_name

Maintenance Domain Name.

short_ma_name_format

Short MA Name Format. The default is 2 (Character string)

short_ma_name_length

Short MA Name Format Length. (0 means automatically-calculate when encoding.)

short_ma_name

Short MA Name.

tlvs

TLVs.

class os_ken.lib.packet.cfm.cfm(op=None)

CFM (Connectivity Fault Management) Protocol header class.

http://standards.ieee.org/getieee802/download/802.1ag-2007.pdf

OpCode Field range assignments

OpCode range

CFM PDU or organization

0

Reserved for IEEE 802.1

1

Continuity Check Message (CCM)

2

Loopback Reply (LBR)

3

Loopback Message (LBM)

4

Linktrace Reply (LTR)

5

Linktrace Message (LTM)

06 - 31

Reserved for IEEE 802.1

32 - 63

Defined by ITU-T Y.1731

64 - 255

Reserved for IEEE 802.1.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

op

CFM PDU

classmethod parser(buf)

Decode a protocol header.

This method is used only when decoding a packet.

Decode a protocol header at offset 0 in bytearray buf. Returns the following three objects.

  • An object to describe the decoded header.

  • A packet_base.PacketBase subclass appropriate for the rest of the packet. None when the rest of the packet should be considered as raw payload.

  • The rest of packet.

serialize(payload, prev)

Encode a protocol header.

This method is used only when encoding a packet.

Encode a protocol header. Returns a bytearray which contains the header.

payload is the rest of the packet which will immediately follow this header.

prev is a packet_base.PacketBase subclass for the outer protocol header. prev is None if the current header is the outer-most. For example, prev is ipv4 or ipv6 for tcp.serialize.

class os_ken.lib.packet.cfm.data_tlv(length=0, data_value=b'')

CFM (IEEE Std 802.1ag-2007) Data TLV encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

length

Length of Value field. (0 means automatically-calculate when encoding)

data_value

Bit pattern of any of n octets.(n = length)

class os_ken.lib.packet.cfm.interface_status_tlv(length=0, interface_status=1)

CFM (IEEE Std 802.1ag-2007) Interface Status TLV encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

length

Length of Value field. (0 means automatically-calculate when encoding.)

interface_status

Interface Status.The default is 1 (isUp)

CFM (IEEE Std 802.1ag-2007) Linktrace Message (LTM) encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

md_lv

Maintenance Domain Level.

version

The protocol version number.

use_fdb_only

UseFDBonly bit.

transaction_id

LTM Transaction Identifier.

ttl

LTM TTL.

ltm_orig_addr

Original MAC Address.

ltm_targ_addr

Target MAC Address.

tlvs

TLVs.

CFM (IEEE Std 802.1ag-2007) Linktrace Reply (LTR) encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

version

The protocol version number.

use_fdb_only

UseFDBonly bit.

fwd_yes

FwdYes bit.

terminal_mep

TerminalMep bit.

transaction_id

LTR Transaction Identifier.

ttl

Reply TTL.

relay_action

Relay Action.The default is 1 (RlyHit)

tlvs

TLVs.

class os_ken.lib.packet.cfm.loopback_message(md_lv=0, version=0, transaction_id=0, tlvs=None)

CFM (IEEE Std 802.1ag-2007) Loopback Message (LBM) encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

md_lv

Maintenance Domain Level.

version

The protocol version number.

transaction_id

Loopback Transaction Identifier.

tlvs

TLVs.

class os_ken.lib.packet.cfm.loopback_reply(md_lv=0, version=0, transaction_id=0, tlvs=None)

CFM (IEEE Std 802.1ag-2007) Loopback Reply (LBR) encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

md_lv

Maintenance Domain Level.

version

The protocol version number.

transaction_id

Loopback Transaction Identifier.

tlvs

TLVs.

class os_ken.lib.packet.cfm.ltm_egress_identifier_tlv(length=0, egress_id_ui=0, egress_id_mac='00:00:00:00:00:00')

CFM (IEEE Std 802.1ag-2007) LTM EGRESS TLV encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

length

Length of Value field. (0 means automatically-calculate when encoding.)

egress_id_ui

Egress Identifier of Unique ID.

egress_id_mac

Egress Identifier of MAC address.

class os_ken.lib.packet.cfm.ltr_egress_identifier_tlv(length=0, last_egress_id_ui=0, last_egress_id_mac='00:00:00:00:00:00', next_egress_id_ui=0, next_egress_id_mac='00:00:00:00:00:00')

CFM (IEEE Std 802.1ag-2007) LTR EGRESS TLV encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

length

Length of Value field. (0 means automatically-calculate when encoding.)

last_egress_id_ui

Last Egress Identifier of Unique ID.

last_egress_id_mac

Last Egress Identifier of MAC address.

next_egress_id_ui

Next Egress Identifier of Unique ID.

next_egress_id_mac

Next Egress Identifier of MAC address.

class os_ken.lib.packet.cfm.organization_specific_tlv(length=0, oui=b'\x00\x00\x00', subtype=0, value=b'')
CFM (IEEE Std 802.1ag-2007) Organization Specific TLV

encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

length

Length of Value field. (0 means automatically-calculate when encoding.)

oui

Organizationally Unique Identifier.

subtype

Subtype.

value

Value.(optional)

class os_ken.lib.packet.cfm.port_status_tlv(length=0, port_status=2)

CFM (IEEE Std 802.1ag-2007) Port Status TLV encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

length

Length of Value field. (0 means automatically-calculate when encoding.)

port_status

Port Status.The default is 1 (psUp)

class os_ken.lib.packet.cfm.reply_egress_tlv(length=0, action=1, mac_address='00:00:00:00:00:00', port_id_length=0, port_id_subtype=0, port_id=b'')

CFM (IEEE Std 802.1ag-2007) Reply Egress TLV encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

length

Length of Value field. (0 means automatically-calculate when encoding.)

action

Egress Action.The default is 1 (EgrOK)

mac_address

Egress MAC Address.

port_id_length

Egress PortID Length. (0 means automatically-calculate when encoding.)

port_id_subtype

Egress PortID Subtype.

port_id

Egress PortID.

class os_ken.lib.packet.cfm.reply_ingress_tlv(length=0, action=1, mac_address='00:00:00:00:00:00', port_id_length=0, port_id_subtype=0, port_id=b'')

CFM (IEEE Std 802.1ag-2007) Reply Ingress TLV encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

length

Length of Value field. (0 means automatically-calculate when encoding.)

action

Ingress Action.The default is 1 (IngOK)

mac_address

Ingress MAC Address.

port_id_length

Ingress PortID Length. (0 means automatically-calculate when encoding.)

port_id_subtype

Ingress PortID Subtype.

port_id

Ingress PortID.

class os_ken.lib.packet.cfm.sender_id_tlv(length=0, chassis_id_length=0, chassis_id_subtype=4, chassis_id=b'', ma_domain_length=0, ma_domain=b'', ma_length=0, ma=b'')

CFM (IEEE Std 802.1ag-2007) Sender ID TLV encoder/decoder class.

This is used with os_ken.lib.packet.cfm.cfm.

An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order.

Attribute

Description

length

Length of Value field. (0 means automatically-calculate when encoding.)

chassis_id_length

Chassis ID Length. (0 means automatically-calculate when encoding.)

chassis_id_subtype

Chassis ID Subtype. The default is 4 (Mac Address)

chassis_id

Chassis ID.

ma_domain_length

Management Address Domain Length. (0 means automatically-calculate when encoding.)

ma_domain

Management Address Domain.

ma_length

Management Address Length. (0 means automatically-calculate when encoding.)

ma

Management Address.