节点 dbus 网络管理器 IPV6 地址 属性 绑定

Node dbus Network Manager IPV6 addresses property binding

我在 "addresses" 以及 Network Manager Dbus API 中用于 ipv6 连接的 "address-data" 属性有问题。对于地址,据说他们正在寻找 ipv6 对象的结构数组,这将是 Array of (Array of BYTE, UINT32, Array of BYTE) sig - a(ayuay) Gnome 文档的 link 是这里 https://developer.gnome.org/NetworkManager/1.10/settings-ipv6.html

'address-data': [ {'address': settings.ip, 'prefix':settings.subnet} ],
'gateway': settings.gateway,

经过一些试验后,我收到的错误实际上是 JS 堆栈转储,而不是守护程序错误。有没有人有幸让这个工作?

对于任何 运行 遇到这个问题的人,我终于让它正常工作了。使用 nodejs dbus-native 库。这是形成 ipv6 属性 以与 dbus 和 Network Manager

一起使用的正确方法
['802-3-ethernet',
    [
      ['auto-negotiate', ['b', 1]],
    ]
  ],
  ['connection',
    [
      ['id', ['s', 'some name']],
      ['type', ['s','802-3-ethernet']],
      ['uuid', ['s', uuidv4()]],
      ['interface-name', ['s', 'name of interface (eth0, wlan0)']],
      ['autoconnect', ['b', 1]]
    ]
  ],
  ['ipv4',
    [
      ['method', ['s','auto']]
    ]
  ],
  ['ipv6',
    [
      ['method', ['s','manual']],
      ['ip6-privacy', ['i', -1]]
      ['dns',
        ['aay',
          [
            [
              '2001:4860:4860::8888',  //needs to be array or buffer of uint8
              '2001:4860:4860::8844'  //needs to be array or buffer of uint8
            ]
          ]
        ]
      ],
      ['addresses',
        ['a(ayuay)',
          [
            [
              [
                'static ipv6 ip',  //needs to be array or buffer of uint8
                parseInt(CIDR, example: 64),
                'ipv6 gateway ip'  //needs to be array or buffer of uint8
              ]
            ]
          ]
        ]
      ]
    ]
  ]