| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to be able to configure interfaces which are not running. Just
because we don't have a cable plugged into the machine doesn't mean we
don't want to have the option to configure it from the host
Tested:
Built an image and made sure the interface was now present and
configurable even if it had no link present.
Change-Id: Ib93ddddc8ca015fe024209fa9cbeb5fc24421728
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This one is pretty trivial since there is only one size of mac
address, but we want to be sure we validate the buffer.
Tested:
Built and runs through unit tests. Works when integrated into
neighbor parsing code.
Change-Id: Iaf58fc398b51a3bcbbf70968cbe353beeb7b9f54
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We commonly want to be able to turn netlink network order address data
into the corresponding InAddrAny when parsing netlink data. This makes
it trivial given the address family and data buffer.
Tested:
Ran throgh unit tests and builds fine in a BMC image.
Change-Id: I4ebe1dbd284f150ea03ee091cddda5a06806c01f
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
| |
We need this for future work which turns netlink data into IP addresses.
Tested:
Run through unit tests.
Change-Id: If078b28246509ca2ebd3bf7bab652b84258df0bd
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
| |
We need to be able to convert a mac addresses from byte form into our
typical human readable string form.
Tested:
Unit tests pass.
Change-Id: I6e68cfefd4d5962e1125c1b5229e61fce475729a
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
| |
If unable to fetch the networkID from the IP address string
This is kind of internal failure where reporting is not needed
and no service action is associated with it.
Change-Id: Ia54226f2dd77a69fd23433730c424ee0e3c6ac57
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
This cleans up the use of mapbox only .get() variant apis in favor of
the std::get() interface which both implementations provide.
Change-Id: I9ba8301801d68b391fa5195de37b2b0ecec26edf
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
| |
Update the .clang-format file and run clang-format-6.0.
This .clang-format matches the example one in
https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting
Change-Id: Ia331c9a5b040e1a3c45a0ebf1b8d776d93b05ae5
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reordering all the headers to the following structure:
header file:
local
c
cpp (including openbmc libraries)
source file:
source.hpp (if applicable)
local
c
cpp
Change-Id: Ia74a5c761a3029819366159de3cfd40c5e4c4a2c
Signed-off-by: Patrick Venture <venture@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Partly resolves openbmc/openbmc 2905
Bonus! The new static_assert found a related bug in log.cpp:
log("msg", entry("fmt", data, entry("fmt", data)))
which should have been:
log("msg", entry("fmt", data), entry("fmt", data))
Tested: static_assert only
Change-Id: Ie1c550a27f454ef92ee096d812adcc400a1a25cf
Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Checking if the interface name is not the same as the previous is based
upon the assumption that your list of interface names (ifa->ifa_name) will
always come back in sorted order of the interface they belong to, i.e.
eth0:
169.172.0.1
128.42.38.7
eth1:
14.243.48.103
fe80::740:61ff:fe74:3eb2
This assumption is wrong since the IP address can come in any order they
please, i.e.
eth0:
169.172.0.1
eth1:
fe80::740:61ff:fe74:3eb2
eth0:
128.42.38.7
eth1:
14.243.48.103
The if condition I removed is looking to see if the interface name is not
equal to the previous interface name, where it would assume it was
rolling over to the next free interface, always leaving you with the
last valid IP in the interface. In my case it was leaving me with only
IPv4 addresses and not including IPv6 addresses.
Tested By: Resetting my network to factory defaults, checking DBUS for
all ipv6 addresses:
dbus-send --system \
--print-reply \
--dest=xyz.openbmc_project.Network \
/xyz/openbmc_project/network/eth0/ipv6\
org.freedesktop.DBus.Introspectable.Introspect
Adding an IPv6 Address:
dbus-send --system \
--dest=xyz.openbmc_project.Network \
--type=method_call \
--print-reply \
/xyz/openbmc_project/network/eth0 \
xyz.openbmc_project.Network.IP.Create.IP \
string:"xyz.openbmc_project.Network.IP.Protocol.IPv6" \
string:"2002:1001:1001:1001:1001:1001:1001:1006" byte:10 \
string:"1001:1001:1001:1001:1001:1001:1001:1001" \
Validating the static IPv6 address appeared by the initial introspect command.
Change-Id: I3b85cecded696c251028accb28448f6e53bd9a7f
Signed-off-by: David Cobbley <david.j.cobbley@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Presently the code was creating the elog during reading of
the values from the config parser which creates
the journal log internally("Internal error Occured")
Apart from creating elog,Code also logs into the journal
more descriptive message saying which section and key
was not found.
The code which catches the exception that also logs
into the journal.
In the changed approach instead of throwing exception
we are returning the return code as not finding a section
or key in the network config file is not an error.
Change-Id: Ib89a3af6541fdf93fb5fa9a8e583d6c6ed88da79
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: I953614024660287b94d835e30b117cc4023e749b
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
-validates IPAddress/gateway using inet_pton api.
-validates prefix length for ipv4/ipv6.
-if dhcp is enabled, it won't allow to set ip/gateway.
Resolves openbmc/openbmc#1671
Change-Id: I76c1d9d11dfb59002eb1310d87e94ee622714a4a
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
getInterfaceAddrs returns the map of interface
and associated address,if there is no address
associated with the interface,then we don't get
that interface.
This API gets all the available interfaces on the
system.
Change-Id: I86f07d6e9950a15547cb74356939ca40368bddcc
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: If9b52187610651afc9d800bf6f5f3b81b1f1df19
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
| |
Change-Id: I16992dda259246a66512792f06cbbb874e56a15d
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: Id90e60aec666e5098358f1890fbdead6744e2675
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Delete the in-memory vlan object,Also
deletes the associated device file and the
network file.
Change-Id: I613e31aaa4fa9172c6226765ac044481ffbd88ec
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
| |
Change-Id: Ibd0ec4e7c3b9c395898673839ccf4de85616b201
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
|
| |
Function which fetches the interface address from the system.
Add some types to types.hpp
Change-Id: Ie2c02980a9fd7a0aaeafa22d93bc758b5c79fd04
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
|
|
|
|
|
| |
eg 192.168.2.24/24 ==> 192.168.2.0
Change-Id: I5e46ce7b371360c90ef74fac175c8379c6f31d4c
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|
|
Moving utility functions from network manager to
util.cpp.
Added few more utility functions.
Change-Id: I2e73c873e9a3bea543d6979463b2181e8374e12e
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
|