@@ -48,20 +48,23 @@ void mdns_priv_pcb_announce(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol,
48
48
if (PCB_STATE_IS_PROBING (_pcb )) {
49
49
mdns_priv_init_pcb_probe (tcpip_if , ip_protocol , services , len , include_ip );
50
50
} else if (PCB_STATE_IS_ANNOUNCING (_pcb )) {
51
- mdns_tx_packet_t * p = _mdns_get_next_pcb_packet (tcpip_if , ip_protocol );
51
+ mdns_tx_packet_t * p = mdns_priv_get_next_packet (tcpip_if , ip_protocol );
52
52
if (p ) {
53
53
for (i = 0 ; i < len ; i ++ ) {
54
- if (!_mdns_alloc_answer (& p -> answers , MDNS_TYPE_SDPTR , services [i ]-> service , NULL , false, false)
55
- || !_mdns_alloc_answer (& p -> answers , MDNS_TYPE_PTR , services [i ]-> service , NULL , false, false)
56
- || !_mdns_alloc_answer (& p -> answers , MDNS_TYPE_SRV , services [i ]-> service , NULL , true, false)
57
- || !_mdns_alloc_answer (& p -> answers , MDNS_TYPE_TXT , services [i ]-> service , NULL , true, false)) {
54
+ if (!mdns_priv_create_answer (& p -> answers , MDNS_TYPE_SDPTR , services [i ]-> service , NULL , false, false)
55
+ || !mdns_priv_create_answer (& p -> answers , MDNS_TYPE_PTR , services [i ]-> service , NULL , false,
56
+ false)
57
+ || !mdns_priv_create_answer (& p -> answers , MDNS_TYPE_SRV , services [i ]-> service , NULL , true,
58
+ false)
59
+ || !mdns_priv_create_answer (& p -> answers , MDNS_TYPE_TXT , services [i ]-> service , NULL , true,
60
+ false)) {
58
61
break ;
59
62
}
60
63
}
61
64
if (include_ip ) {
62
- _mdns_dealloc_answer (& p -> additional , MDNS_TYPE_A , NULL );
63
- _mdns_dealloc_answer (& p -> additional , MDNS_TYPE_AAAA , NULL );
64
- _mdns_append_host_list_in_services (& p -> answers , services , len , true, false);
65
+ mdns_priv_dealloc_answer (& p -> additional , MDNS_TYPE_A , NULL );
66
+ mdns_priv_dealloc_answer (& p -> additional , MDNS_TYPE_AAAA , NULL );
67
+ mdns_priv_append_host_list_in_services (& p -> answers , services , len , true, false);
65
68
}
66
69
_pcb -> state = PCB_ANNOUNCE_1 ;
67
70
}
@@ -72,9 +75,9 @@ void mdns_priv_pcb_announce(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol,
72
75
}
73
76
74
77
_pcb -> state = PCB_ANNOUNCE_1 ;
75
- mdns_tx_packet_t * p = _mdns_create_announce_packet (tcpip_if , ip_protocol , services , len , include_ip );
78
+ mdns_tx_packet_t * p = mdns_priv_create_announce_packet (tcpip_if , ip_protocol , services , len , include_ip );
76
79
if (p ) {
77
- mdns_send_schedule_tx_packet (p , 0 );
80
+ mdns_priv_send_after (p , 0 );
78
81
}
79
82
}
80
83
}
@@ -152,7 +155,7 @@ void mdns_priv_pcb_disable(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol)
152
155
mdns_priv_netif_disable (tcpip_if );
153
156
154
157
if (mdns_priv_if_ready (tcpip_if , ip_protocol )) {
155
- _mdns_clear_pcb_tx_queue_head (tcpip_if , ip_protocol );
158
+ mdns_priv_clear_tx_queue_if (tcpip_if , ip_protocol );
156
159
deinit_pcb (tcpip_if , ip_protocol );
157
160
mdns_if_t other_if = mdns_priv_netif_get_other_interface (tcpip_if );
158
161
if (other_if != MDNS_MAX_INTERFACES && s_pcbs [other_if ][ip_protocol ].state == PCB_DUP ) {
@@ -191,7 +194,7 @@ void mdns_priv_pcb_set_duplicate(mdns_if_t tcpip_if)
191
194
if (mdns_priv_if_ready (other_if , i )) {
192
195
//stop this interface and mark as dup
193
196
if (mdns_priv_if_ready (tcpip_if , i )) {
194
- _mdns_clear_pcb_tx_queue_head (tcpip_if , i );
197
+ mdns_priv_clear_tx_queue_if (tcpip_if , i );
195
198
deinit_pcb (tcpip_if , i );
196
199
}
197
200
s_pcbs [tcpip_if ][i ].state = PCB_DUP ;
@@ -220,13 +223,13 @@ void mdns_priv_pcb_schedule_tx_packet(mdns_tx_packet_t *p)
220
223
}
221
224
//fallthrough
222
225
case PCB_PROBE_2 :
223
- mdns_send_schedule_tx_packet (p , 250 );
226
+ mdns_priv_send_after (p , 250 );
224
227
pcb -> state = (mdns_pcb_state_t )((uint8_t )(pcb -> state ) + 1 );
225
228
break ;
226
229
case PCB_PROBE_3 :
227
- a = _mdns_create_announce_from_probe (p );
230
+ a = mdns_priv_create_announce_from_probe (p );
228
231
if (!a ) {
229
- mdns_send_schedule_tx_packet (p , 250 );
232
+ mdns_priv_send_after (p , 250 );
230
233
break ;
231
234
}
232
235
pcb -> probe_running = false;
@@ -235,22 +238,22 @@ void mdns_priv_pcb_schedule_tx_packet(mdns_tx_packet_t *p)
235
238
pcb -> failed_probes = 0 ;
236
239
mdns_mem_free (pcb -> probe_services );
237
240
pcb -> probe_services = NULL ;
238
- _mdns_free_tx_packet (p );
241
+ mdns_priv_free_tx_packet (p );
239
242
p = a ;
240
243
send_after = 250 ;
241
244
//fallthrough
242
245
case PCB_ANNOUNCE_1 :
243
246
//fallthrough
244
247
case PCB_ANNOUNCE_2 :
245
- mdns_send_schedule_tx_packet (p , send_after );
248
+ mdns_priv_send_after (p , send_after );
246
249
pcb -> state = (mdns_pcb_state_t )((uint8_t )(pcb -> state ) + 1 );
247
250
break ;
248
251
case PCB_ANNOUNCE_3 :
249
252
pcb -> state = PCB_RUNNING ;
250
- _mdns_free_tx_packet (p );
253
+ mdns_priv_free_tx_packet (p );
251
254
break ;
252
255
default :
253
- _mdns_free_tx_packet (p );
256
+ mdns_priv_free_tx_packet (p );
254
257
break ;
255
258
}
256
259
}
@@ -368,7 +371,8 @@ static void init_probe_new_service(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_pro
368
371
pcb -> probe_services_len = 0 ;
369
372
pcb -> probe_running = false;
370
373
371
- mdns_tx_packet_t * packet = _mdns_create_probe_packet (tcpip_if , ip_protocol , s , services_final_len , true, probe_ip );
374
+ mdns_tx_packet_t * packet = mdns_priv_create_probe_packet (tcpip_if , ip_protocol , s , services_final_len , true,
375
+ probe_ip );
372
376
if (!packet ) {
373
377
mdns_mem_free (s );
374
378
return ;
@@ -378,15 +382,15 @@ static void init_probe_new_service(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_pro
378
382
pcb -> probe_services = s ;
379
383
pcb -> probe_services_len = services_final_len ;
380
384
pcb -> probe_running = true;
381
- mdns_send_schedule_tx_packet (packet , ((pcb -> failed_probes > 5 ) ? 1000 : 120 ) + (esp_random () & 0x7F ));
385
+ mdns_priv_send_after (packet , ((pcb -> failed_probes > 5 ) ? 1000 : 120 ) + (esp_random () & 0x7F ));
382
386
pcb -> state = PCB_PROBE_1 ;
383
387
}
384
388
385
389
void mdns_priv_init_pcb_probe (mdns_if_t tcpip_if , mdns_ip_protocol_t ip_protocol , mdns_srv_item_t * * services , size_t len , bool probe_ip )
386
390
{
387
391
mdns_pcb_t * pcb = & s_pcbs [tcpip_if ][ip_protocol ];
388
392
389
- _mdns_clear_pcb_tx_queue_head (tcpip_if , ip_protocol );
393
+ mdns_priv_clear_tx_queue_if (tcpip_if , ip_protocol );
390
394
391
395
if (mdns_utils_str_null_or_empty (mdns_priv_get_global_hostname ())) {
392
396
pcb -> state = PCB_RUNNING ;
@@ -432,7 +436,7 @@ void mdns_priv_pcb_send_bye_service(mdns_srv_item_t **services, size_t len, bool
432
436
for (i = 0 ; i < MDNS_MAX_INTERFACES ; i ++ ) {
433
437
for (j = 0 ; j < MDNS_IP_PROTOCOL_MAX ; j ++ ) {
434
438
if (mdns_priv_if_ready (i , j ) && s_pcbs [i ][j ].state == PCB_RUNNING ) {
435
- mdns_send_bye_pcb ((mdns_if_t ) i , (mdns_ip_protocol_t ) j , services , len , include_ip );
439
+ mdns_priv_send_bye ((mdns_if_t ) i , (mdns_ip_protocol_t ) j , services , len , include_ip );
436
440
}
437
441
}
438
442
}
0 commit comments