summaryrefslogtreecommitdiffstats
path: root/network_manager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* vlan: Modify create method to return an ObjectPathWilliam A. Kennington III2019-04-091-2/+2
| | | | | | | | This will be nice to have for ipmid so that it can easily figure out the path of the new vlan object when it creates one. Change-Id: I6b93c5e64499c0cb9e36e8354eda6089bfd6d6c9 Signed-off-by: William A. Kennington III <wak@google.com>
* configure: Remove systemd dbus pathsWilliam A. Kennington III2019-03-121-0/+4
| | | | | | | | | Nothing but our code references these variable so lets just define them where they are needed instead of having the configure script populate them. Change-Id: Ibd08d0698488febf5ea1cc8d6c14379ea6a50051 Signed-off-by: William A. Kennington III <wak@google.com>
* util: Reset Failed Before Restarting ServiceWilliam A. Kennington III2019-01-181-0/+15
| | | | | | | | | | | | | | | | If we don't reset the failed counter in systemd for a specific service like systemd-networkd, restarts won't always be issued as expected. If the service fails due to a bad configuration, future changes that would normally put it in a valid state will be unable to restart it since it hit the reset threshold for the given time window. Tested: Built and ran on a zaius for testing. Issuing bad network configuration changes over ipmi no longer prevents future changes from fixing systemd-networkd. Change-Id: I646309001a257b12e2df006d8c420c93c5c0bca8 Signed-off-by: William A. Kennington III <wak@google.com>
* Re-enable unit testRatan Gupta2018-11-301-0/+17
| | | | | | | | | | | | Unit test were broken after sd bus calls started throwing exception, In this repo we start the systemd-networkd with the use of sd bus calls, which throws exception and it was not handled in the test case. This commit fixes the problem by mocking the network manager which mock the functionality of function which makes the sdbus call. Change-Id: I5b60a2117a661cffa36200415ca611b85dd2fda1 Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
* Migrate to a common timer classWilliam A. Kennington III2018-09-271-12/+5
| | | | | | | | | | | | This change pulls in sdeventplus and uses the timer implementation as a drop in for the currently included timer. Tested: Unit tests still build but are not currently running. Manually tested this change on a zaius machine and made sure timers went off. Change-Id: I2808196581fc766843931403b83fead16926b0ae Signed-off-by: William A. Kennington III <wak@google.com>
* clang-format: Update to match docs repoGunnar Mills2018-09-151-31/+22
| | | | | | | | | 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>
* reorder headersPatrick Venture2018-08-271-12/+11
| | | | | | | | | | | | | | | | | | 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>
* Network factory reset: don't recreate VLAN interfacesMichael Tritz2017-10-251-0/+7
| | | | | | | | | | | | | This commit fixes a defect with the network factory reset. When VLANs are created on a particular interface and that interface is reset, the VLANs should disappear. They weren't disappearing; they were being deleted and recreated during the reset process. This commit stops the VLAN interfaces from being recreated. Resolves openbmc/openbmc#2478 Change-Id: I46dd0183185cc57f3dd8680cf1ac8404c9fd316a Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
* Reduce the number of restarts of systemd-networkdRatan Gupta2017-10-111-9/+14
| | | | | | | | | | | | | Start the timer once we get the dbus request and wait for timeout if we get the dbus request in meanwhile, reset the timer and wait for timeout. Listen for ipv6 rtnetlink address also. Resolves openbmc/openbmc#2227 Change-Id: I3f448e84107826defafb9ada523c1ab08ec1b971 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Create the default network file during startup of network managerRatan Gupta2017-10-031-36/+55
| | | | | | | | | | if network file is not on the system then create the default network file with dhcp enabled. Resolves openbmc/openbmc#2332 Change-Id: I9e523c76f684dcb2951a0a730f94b11f326b5489 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Restart the network through networkManagerRatan Gupta2017-10-031-2/+22
| | | | | | | | | | | | | | | Extend the refresh timer once we get the Dbus request which requires network restart. Detaching the network restart from the writeConfiguration func. Write the configuration file for the vlan interface in writeConfiguration func. During creation of vlan,vlan interface should come up with dhcp as false. Change-Id: Iadc7b44554aca412d211d13e9569cc601ad04074 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Implement getInterfaces in utilRatan Gupta2017-09-291-10/+10
| | | | | | | | | | | | 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>
* Network factory reset: Log InternalFailure in case of failureMichael Tritz2017-09-251-2/+2
| | | | | | | | | This commit creates an InternalFailure error in the event of a factory reset failure. This error was added to the factory reset interface as a part of openbmc/openbmc#1721. Change-Id: Ia13df96823c3566da71a10cc945db15c205a2932 Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
* DHCP value was not getting updated correctlyRatan Gupta2017-08-311-5/+6
| | | | | | | | | | | | | This commit fixes =>Disable zeroconf. =>Correct the network conf file path in factory reset. =>Updating the DHCP value correctly. Resolves openbmc/openbmc#2230 Resolves openbmc/openbmc#2215 Change-Id: I8f87c2afb53cc952755165d34bfb62b8aba80fe5 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* vlan:Minor FixesRatan Gupta2017-08-131-1/+1
| | | | | | | | | =>Get the dhcp value from the conf File for the vlan interface. =>Assign the mac address of the parnt interface to vlan interface. =>Create the ipv6 child ip objects once create the vlan interface. Change-Id: I1d73fb18f9d300cbdcf94c73f06df2ea4a1d019b Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Move getDHCPValue function to utilRatan Gupta2017-08-131-28/+1
| | | | | Change-Id: Id90e60aec666e5098358f1890fbdead6744e2675 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Remove vlan device files during factory resetRatan Gupta2017-08-131-16/+7
| | | | | Change-Id: I7ef2adcb7c29bcc22c53b8cb7ba73d5c8cc90602 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Load the VLAN interfaces from the systemRatan Gupta2017-08-131-7/+27
| | | | | | | | | At start up Network Manager creates all the interfaces by reading it from the system.This commit creates the vlan interface after reading it from the system. Change-Id: I38e6f3b776f834e33d17e4e88f700b4f52af4048 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Move the implementation for writing conf to interface classRatan Gupta2017-08-131-98/+2
| | | | | | | | implementation of writing interface conf to the ethernet interface class. Change-Id: I279afff45a82ca92c4e50810664f7a7c69a66a61 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Create the VLAN Interface ObjectRatan Gupta2017-08-131-1/+5
| | | | | Change-Id: I118fc4bbcad2a478a8aad976e0619537780c1227 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Pass the network conf dir to network manager constructorRatan Gupta2017-08-131-2/+15
| | | | | | | | | when the network manager comes up,it should have its conf dir path which caller wants,instead of calling one more function to set the desired conf dir. Change-Id: I282c1d5e1c6edb2b6e77d16518d2204a6ac41a45 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Changed the type of vlan id from 16 bit to 32 bitRatan Gupta2017-08-131-1/+1
| | | | | | | | | Vlan interface is having vlanid as 32 bit but the create interface was having 16 bit so this commit changes the type of vlanid property in the create interface to 32 bit. Change-Id: I423fdcee86c2d78653fc11d426a241e7d979e16b Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Don't commit the error during getting of DHCP valueRatan Gupta2017-08-101-1/+1
| | | | | | | | | | | When network manager comes up, it parses the file to get the dhcp value from the config file,if DHCP key is not there then don't commit the error. Resolves openbmc/openbmc#2011 Change-Id: Ic86454a3502096cae2edbb9afe917f5567aa84a6 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Write DHCP configuration parametersRatan Gupta2017-07-251-4/+25
| | | | | | | | | | Write the configuration parameters to the systemd-networkd conf file. Resolves openbmc/openbmc#1770 Change-Id: I6c9427034827d612ad7f75961461c2f33688fbf9 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Create DHCP configuration DBUS objectRatan Gupta2017-07-251-0/+4
| | | | | | | | Network Manager creates the DHCP configuration object. Change-Id: I0119aa4a4b688adec7f7160ff1706aa87cc2bd1f Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Implement generic restart systemd unit functionRatan Gupta2017-07-191-17/+1
| | | | | Change-Id: Ibd0ec4e7c3b9c395898673839ccf4de85616b201 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Refresh the interface objects if DHCP mode changesRatan Gupta2017-06-291-1/+1
| | | | | | | | | | Create the ipaddress objects for the ethernet interface whose DHCP is enabled. Resolves openbmc/openbmc#1295 Change-Id: Id5ad35f1d51f2bf80c4e2b573e7bd38489370411 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Move function from network manager to utility functionRatan Gupta2017-06-211-89/+1
| | | | | | | | 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>
* Implement the DHCP supportRatan Gupta2017-06-211-2/+41
| | | | | | | | | | | During creation of ethernet interface dbus object, read the DHCP from the conf file. Write the DHCP option in the conf file during writing the network configuration file. Change-Id: Ibead1ff91d30d14c475493d1ef2c877d14d0d915 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Create the system conf Dbus ObjectRatan Gupta2017-06-211-8/+33
| | | | | | | | Also put extra checks while writing the gateway and the destination to the conf file. Change-Id: I8f24b3f293e6f978b655f061a198a32690dd44f3 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Implement the ipaddress origin and gateway propertyRatan Gupta2017-06-091-0/+24
| | | | | | | Resolves openbmc/openbmc#1590 Change-Id: I76328e596336f8b8f1394b1927d48ce52f819a66 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Write the network configuration in the network fileRatan Gupta2017-06-081-1/+65
| | | | | Change-Id: Ic5ae90fb7b82539b943c4db0bc2eb116ec0d778f Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Restructure the code so that it is unit testableRatan Gupta2017-06-081-8/+14
| | | | | Change-Id: I2af7a26d054522beae82f58769f8c2420a22eca2 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Add the network utility fileRatan Gupta2017-06-081-99/+6
| | | | | | | | | | 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>
* Create error log if unable to fetch the interface infoRatan Gupta2017-06-081-6/+8
| | | | | Change-Id: I3e075fa04d7d0bb6f10b80d00a0aafd676be68e6 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Convert IPv6 subnet mask into prefix lengthRatan Gupta2017-06-071-11/+74
| | | | | Change-Id: I7921400b3f83876c5d3cb1440fcbf926551cebcb Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Implement network factory reset in network_managerMichael Tritz2017-06-051-0/+53
| | | | | | | | | | | | This commit implements a factory reset interface for the BMC network. This factory reset is accomplished by removing any /etc/systemd/network/*.network files, then writing new ones configured for DHCP for each known interface. Resolves openbmc/openbmc#1575 Change-Id: Ic006cd43fb336029479cffa783b56ab91e0339bd Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
* Convert IPv4 subnet mask into prefix lengthRatan Gupta2017-05-231-6/+56
| | | | | | | Resolves openbmc/openbmc#1292 Change-Id: I9b24e98589bd68cc59893b5e43b514bd0bec3f26 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Implement create interface for ipaddressRatan Gupta2017-05-231-15/+19
| | | | | Change-Id: Ia4598c27c11667dafb70a8af58871661b7042d0f Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Implement NetworkManagerRatan Gupta2017-04-271-0/+118
Change-Id: Ifa8169d903ecab1575662cfc0f9a1c950d56144f Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
OpenPOWER on IntegriCloud