Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 1 | #include <stdint.h> |
| 2 | #include <stdio.h> |
| 3 | #include <string.h> |
| 4 | #include <assert.h> |
| 5 | #include <stdlib.h> |
| 6 | |
| 7 | #include "card_emu.h" |
| 8 | #include "cardemu_prot.h" |
| 9 | #include "tc_etu.h" |
| 10 | #include "req_ctx.h" |
| 11 | |
| 12 | /* stub functions required by card_emu.c */ |
| 13 | |
| 14 | int card_emu_uart_update_fidi(uint8_t uart_chan, unsigned int fidi) |
| 15 | { |
| 16 | printf("uart_update_fidi(uart_chan=%u, fidi=%u)\n", uart_chan, fidi); |
| 17 | return 0; |
| 18 | } |
| 19 | |
| 20 | int card_emu_uart_tx(uint8_t uart_chan, uint8_t byte) |
| 21 | { |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 22 | printf("UART_TX(%02x)\n", byte); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 23 | return 1; |
| 24 | } |
| 25 | |
| 26 | void card_emu_uart_enable(uint8_t uart_chan, uint8_t rxtx) |
| 27 | { |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 28 | char *rts; |
| 29 | switch (rxtx) { |
| 30 | case 0: |
| 31 | rts = "OFF"; |
| 32 | break; |
| 33 | case ENABLE_TX: |
| 34 | rts = "TX"; |
| 35 | break; |
| 36 | case ENABLE_RX: |
| 37 | rts = "RX"; |
| 38 | break; |
| 39 | default: |
| 40 | rts = "unknown"; |
| 41 | break; |
| 42 | }; |
| 43 | |
| 44 | printf("uart_enable(uart_chan=%u, %s)\n", uart_chan, rts); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | void tc_etu_set_wtime(uint8_t tc_chan, uint16_t wtime) |
| 48 | { |
| 49 | printf("tc_etu_set_wtime(tc_chan=%u, wtime=%u)\n", tc_chan, wtime); |
| 50 | } |
| 51 | |
| 52 | void tc_etu_set_etu(uint8_t tc_chan, uint16_t etu) |
| 53 | { |
| 54 | printf("tc_etu_set_etu(tc_chan=%u, etu=%u)\n", tc_chan, etu); |
| 55 | } |
| 56 | |
| 57 | void tc_etu_init(uint8_t chan_nr, void *handle) |
| 58 | { |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 59 | printf("tc_etu_init(tc_chan=%u)\n", chan_nr); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 60 | } |
| 61 | |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 62 | void tc_etu_enable(uint8_t chan_nr) |
| 63 | { |
| 64 | printf("tc_etu_enable(tc_chan=%u)\n", chan_nr); |
| 65 | } |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 66 | |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 67 | void tc_etu_disable(uint8_t chan_nr) |
| 68 | { |
| 69 | printf("tc_etu_disable(tc_chan=%u)\n", chan_nr); |
| 70 | } |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 71 | |
| 72 | |
| 73 | #if 0 |
| 74 | /* process a single byte received from the reader */ |
| 75 | void card_emu_process_rx_byte(struct card_handle *ch, uint8_t byte); |
| 76 | |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 77 | /* hardware driver informs us that a card I/O signal has changed */ |
| 78 | void card_emu_io_statechg(struct card_handle *ch, enum card_io io, int active); |
| 79 | |
| 80 | /* User sets a new ATR to be returned during next card reset */ |
| 81 | int card_emu_set_atr(struct card_handle *ch, const uint8_t *atr, uint8_t len); |
| 82 | #endif |
| 83 | |
| 84 | |
| 85 | static int verify_atr(struct card_handle *ch) |
| 86 | { |
| 87 | uint8_t atr[4]; |
| 88 | uint8_t byte; |
| 89 | unsigned int i; |
| 90 | |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 91 | printf("receiving + verifying ATR:\n"); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 92 | for (i = 0; i < sizeof(atr); i++) { |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 93 | assert(card_emu_tx_byte(ch) == 1); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 94 | } |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 95 | assert(card_emu_tx_byte(ch) == 0); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 96 | |
| 97 | return 1; |
| 98 | } |
| 99 | |
| 100 | static void io_start_card(struct card_handle *ch) |
| 101 | { |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 102 | /* bring the card up from the dead */ |
| 103 | card_emu_io_statechg(ch, CARD_IO_VCC, 1); |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 104 | assert(card_emu_tx_byte(ch) == 0); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 105 | card_emu_io_statechg(ch, CARD_IO_CLK, 1); |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 106 | assert(card_emu_tx_byte(ch) == 0); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 107 | card_emu_io_statechg(ch, CARD_IO_RST, 1); |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 108 | assert(card_emu_tx_byte(ch) == 0); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 109 | |
| 110 | /* release from reset and verify th ATR */ |
| 111 | card_emu_io_statechg(ch, CARD_IO_RST, 0); |
| 112 | verify_atr(ch); |
| 113 | } |
| 114 | |
Harald Welte | eef6c2a | 2016-02-24 22:19:03 +0100 | [diff] [blame] | 115 | static void reader_send_bytes(struct card_handle *ch, const uint8_t *bytes, unsigned int len) |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 116 | { |
| 117 | unsigned int i; |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 118 | for (i = 0; i < len; i++) { |
| 119 | printf("UART_RX(%02x)\n", bytes[i]); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 120 | card_emu_process_rx_byte(ch, bytes[i]); |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 121 | } |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | static void dump_rctx(struct req_ctx *rctx) |
| 125 | { |
| 126 | struct cardemu_usb_msg_hdr *mh = |
| 127 | (struct cardemu_usb_msg_hdr *) rctx->data; |
| 128 | struct cardemu_usb_msg_rx_data *rxd; |
| 129 | int i; |
| 130 | |
| 131 | printf("req_ctx(%p): state=%u, size=%u, tot_len=%u, idx=%u, data=%p\n", |
| 132 | rctx, rctx->state, rctx->size, rctx->tot_len, rctx->idx, rctx->data); |
| 133 | printf(" msg_type=%u, seq_nr=%u, data_len=%u\n", |
| 134 | mh->msg_type, mh->seq_nr, mh->data_len); |
| 135 | |
| 136 | switch (mh->msg_type) { |
| 137 | case CEMU_USB_MSGT_DO_RX_DATA: |
| 138 | rxd = (struct cardemu_usb_msg_rx_data *)mh; |
| 139 | printf(" flags=%x, data=", rxd->flags); |
| 140 | for (i = 0; i < mh->data_len; i++) |
| 141 | printf(" %02x", rxd->data[i]); |
| 142 | printf("\n"); |
| 143 | break; |
| 144 | } |
| 145 | } |
| 146 | |
Harald Welte | 0ab6fcd | 2016-02-25 00:08:22 +0100 | [diff] [blame^] | 147 | static void get_and_verify_rctx(int state, const char *data, unsigned int len) |
| 148 | { |
| 149 | struct req_ctx *rctx; |
| 150 | struct cardemu_usb_msg_tx_data *td; |
| 151 | struct cardemu_usb_msg_rx_data *rd; |
| 152 | |
| 153 | rctx = req_ctx_find_get(0, state, RCTX_S_USB_TX_BUSY); |
| 154 | assert(rctx); |
| 155 | dump_rctx(rctx); |
| 156 | |
| 157 | /* verify the contents of the rctx */ |
| 158 | switch (state) { |
| 159 | case RCTX_S_USB_TX_PENDING: |
| 160 | td = (struct cardemu_usb_msg_tx_data *) rctx->data; |
| 161 | assert(td->hdr.msg_type == CEMU_USB_MSGT_DO_RX_DATA); |
| 162 | assert(td->hdr.data_len == len); |
| 163 | assert(!memcmp(td->data, data, len)); |
| 164 | break; |
| 165 | #if 0 |
| 166 | case RCTX_S_UART_RX_PENDING: |
| 167 | rd = (struct cardemu_usb_msg_rx_data *) rctx->data; |
| 168 | assert(rd->hdr.data_len == len); |
| 169 | assert(!memcmp(rd->data, data, len)); |
| 170 | break; |
| 171 | #endif |
| 172 | default: |
| 173 | assert(0); |
| 174 | } |
| 175 | |
| 176 | /* free the req_ctx, indicating it has fully arrived on the host */ |
| 177 | req_ctx_set_state(rctx, RCTX_S_FREE); |
| 178 | } |
| 179 | |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 180 | /* emulate a TPDU header being sent by the reader/phone */ |
Harald Welte | eef6c2a | 2016-02-24 22:19:03 +0100 | [diff] [blame] | 181 | static void rdr_send_tpdu_hdr(struct card_handle *ch, const uint8_t *tpdu_hdr) |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 182 | { |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 183 | /* we don't want a receive context to become available during |
| 184 | * the first four bytes */ |
Harald Welte | eef6c2a | 2016-02-24 22:19:03 +0100 | [diff] [blame] | 185 | reader_send_bytes(ch, tpdu_hdr, 4); |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 186 | assert(!req_ctx_find_get(0, RCTX_S_USB_TX_PENDING, RCTX_S_USB_TX_BUSY)); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 187 | |
Harald Welte | eef6c2a | 2016-02-24 22:19:03 +0100 | [diff] [blame] | 188 | reader_send_bytes(ch, tpdu_hdr+4, 1); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 189 | /* but then after the final byte of the TPDU header, we want a |
| 190 | * receive context to be available for USB transmission */ |
Harald Welte | 0ab6fcd | 2016-02-25 00:08:22 +0100 | [diff] [blame^] | 191 | get_and_verify_rctx(RCTX_S_USB_TX_PENDING, tpdu_hdr, 5); |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | /* emulate a CEMU_USB_MSGT_DT_TX_DATA received from USB */ |
Harald Welte | eef6c2a | 2016-02-24 22:19:03 +0100 | [diff] [blame] | 195 | static void host_to_device_data(const uint8_t *data, uint16_t len, unsigned int flags) |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 196 | { |
| 197 | struct req_ctx *rctx; |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 198 | struct cardemu_usb_msg_tx_data *rd; |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 199 | |
| 200 | /* allocate a free req_ctx */ |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 201 | rctx = req_ctx_find_get(0, RCTX_S_FREE, RCTX_S_USB_RX_BUSY); |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 202 | assert(rctx); |
| 203 | |
| 204 | /* initialize the header */ |
| 205 | rd = (struct cardemu_usb_msg_rx_data *) rctx->data; |
Harald Welte | eef6c2a | 2016-02-24 22:19:03 +0100 | [diff] [blame] | 206 | rctx->tot_len = sizeof(*rd) + len; |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 207 | cardemu_hdr_set(&rd->hdr, CEMU_USB_MSGT_DT_TX_DATA); |
Harald Welte | eef6c2a | 2016-02-24 22:19:03 +0100 | [diff] [blame] | 208 | rd->flags = flags; |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 209 | /* copy data and set length */ |
| 210 | rd->hdr.data_len = len; |
| 211 | memcpy(rd->data, data, len); |
| 212 | |
| 213 | /* hand the req_ctx to the UART transmit code */ |
| 214 | req_ctx_set_state(rctx, RCTX_S_UART_TX_PENDING); |
| 215 | } |
| 216 | |
Harald Welte | eef6c2a | 2016-02-24 22:19:03 +0100 | [diff] [blame] | 217 | /* card-transmit any pending characters */ |
| 218 | static int card_tx_print_chars(struct card_handle *ch) |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 219 | { |
| 220 | uint8_t byte; |
| 221 | int count = 0; |
| 222 | |
Harald Welte | 6bf8c12 | 2016-02-24 21:04:08 +0100 | [diff] [blame] | 223 | while (card_emu_tx_byte(ch)) { |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 224 | count++; |
| 225 | } |
| 226 | return count; |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 227 | } |
| 228 | |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 229 | const uint8_t tpdu_hdr_sel_mf[] = { 0xA0, 0xA4, 0x00, 0x00, 0x00 }; |
Harald Welte | 61bb30e | 2015-11-14 23:44:14 +0100 | [diff] [blame] | 230 | const uint8_t tpdu_pb_sw[] = { 0x90, 0x00 }; |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 231 | |
Harald Welte | c043e64 | 2016-02-24 23:26:55 +0100 | [diff] [blame] | 232 | static void |
| 233 | test_tpdu_reader2card(struct card_handle *ch, const uint8_t *hdr, const uint8_t *body, uint8_t body_len) |
| 234 | { |
Harald Welte | c043e64 | 2016-02-24 23:26:55 +0100 | [diff] [blame] | 235 | printf("\n==> transmitting APDU (HDR + PB + card-RX)\n"); |
| 236 | |
| 237 | /* emulate the reader sending a TPDU header */ |
| 238 | rdr_send_tpdu_hdr(ch, hdr); |
| 239 | /* we shouldn't have any pending card-TX yet */ |
| 240 | assert(!card_tx_print_chars(ch)); |
Harald Welte | 0ab6fcd | 2016-02-25 00:08:22 +0100 | [diff] [blame^] | 241 | |
Harald Welte | c043e64 | 2016-02-24 23:26:55 +0100 | [diff] [blame] | 242 | /* card emulator PC sends a singly byte PB response via USB */ |
| 243 | host_to_device_data(hdr+1, 1, CEMU_DATA_F_FINAL | CEMU_DATA_F_PB_AND_RX); |
| 244 | /* card actually sends that single PB */ |
| 245 | assert(card_tx_print_chars(ch) == 1); |
| 246 | |
| 247 | /* emulate more characters from reader to card */ |
| 248 | reader_send_bytes(ch, body, body_len); |
| 249 | |
| 250 | /* check if we have received them on the USB side */ |
Harald Welte | 0ab6fcd | 2016-02-25 00:08:22 +0100 | [diff] [blame^] | 251 | get_and_verify_rctx(RCTX_S_USB_TX_PENDING, body, body_len); |
Harald Welte | c043e64 | 2016-02-24 23:26:55 +0100 | [diff] [blame] | 252 | |
| 253 | /* ensure there is no extra data received on usb */ |
| 254 | assert(!req_ctx_find_get(0, RCTX_S_USB_TX_PENDING, RCTX_S_USB_TX_BUSY)); |
| 255 | |
| 256 | /* card emulator sends SW via USB */ |
| 257 | host_to_device_data(tpdu_pb_sw, sizeof(tpdu_pb_sw), |
| 258 | CEMU_DATA_F_FINAL | CEMU_DATA_F_PB_AND_TX); |
| 259 | /* obtain any pending tx chars */ |
| 260 | assert(card_tx_print_chars(ch) == sizeof(tpdu_pb_sw)); |
| 261 | |
| 262 | /* simulate some clock stop */ |
| 263 | card_emu_io_statechg(ch, CARD_IO_CLK, 0); |
| 264 | card_emu_io_statechg(ch, CARD_IO_CLK, 1); |
| 265 | } |
| 266 | |
| 267 | static void |
| 268 | test_tpdu_card2reader(struct card_handle *ch, const uint8_t *hdr, const uint8_t *body, uint8_t body_len) |
| 269 | { |
| 270 | printf("\n==> transmitting APDU (HDR + PB + card-TX)\n"); |
| 271 | |
| 272 | /* emulate the reader sending a TPDU header */ |
| 273 | rdr_send_tpdu_hdr(ch, hdr); |
| 274 | assert(!card_tx_print_chars(ch)); |
| 275 | |
| 276 | /* card emulator PC sends a response PB via USB */ |
| 277 | host_to_device_data(hdr+1, 1, CEMU_DATA_F_PB_AND_TX); |
| 278 | |
| 279 | /* card actually sends that PB */ |
| 280 | assert(card_tx_print_chars(ch) == 1); |
| 281 | |
| 282 | /* emulate more characters from card to reader */ |
| 283 | host_to_device_data(body, body_len, 0); |
| 284 | /* obtain those bytes as they arrvive on the card */ |
| 285 | assert(card_tx_print_chars(ch) == body_len); |
| 286 | |
| 287 | /* ensure there is no extra data received on usb */ |
| 288 | assert(!req_ctx_find_get(0, RCTX_S_USB_TX_PENDING, RCTX_S_USB_TX_BUSY)); |
| 289 | |
| 290 | /* card emulator sends SW via USB */ |
| 291 | host_to_device_data(tpdu_pb_sw, sizeof(tpdu_pb_sw), CEMU_DATA_F_FINAL); |
| 292 | |
| 293 | /* obtain any pending tx chars */ |
| 294 | assert(card_tx_print_chars(ch) == sizeof(tpdu_pb_sw)); |
| 295 | |
| 296 | /* simulate some clock stop */ |
| 297 | card_emu_io_statechg(ch, CARD_IO_CLK, 0); |
| 298 | card_emu_io_statechg(ch, CARD_IO_CLK, 1); |
| 299 | } |
| 300 | |
| 301 | |
Harald Welte | eef6c2a | 2016-02-24 22:19:03 +0100 | [diff] [blame] | 302 | /* READ RECORD (offset 0, 10 bytes) */ |
| 303 | const uint8_t tpdu_hdr_read_rec[] = { 0xA0, 0xB2, 0x00, 0x00, 0x0A }; |
| 304 | const uint8_t tpdu_body_read_rec[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 }; |
| 305 | |
| 306 | /* WRITE RECORD */ |
| 307 | const uint8_t tpdu_hdr_write_rec[] = { 0xA0, 0xD2, 0x00, 0x00, 0x07 }; |
| 308 | const uint8_t tpdu_body_write_rec[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 }; |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 309 | |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 310 | int main(int argc, char **argv) |
| 311 | { |
| 312 | struct card_handle *ch; |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 313 | unsigned int i; |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 314 | |
| 315 | req_ctx_init(); |
| 316 | |
| 317 | ch = card_emu_init(0, 23, 42); |
| 318 | assert(ch); |
| 319 | |
Harald Welte | b436286 | 2015-11-14 19:02:33 +0100 | [diff] [blame] | 320 | /* start up the card (VCC/RST, ATR) */ |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 321 | io_start_card(ch); |
Harald Welte | eef6c2a | 2016-02-24 22:19:03 +0100 | [diff] [blame] | 322 | assert(!card_tx_print_chars(ch)); |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 323 | |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 324 | for (i = 0; i < 2; i++) { |
Harald Welte | c043e64 | 2016-02-24 23:26:55 +0100 | [diff] [blame] | 325 | test_tpdu_reader2card(ch, tpdu_hdr_write_rec, tpdu_body_write_rec, sizeof(tpdu_body_write_rec)); |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 326 | |
Harald Welte | c043e64 | 2016-02-24 23:26:55 +0100 | [diff] [blame] | 327 | test_tpdu_card2reader(ch, tpdu_hdr_read_rec, tpdu_body_read_rec, sizeof(tpdu_body_read_rec)); |
Harald Welte | 84ec252 | 2015-11-14 23:03:50 +0100 | [diff] [blame] | 328 | } |
Harald Welte | 9d3e382 | 2015-11-09 00:50:54 +0100 | [diff] [blame] | 329 | |
| 330 | exit(0); |
| 331 | } |