Skip to content

PPP Connection type #55

Open
Open

Description

@Regela

Hello! I need to add PPP Connection type to ‎sdbus_async/networkmanager/enums.py
It is a pptp vpn by network-manager-pptp

Type:    Ppp
Name:    ppp0
Address: 10.0.0.11/32
DNS:     10.0.0.10
DNS:     8.8.8.8
Traceback (most recent call last):
  File "/tmp/pycharm_project_872/network_manager_device_info.py", line 110, in <module>
    asyncio.run(list_networkdevice_details_async())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/tmp/pycharm_project_872/network_manager_device_info.py", line 101, in list_networkdevice_details_async
    connection_id = await get_most_recent_connection_id(dev_name, dev_type)
  File "/tmp/pycharm_project_872/network_manager_device_info.py", line 39, in get_most_recent_connection_id
    if connection.connection_type != getattr(ConnectionType, dev_type):
  File "/usr/lib/python3.10/enum.py", line 437, in __getattr__
    raise AttributeError(name) from None
AttributeError: PPP

Thank you for excellent library!

Activity

  1. igo95862 commented on Jun 27, 2023

    @igo95862
    Collaborator

    Hello,

    I think there is a PPPOE device type defined, however, it is probably the wrong name:

    Can you try renaming it to PPP = "ppp"?

  2. Regela commented on Jun 27, 2023

    @Regela
    Author

    No, PPOE and PPP it is a different things. I add PPP = "ppp" to ConnectionType enum and it solved my problem. Please, add it in repo )

  3. igo95862 commented on Nov 25, 2023

    @igo95862
    Collaborator

    Hmmm...

    Looking at the NetworkManager source code it looks like the PPP device connection setting type should be "pppoe"?

    https://github.com/NetworkManager/NetworkManager/blob/02371a18b0bd1f30ae9d093646d49048d4944dc9/src/core/devices/nm-device-ppp.c#L327C25-L327C25

    The NM_SETTING_PPP_SETTING_NAME seems to be almost unused anywhere in the source code.

  4. igo95862 commented on Nov 25, 2023

    @igo95862
    Collaborator

    Ok I think I get it.

    So the Device D-Bus interface returns the 23 which in the DeviceType enum has a name PPP.

    However, the PPP Device requires the Connection Settings type field set to "pppoe" so the correct value should be PPP = "pppoe".

    However, the ConnectionType enum should probably be a map named REQUIRED_CONNECTION_SETTING_TYPE and it won't cover all device types as it seems that certain device types can support multiple connection settings.

    For example, VETH:

    https://github.com/NetworkManager/NetworkManager/blob/02371a18b0bd1f30ae9d093646d49048d4944dc9/src/core/devices/nm-device-veth.c#L196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions