Skip to content

support for asdot notation for 4 Byte ASN #8293

@empusas

Description

@empusas

NetBox version

v3.1.5

Feature type

Change to existing functionality

Proposed functionality

In the netbox url/ipam/asns/ and netbox ur>/ipam/asns/#/ view the AS Number should be displayed in asplain and asdot notation.
The db model does not have to be changed as we can still only store the asplain value in the db.

The actual conversion can be done in the web browser with some simple javascript like this:

 function conv_asplain2asdot() {
        asplain = document.AScalc.asplain.value;
        var asdot1 = (Math.floor(asplain/65536));
        var asdot2 = asplain%65536;
        document.AScalc.asdot1.value = asdot1;
        document.AScalc.asdot2.value = asdot2;
};

function conv_asdot2asplain() {
        var asdot1 = document.AScalc.asdot1.value;
        var asdot2 = document.AScalc.asdot2.value;
        asplain = ((parseInt(asdot1) * 65536) + parseInt(asdot2));
        document.AScalc.asplain.value = asplain;
};

Use case

4 Byte AS number get more popular these day and the asdot notation seems to be much easier to work with.

Database changes

not required, conversion can be done in javascript at runtime as mentioned above.

External dependencies

none

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions