Stephane Barbarie | 3559506 | 2018-02-08 08:34:39 -0500 | [diff] [blame^] | 1 | package core |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "github.com/opencord/voltha/ponsim/v2/common" |
| 6 | "github.com/opencord/voltha/protos/go/bbf_fiber" |
| 7 | "github.com/opencord/voltha/protos/go/voltha" |
| 8 | "github.com/sirupsen/logrus" |
| 9 | ) |
| 10 | |
| 11 | type XPonSimDevice struct { |
| 12 | } |
| 13 | |
| 14 | /* |
| 15 | |
| 16 | */ |
| 17 | func (d *XPonSimDevice) Start(ctx context.Context) { |
| 18 | } |
| 19 | |
| 20 | /* |
| 21 | |
| 22 | */ |
| 23 | func (d *XPonSimDevice) Stop(ctx context.Context) { |
| 24 | } |
| 25 | |
| 26 | /* |
| 27 | |
| 28 | */ |
| 29 | func (d *XPonSimDevice) CreateInterface(ctx context.Context, config *voltha.InterfaceConfig) { |
| 30 | common.Logger().WithFields(logrus.Fields{ |
| 31 | "context": ctx, |
| 32 | "device": d, |
| 33 | "interface_type": config.GetInterfaceType(), |
| 34 | "data": config, |
| 35 | }).Info("create-interface-request") |
| 36 | } |
| 37 | |
| 38 | /* |
| 39 | |
| 40 | */ |
| 41 | func (d *XPonSimDevice) UpdateInterface(ctx context.Context, config *voltha.InterfaceConfig) { |
| 42 | common.Logger().WithFields(logrus.Fields{ |
| 43 | "context": ctx, |
| 44 | "device": d, |
| 45 | "interface_type": config.GetInterfaceType(), |
| 46 | "data": config, |
| 47 | }).Info("update-interface-request") |
| 48 | } |
| 49 | |
| 50 | /* |
| 51 | |
| 52 | */ |
| 53 | func (d *XPonSimDevice) RemoveInterface(ctx context.Context, config *voltha.InterfaceConfig) { |
| 54 | common.Logger().WithFields(logrus.Fields{ |
| 55 | "context": ctx, |
| 56 | "device": d, |
| 57 | "interface_type": config.GetInterfaceType(), |
| 58 | "data": config, |
| 59 | }).Info("remove-interface-request") |
| 60 | } |
| 61 | |
| 62 | /* |
| 63 | |
| 64 | */ |
| 65 | func (d *XPonSimDevice) CreateTcont(ctx context.Context, |
| 66 | config *bbf_fiber.TcontsConfigData, |
| 67 | profile *bbf_fiber.TrafficDescriptorProfileData, |
| 68 | ) { |
| 69 | common.Logger().WithFields(logrus.Fields{ |
| 70 | "context": ctx, |
| 71 | "device": d, |
| 72 | "tcont_config_data": config, |
| 73 | "traffic_descriptor_profile_config_data": profile, |
| 74 | }).Info("create-tcont-request") |
| 75 | } |
| 76 | |
| 77 | /* |
| 78 | |
| 79 | */ |
| 80 | func (d *XPonSimDevice) UpdateTcont( |
| 81 | ctx context.Context, |
| 82 | config *bbf_fiber.TcontsConfigData, |
| 83 | profile *bbf_fiber.TrafficDescriptorProfileData, |
| 84 | ) { |
| 85 | common.Logger().WithFields(logrus.Fields{ |
| 86 | "context": ctx, |
| 87 | "device": d, |
| 88 | "tcont_config_data": config, |
| 89 | "traffic_descriptor_profile_config_data": profile, |
| 90 | }).Info("update-tcont-request") |
| 91 | } |
| 92 | |
| 93 | /* |
| 94 | |
| 95 | */ |
| 96 | func (d *XPonSimDevice) RemoveTcont( |
| 97 | ctx context.Context, |
| 98 | config *bbf_fiber.TcontsConfigData, |
| 99 | profile *bbf_fiber.TrafficDescriptorProfileData, |
| 100 | ) { |
| 101 | common.Logger().WithFields(logrus.Fields{ |
| 102 | "context": ctx, |
| 103 | "device": d, |
| 104 | "tcont_config_data": config, |
| 105 | "traffic_descriptor_profile_config_data": profile, |
| 106 | }).Info("remove-tcont-request") |
| 107 | } |
| 108 | |
| 109 | /* |
| 110 | |
| 111 | */ |
| 112 | func (d *XPonSimDevice) CreateGemport(ctx context.Context, config *voltha.InterfaceConfig) { |
| 113 | common.Logger().WithFields(logrus.Fields{ |
| 114 | "context": ctx, |
| 115 | "device": d, |
| 116 | "interface_type": config.GetInterfaceType(), |
| 117 | "data": config, |
| 118 | }).Info("create-gemport-request") |
| 119 | } |
| 120 | |
| 121 | /* |
| 122 | |
| 123 | */ |
| 124 | func (d *XPonSimDevice) UpdateGemport(ctx context.Context, config *voltha.InterfaceConfig) { |
| 125 | common.Logger().WithFields(logrus.Fields{ |
| 126 | "context": ctx, |
| 127 | "device": d, |
| 128 | "interface_type": config.GetInterfaceType(), |
| 129 | "data": config, |
| 130 | }).Info("update-gemport-request") |
| 131 | } |
| 132 | |
| 133 | /* |
| 134 | |
| 135 | */ |
| 136 | func (d *XPonSimDevice) RemoveGemport(ctx context.Context, config *voltha.InterfaceConfig) { |
| 137 | common.Logger().WithFields(logrus.Fields{ |
| 138 | "context": ctx, |
| 139 | "device": d, |
| 140 | "interface_type": config.GetInterfaceType(), |
| 141 | "data": config, |
| 142 | }).Info("remove-gemport-request") |
| 143 | } |
| 144 | |
| 145 | /* |
| 146 | |
| 147 | */ |
| 148 | func (d *XPonSimDevice) CreateMulticastGemport(ctx context.Context, config *voltha.InterfaceConfig) { |
| 149 | common.Logger().WithFields(logrus.Fields{ |
| 150 | "context": ctx, |
| 151 | "device": d, |
| 152 | "interface_type": config.GetInterfaceType(), |
| 153 | "data": config, |
| 154 | }).Info("create-multicast-gemport-request") |
| 155 | } |
| 156 | |
| 157 | /* |
| 158 | |
| 159 | */ |
| 160 | func (d *XPonSimDevice) UpdateMulticastGemport(ctx context.Context, config *voltha.InterfaceConfig) { |
| 161 | common.Logger().WithFields(logrus.Fields{ |
| 162 | "context": ctx, |
| 163 | "device": d, |
| 164 | "interface_type": config.GetInterfaceType(), |
| 165 | "data": config, |
| 166 | }).Info("update-multicast-gemport-request") |
| 167 | } |
| 168 | |
| 169 | /* |
| 170 | |
| 171 | */ |
| 172 | func (d *XPonSimDevice) RemoveMulticastGemport(ctx context.Context, config *voltha.InterfaceConfig) { |
| 173 | common.Logger().WithFields(logrus.Fields{ |
| 174 | "context": ctx, |
| 175 | "device": d, |
| 176 | "interface_type": config.GetInterfaceType(), |
| 177 | "data": config, |
| 178 | }).Info("remove-multicast-gemport-request") |
| 179 | } |
| 180 | |
| 181 | /* |
| 182 | |
| 183 | */ |
| 184 | func (d *XPonSimDevice) CreateMulticastDistributionSet(ctx context.Context, config *voltha.InterfaceConfig) { |
| 185 | common.Logger().WithFields(logrus.Fields{ |
| 186 | "context": ctx, |
| 187 | "device": d, |
| 188 | "interface_type": config.GetInterfaceType(), |
| 189 | "data": config, |
| 190 | }).Info("create-multicast-distribution-set-request") |
| 191 | } |
| 192 | |
| 193 | /* |
| 194 | |
| 195 | */ |
| 196 | func (d *XPonSimDevice) UpdateMulticastDistributionSet(ctx context.Context, config *voltha.InterfaceConfig) { |
| 197 | common.Logger().WithFields(logrus.Fields{ |
| 198 | "context": ctx, |
| 199 | "device": d, |
| 200 | "interface_type": config.GetInterfaceType(), |
| 201 | "data": config, |
| 202 | }).Info("update-multicast-distribution-set-request") |
| 203 | } |
| 204 | |
| 205 | /* |
| 206 | |
| 207 | */ |
| 208 | func (d *XPonSimDevice) RemoveMulticastDistributionSet(ctx context.Context, config *voltha.InterfaceConfig) { |
| 209 | common.Logger().WithFields(logrus.Fields{ |
| 210 | "context": ctx, |
| 211 | "device": d, |
| 212 | "interface_type": config.GetInterfaceType(), |
| 213 | "data": config, |
| 214 | }).Info("remove-multicast-distribution-set-request") |
| 215 | } |