0

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

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

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

4

1 回答 1

1

对于遇到此问题的任何人,我终于让它正常工作。使用 nodejs dbus-native库。这是形成用于 dbus 和网络管理器的 ipv6 属性的正确方法

['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
              ]
            ]
          ]
        ]
      ]
    ]
  ]
于 2018-07-25T17:33:44.007 回答